/* ============================================================
   Evenue — Desk re-skin
   Repaints Frappe/ERPNext Desk in the marketplace design system
   (space-blue canvas, cyan→violet gradient) and removes every
   visual cue that this is ERPNext underneath.
   Tokens mirror frontend/app/globals.css exactly.
   ============================================================ */

:root:root:root {
  /* Evenue palette */
  --evenue-bg:        #070b16 !important;
  --evenue-bg-2:      #0b1120 !important;
  --evenue-surface:   rgba(255, 255, 255, 0.035) !important;
  --evenue-surface-2: rgba(255, 255, 255, 0.06) !important;
  --evenue-border:    rgba(255, 255, 255, 0.09) !important;
  --evenue-text:      #e9eefb !important;
  --evenue-muted:     #9aa6c0 !important;
  --evenue-faint:     #6b7793 !important;
  --evenue-accent:    #4f8cff !important;
  --evenue-cyan:      #38e1ff !important;
  --evenue-violet:    #a06bff !important;
  --evenue-grad: linear-gradient(120deg, #38e1ff 0%, #4f8cff 45%, #a06bff 100%) !important;

  /* --- remap Frappe's own tokens onto ours --- */
  --primary:          var(--evenue-accent) !important;
  --primary-color:    var(--evenue-accent) !important;
  --brand-color:      var(--evenue-accent) !important;
  --bg-color:         var(--evenue-bg) !important;
  --fg-color:         var(--evenue-bg-2) !important;
  --card-bg:          var(--evenue-bg-2) !important;
  --subtle-fg:        var(--evenue-surface-2) !important;
  --control-bg:       rgba(0, 0, 0, 0.25) !important;
  --navbar-bg:        rgba(7, 11, 22, 0.72) !important;
  --sidebar-bg:       var(--evenue-bg-2) !important;
  --border-color:     var(--evenue-border) !important;
  --dark-border-color:var(--evenue-border) !important;
  --text-color:       var(--evenue-text) !important;
  --text-muted:       var(--evenue-muted) !important;
  --text-light:       var(--evenue-faint) !important;
  --heading-color:    var(--evenue-text) !important;
  --disabled-text-color: var(--evenue-faint) !important;
  --shadow-base:      0 10px 40px -12px rgba(0, 0, 0, 0.6) !important;
  --border-radius:    8px !important;
  --border-radius-md: 10px !important;
  --border-radius-lg: 14px !important;
}

body,
body[data-theme="light"],
body[data-theme="dark"],
[data-theme] {
  background: var(--evenue-bg) !important;
  color: var(--evenue-text);
}

/* ambient glow, same as the marketplace canvas */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 12% -10%, var(--evenue-glow-1), transparent 60%),
    radial-gradient(50vw 50vw at 100% 0%, var(--evenue-glow-2), transparent 55%);
}
.main-section, .page-container, .layout-main { position: relative; z-index: 1; }

/* navbar */
.navbar, .navbar-default {
  background: var(--evenue-navbar) !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--evenue-border) !important;
  box-shadow: none !important;
}
.navbar .navbar-brand img,
.navbar .app-logo { height: 26px; width: auto; border-radius: 7px; }

/* cards / surfaces */
.widget, .form-section, .frappe-card, .list-row-container,
.page-head, .layout-side-section .sidebar-section {
  background: var(--evenue-surface) !important;
  border: 1px solid var(--evenue-border) !important;
  border-radius: 14px;
  backdrop-filter: blur(10px);
}

/* primary actions carry the marketplace gradient */
.btn-primary, .btn.btn-primary {
  background: var(--evenue-grad) !important;
  border: none !important;
  color: var(--evenue-on-accent) !important;
  font-weight: 600;
  box-shadow: 0 10px 30px -8px var(--evenue-shadow);
}
.btn-primary:hover { filter: brightness(0.85); color: #fff !important; }
.btn-default, .btn-secondary {
  background: var(--evenue-surface-2) !important;
  border: 1px solid var(--evenue-border-strong) !important;
  color: var(--evenue-text) !important;
}

/* inputs */
input.form-control, select.form-control, textarea.form-control, .input-with-feedback {
  background: var(--evenue-input-bg) !important;
  border: 1px solid var(--evenue-border) !important;
  color: var(--evenue-text) !important;
}
input.form-control:focus, select.form-control:focus, textarea.form-control:focus {
  border-color: var(--evenue-accent) !important;
  box-shadow: 0 0 0 2px var(--evenue-focus) !important;
}

/* links & sidebar */
a, .sidebar-item-label { color: var(--evenue-accent); }
a:hover { color: var(--evenue-cyan); }
.sidebar-item-container.selected .sidebar-item-label { color: var(--evenue-text); font-weight: 600; }

/* login page */
.page-card, .login-content {
  background: var(--evenue-bg-2) !important;
  border: 1px solid var(--evenue-border) !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 60px -20px var(--evenue-shadow) !important;
}
.page-card .page-card-head .indicator { color: var(--evenue-text); }

/* ---- strip every ERPNext / Frappe identifier ---- */
.footer-powered,
a[href*="frappe.io"],
a[href*="erpnext.com"],
a[href*="frappeframework.com"],
.navbar .dropdown-help,
#toolbar-user .dropdown-item[data-label="About"],
.frappe-list .list-count-lite,
.splash img[src*="frappe"],
.app-logo[src*="frappe"],
.navbar-brand img[src*="erpnext"] {
  display: none !important;
}

/* scrollbars, to finish the canvas */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--evenue-bg); }
::-webkit-scrollbar-thumb {
  background: var(--evenue-border-strong);
  border-radius: 999px;
  border: 2px solid var(--evenue-bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--evenue-muted); }


/* ============================================================
   Themes. Same six the owner picks in the app, same names.

   `data-accent` is set by evenue.js from whatever that person chose; `data-theme` is
   Frappe's own Desk attribute, so switching Desk to Light in its own settings is
   respected here rather than overridden.

   Only the --evenue-* tokens are redefined -- everything above maps Frappe's tokens
   onto these, so the entire back office re-colours from these few lines.
   ============================================================ */

:root:root:root{
  --evenue-glow-1: rgba(79,140,255,.16) !important;
  --evenue-glow-2: rgba(160,107,255,.14) !important;
  --evenue-shadow: rgba(79,140,255,.45) !important;
  --evenue-focus:  rgba(79,140,255,.25) !important;
  --evenue-on-accent: #06101f !important;
  --evenue-border-strong: rgba(255,255,255,.16) !important;
  --evenue-input-bg: rgba(0,0,0,.25) !important;
  --evenue-navbar: rgba(7,11,22,.72) !important;
}

/* ---- light ---- */
:root:root:root[data-theme="light"]{
  --evenue-bg:        #f4f6fb !important;
  --evenue-bg-2:      #ffffff !important;
  --evenue-surface:   rgba(15,23,42,.035) !important;
  --evenue-surface-2: rgba(15,23,42,.05) !important;
  --evenue-border:    rgba(15,23,42,.10) !important;
  --evenue-border-strong: rgba(15,23,42,.18) !important;
  --evenue-text:      #10162b !important;
  --evenue-muted:     #4c5670 !important;
  --evenue-faint:     #79839c !important;
  --evenue-input-bg:  rgba(15,23,42,.035) !important;
  --evenue-navbar:    rgba(255,255,255,.82) !important;
  --evenue-on-accent: #ffffff !important;
  /* Dark-mode accents are tuned for a near-black canvas and wash out on a pale one. */
  --evenue-accent:    #2563eb !important;
  --evenue-cyan:      #0f8fae !important;
  --evenue-violet:    #7c3aed !important;
  --evenue-grad: linear-gradient(120deg,#0f8fae 0%,#2563eb 45%,#7c3aed 100%) !important;
  --evenue-glow-1: rgba(37,99,235,.10) !important;
  --evenue-glow-2: rgba(124,58,237,.08) !important;
  --evenue-shadow: rgba(37,99,235,.28) !important;
  --evenue-focus:  rgba(37,99,235,.22) !important;
}

/* ---- emerald ---- */
:root:root:root[data-accent="emerald"]{
  --evenue-accent:#2ee88a; --evenue-cyan:#5eead4; --evenue-violet:#14b8a6 !important;
  --evenue-grad:linear-gradient(120deg,#5eead4 0%,#2ee88a 45%,#14b8a6 100%) !important;
  --evenue-glow-1:rgba(46,232,138,.15); --evenue-glow-2:rgba(20,184,166,.12) !important;
  --evenue-shadow:rgba(46,232,138,.40); --evenue-focus:rgba(46,232,138,.25) !important;
}
:root:root:root[data-theme="light"][data-accent="emerald"]{
  --evenue-accent:#059669; --evenue-cyan:#0f766e; --evenue-violet:#0d9488 !important;
  --evenue-grad:linear-gradient(120deg,#0f766e 0%,#059669 45%,#0d9488 100%) !important;
  --evenue-glow-1:rgba(5,150,105,.10); --evenue-glow-2:rgba(13,148,136,.08) !important;
  --evenue-shadow:rgba(5,150,105,.26); --evenue-focus:rgba(5,150,105,.22) !important;
}

/* ---- violet ---- */
:root:root:root[data-accent="violet"]{
  --evenue-accent:#a855f7; --evenue-cyan:#d8b4fe; --evenue-violet:#ec4899 !important;
  --evenue-grad:linear-gradient(120deg,#d8b4fe 0%,#a855f7 45%,#ec4899 100%) !important;
  --evenue-glow-1:rgba(168,85,247,.16); --evenue-glow-2:rgba(236,72,153,.12) !important;
  --evenue-shadow:rgba(168,85,247,.42); --evenue-focus:rgba(168,85,247,.25) !important;
}
:root:root:root[data-theme="light"][data-accent="violet"]{
  --evenue-accent:#7c3aed; --evenue-cyan:#9333ea; --evenue-violet:#db2777 !important;
  --evenue-grad:linear-gradient(120deg,#9333ea 0%,#7c3aed 45%,#db2777 100%) !important;
  --evenue-glow-1:rgba(124,58,237,.10); --evenue-glow-2:rgba(219,39,119,.08) !important;
  --evenue-shadow:rgba(124,58,237,.26); --evenue-focus:rgba(124,58,237,.22) !important;
}

/* ---- gold ---- */
:root:root:root[data-accent="gold"]{
  --evenue-accent:#f5b83d; --evenue-cyan:#fcd34d; --evenue-violet:#f97316 !important;
  --evenue-grad:linear-gradient(120deg,#fcd34d 0%,#f5b83d 45%,#f97316 100%) !important;
  --evenue-glow-1:rgba(245,184,61,.15); --evenue-glow-2:rgba(249,115,22,.11) !important;
  --evenue-shadow:rgba(245,184,61,.40); --evenue-focus:rgba(245,184,61,.28) !important;
}
:root:root:root[data-theme="light"][data-accent="gold"]{
  --evenue-accent:#b45309; --evenue-cyan:#a16207; --evenue-violet:#c2410c !important;
  --evenue-grad:linear-gradient(120deg,#a16207 0%,#b45309 45%,#c2410c 100%) !important;
  --evenue-glow-1:rgba(180,83,9,.10); --evenue-glow-2:rgba(194,65,12,.07) !important;
  --evenue-shadow:rgba(180,83,9,.26); --evenue-focus:rgba(180,83,9,.22) !important;
}

/* ---- rose ---- */
:root:root:root[data-accent="rose"]{
  --evenue-accent:#fb7185; --evenue-cyan:#fda4af; --evenue-violet:#f43f5e !important;
  --evenue-grad:linear-gradient(120deg,#fda4af 0%,#fb7185 45%,#f43f5e 100%) !important;
  --evenue-glow-1:rgba(251,113,133,.15); --evenue-glow-2:rgba(244,63,94,.11) !important;
  --evenue-shadow:rgba(251,113,133,.40); --evenue-focus:rgba(251,113,133,.26) !important;
}
:root:root:root[data-theme="light"][data-accent="rose"]{
  --evenue-accent:#e11d48; --evenue-cyan:#9f1239; --evenue-violet:#be123c !important;
  --evenue-grad:linear-gradient(120deg,#9f1239 0%,#e11d48 45%,#be123c 100%) !important;
  --evenue-glow-1:rgba(225,29,72,.10); --evenue-glow-2:rgba(190,18,60,.07) !important;
  --evenue-shadow:rgba(225,29,72,.26); --evenue-focus:rgba(225,29,72,.22) !important;
}

/* ---- graphite ---- */
:root:root:root[data-accent="graphite"]{
  --evenue-accent:#a8b6cf; --evenue-cyan:#cbd5e1; --evenue-violet:#7c8aa5 !important;
  --evenue-grad:linear-gradient(120deg,#cbd5e1 0%,#a8b6cf 45%,#7c8aa5 100%) !important;
  --evenue-glow-1:rgba(168,182,207,.10); --evenue-glow-2:rgba(124,138,165,.08) !important;
  --evenue-shadow:rgba(168,182,207,.30); --evenue-focus:rgba(168,182,207,.28) !important;
}
:root:root:root[data-theme="light"][data-accent="graphite"]{
  --evenue-accent:#475569; --evenue-cyan:#64748b; --evenue-violet:#334155 !important;
  --evenue-grad:linear-gradient(120deg,#64748b 0%,#475569 45%,#334155 100%) !important;
  --evenue-glow-1:rgba(71,85,105,.08); --evenue-glow-2:rgba(51,65,85,.06) !important;
  --evenue-shadow:rgba(71,85,105,.24); --evenue-focus:rgba(71,85,105,.22) !important;
}
