/* IGO Group theme layer: dark-green sidebar, hero banner, tinted KPI cards.
   Loaded after styles.css; remove the <link> in index.html to go back to the old look. */

:root {
  --g-900: #0b3d22;
  --g-800: #12552f;
  --g-700: #1a6b3b;
  --g-500: #2fa660;
  --g-400: #3dbb78;
  --g-100: #e4f4ea;
  --bg: #f3f7f4;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-sm: 0 1px 2px rgba(11, 61, 34, 0.06), 0 8px 24px -14px rgba(11, 61, 34, 0.18);
  --shadow-md: 0 18px 40px -16px rgba(11, 61, 34, 0.35);
}

body { background: var(--bg); }

/* ---- sidebar ------------------------------------------------------ */
.shell { grid-template-columns: 268px minmax(0, 1fr); }
.sidebar {
  margin: 10px 0 10px 10px; height: calc(100dvh - 20px); top: 10px; border-radius: 22px; border: none;
  padding: 18px 12px 14px; color: #e8f5ec;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'><path d='M200 250c-4-60 14-110 54-150-30 6-60 22-76 52 2-30-8-60-28-84-6 34-2 70 14 104-24-14-52-18-80-10 24 20 54 30 88 30z' fill='%23ffffff' fill-opacity='0.06'/></svg>") no-repeat right -60px bottom -40px / 260px,
    linear-gradient(175deg, #1a6b3b 0%, #0f4a28 55%, #0a361d 100%);
  box-shadow: 0 20px 40px -20px rgba(11, 61, 34, 0.6);
}
.brand, .brand-text b { color: #fff; }
.brand-text small { color: rgba(232, 245, 236, 0.72); }
.nav-group-name { color: rgba(232, 245, 236, 0.62); font-weight: 500; font-size: 12px; margin-bottom: 6px; }
.nav-item { color: rgba(255, 255, 255, 0.86); border-radius: 14px; height: 42px; }
.nav-item .i { color: rgba(255, 255, 255, 0.9); }
.nav-item:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-item.active, .nav-item.active:hover:not(:disabled) {
  background: linear-gradient(90deg, #3dbb78, #2fa660); color: #fff; box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.5);
}
.nav-item .count { background: rgba(255, 255, 255, 0.16); color: #fff; }
.nav-item.active .count { background: rgba(255, 255, 255, 0.28); color: #fff; }
.nav-item .count.alert { background: rgba(255, 255, 255, 0.22); color: #fff; }
.nav-item.active .count.alert { background: rgba(255, 255, 255, 0.3); color: #fff; }
.tagline { color: rgba(232, 245, 236, 0.7); }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.25); border-radius: 6px; }

/* IGO Agri Techfarms logo (white tile so the black lettering reads on the green sidebar) */
.brand-mark { width: 50px; height: 50px; object-fit: contain; background: #fff; border-radius: 14px; padding: 3px; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.5); }
.login-logo { object-fit: contain; border-radius: 14px; background: #fff; border: 1px solid var(--card-border, rgba(15, 40, 28, 0.08)); padding: 2px; }
.brand { gap: 12px; }

/* ---- top bar ------------------------------------------------------ */
.topbar {
  background: var(--bg); border-bottom: 1px solid rgba(11, 61, 34, 0.06); padding: 12px 28px 10px; z-index: 60;
  box-shadow: 0 10px 14px -14px rgba(11, 61, 34, 0.35);
}
.igo-hero, .dsh-kpi, .panel { position: relative; z-index: 0; }
.search { border-radius: 999px; height: 44px; padding: 0 18px; background: #fff; border: 1px solid rgba(11, 61, 34, 0.1); box-shadow: var(--shadow-sm); max-width: 440px; }
.scope select { border-radius: 999px; height: 44px; background-color: #fff; border: 1px solid rgba(11, 61, 34, 0.1); box-shadow: var(--shadow-sm); padding-left: 18px; }
.avatar { background: linear-gradient(135deg, #1a6b3b, #3dbb78); color: #fff; width: 40px; height: 40px; }
.topbar-actions .icon-btn, .topbar-actions button { border-radius: 50%; }

/* ---- hero banner -------------------------------------------------- */
.igo-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 26px 30px 24px; min-height: 150px; margin-bottom: 18px; color: #fff;
  background:
    linear-gradient(90deg, rgba(8, 52, 28, 0.94) 0%, rgba(14, 86, 46, 0.82) 48%, rgba(14, 86, 46, 0.1) 100%),
    var(--hero-photo, none),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 220' preserveAspectRatio='xMaxYMax slice'><defs><linearGradient id='s' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%23cfeede'/><stop offset='1' stop-color='%23eaf8ef'/></linearGradient></defs><rect width='900' height='220' fill='url(%23s)'/><path d='M0 170 C150 140 300 190 450 165 C600 140 760 185 900 160 V220 H0Z' fill='%2379c98f'/><path d='M0 190 C200 170 360 205 520 188 C700 170 800 200 900 185 V220 H0Z' fill='%232f8f4e'/><rect x='520' y='88' width='300' height='84' rx='4' fill='%23f7faf8'/><rect x='520' y='80' width='300' height='14' fill='%231a6b3b'/><rect x='540' y='108' width='70' height='64' fill='%23bfe3d0' opacity='.8'/><rect x='630' y='108' width='70' height='64' fill='%23bfe3d0' opacity='.8'/><rect x='720' y='108' width='80' height='64' fill='%23bfe3d0' opacity='.8'/><rect x='660' y='52' width='120' height='34' rx='4' fill='%231a6b3b'/><circle cx='460' cy='168' r='16' fill='%2314502b'/><rect x='430' y='146' width='46' height='22' rx='3' fill='%231f8a45'/></svg>") no-repeat right bottom / cover;
  box-shadow: var(--shadow-sm);
}
.igo-hero-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: #fff; color: #14231b; font-size: 13px; font-weight: 500; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.4);
}
.igo-hero h1 { margin: 14px 0 6px; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.igo-hero p { margin: 0; max-width: 560px; color: rgba(255, 255, 255, 0.92); font-size: 15px; }
.igo-hero-meta { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255, 255, 255, 0.92); }

/* hero uses the supplied IGO photo (public/assets/igo-hero.jpg, 2000x650).
   The live greeting, title, subtitle and date range sit where the photo's own text was. */
.igo-hero {
  container-type: inline-size; padding: 0; min-height: 0; aspect-ratio: 2000 / 650; color: #0d4a2a;
  background: #dff0f8 url('/assets/igo-hero.jpg') center / cover no-repeat;
  border: 1px solid var(--card-border, rgba(15, 40, 28, 0.07));
}
.igo-hero-body { position: absolute; left: 32.75cqw; top: 5.6cqw; width: 25.4cqw; display: grid; gap: 0; }
.igo-hero .igo-hero-chip { justify-self: start; padding: 0.4cqw 1.1cqw; font-size: clamp(11px, 1.12cqw, 14px); box-shadow: 0 6px 16px -10px rgba(11, 61, 34, 0.5); }
.igo-hero .igo-hero-body h1 { margin: 0.7cqw 0 0.3cqw; font-size: clamp(18px, 2.6cqw, 34px); line-height: 1.08; color: #0d4a2a; letter-spacing: -0.02em; }
.igo-hero .igo-hero-body p { max-width: none; font-size: clamp(11.5px, 1.42cqw, 18px); line-height: 1.28; color: #3b4a42; }
.igo-hero .igo-hero-meta { margin-top: 0.6cqw; font-size: clamp(10.5px, 1cqw, 13px); line-height: 1.25; color: #0d4a2a; font-weight: 500; }
@media (max-width: 820px) {
  .igo-hero { aspect-ratio: auto; min-height: 300px; background-position: 14% center; }
  .igo-hero-body { position: relative; left: auto; top: auto; width: auto; margin: 16px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(4px); }
  .igo-hero .igo-hero-chip { padding: 5px 12px; font-size: 12px; }
  .igo-hero .igo-hero-body h1 { font-size: 22px; margin: 10px 0 4px; }
  .igo-hero .igo-hero-body p { font-size: 13.5px; }
  .igo-hero .igo-hero-meta { font-size: 12px; margin-top: 8px; }
}

/* ---- dashboard toolbar and cards ---------------------------------- */
.dsh-toolbar { align-items: center; margin: 0 0 18px; }
.dsh-field select { border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.panel { border-radius: 20px; border: 1px solid rgba(11, 61, 34, 0.06); box-shadow: var(--shadow-sm); }

.dsh-kpis { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.dsh-kpi.stat {
  position: relative; overflow: hidden; padding: 18px 18px 54px; border-radius: 22px; border: 1px solid rgba(11, 61, 34, 0.05);
  background-color: #fff; background-repeat: no-repeat; background-position: bottom; background-size: 100% 56px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dsh-kpi.dsh-click:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.dsh-kpi.stat { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; text-align: left; }
.dsh-kpi .stat-value, .dsh-kpi .stat-hint, .dsh-kpi .dsh-delta { text-align: left; align-self: flex-start; }
.dsh-kpi .stat-top { flex-direction: row-reverse; justify-content: flex-end; gap: 12px; align-items: center; margin-bottom: 8px; }
.dsh-kpi .stat-label { font-size: 14px; font-weight: 600; color: var(--text); }
.dsh-kpi .stat-icon { width: 48px; height: 48px; border-radius: 50%; font-size: 22px; flex: none; }
.dsh-kpi .stat-value { font-size: 30px; font-weight: 700; margin-top: 4px; }
.dsh-kpi .stat-hint { font-size: 12.5px; }

/* soft tinted wave footers, cycling through green, blue, amber, violet */
.dsh-kpis > .dsh-kpi:nth-child(4n+1) { background-image: linear-gradient(180deg, #fff 40%, #eaf7ef 100%), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 56' preserveAspectRatio='none'><path d='M0 40 C60 10 110 52 170 30 S260 6 300 24 V56 H0Z' fill='%2335b36a' fill-opacity='.28'/></svg>"); }
.dsh-kpis > .dsh-kpi:nth-child(4n+2) { background-image: linear-gradient(180deg, #fff 40%, #eaf3fc 100%), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 56' preserveAspectRatio='none'><path d='M0 40 C60 10 110 52 170 30 S260 6 300 24 V56 H0Z' fill='%234a90d9' fill-opacity='.26'/></svg>"); }
.dsh-kpis > .dsh-kpi:nth-child(4n+3) { background-image: linear-gradient(180deg, #fff 40%, #fdf3e3 100%), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 56' preserveAspectRatio='none'><path d='M0 40 C60 10 110 52 170 30 S260 6 300 24 V56 H0Z' fill='%23f0a43c' fill-opacity='.28'/></svg>"); }
.dsh-kpis > .dsh-kpi:nth-child(4n+4) { background-image: linear-gradient(180deg, #fff 40%, #f1ecfb 100%), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 56' preserveAspectRatio='none'><path d='M0 40 C60 10 110 52 170 30 S260 6 300 24 V56 H0Z' fill='%238b66d9' fill-opacity='.26'/></svg>"); }
.dsh-kpis > .dsh-kpi:nth-child(4n+1) .stat-icon { background: #d7f0e0; color: #1a8a4a; }
.dsh-kpis > .dsh-kpi:nth-child(4n+2) .stat-icon { background: #d9e9f9; color: #2b6cb0; }
.dsh-kpis > .dsh-kpi:nth-child(4n+3) .stat-icon { background: #fbe6c4; color: #b7791f; }
.dsh-kpis > .dsh-kpi:nth-child(4n+4) .stat-icon { background: #e6dcf8; color: #6b46c1; }
.dsh-kpis > .dsh-kpi .stat-icon.bad { background: #fbdcd6; color: #b3382a; }

/* footer curve and go-arrow inside each KPI card */
.dsh-kpi .dsh-wave { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 56px; pointer-events: none; }
.dsh-kpis > .dsh-kpi:nth-child(4n+1) { background-image: linear-gradient(180deg, #fff 45%, #eef9f2 100%); color: #1a8a4a; }
.dsh-kpis > .dsh-kpi:nth-child(4n+2) { background-image: linear-gradient(180deg, #fff 45%, #edf5fd 100%); color: #2b8fc9; }
.dsh-kpis > .dsh-kpi:nth-child(4n+3) { background-image: linear-gradient(180deg, #fff 45%, #fff6e8 100%); color: #e08a1e; }
.dsh-kpis > .dsh-kpi:nth-child(4n+4) { background-image: linear-gradient(180deg, #fff 45%, #f4effd 100%); color: #7c4dd6; }
.dsh-kpi .stat-label, .dsh-kpi .stat-value { color: #14231b; }
.dsh-kpi .stat-hint, .dsh-kpi .dsh-delta { color: #4f6157; position: relative; z-index: 1; }
.dsh-kpi .dsh-go {
  position: absolute; top: 16px; right: 16px; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; border: 1.5px solid currentColor; background: rgba(255, 255, 255, 0.85); font-size: 14px; z-index: 1;
}
.dsh-kpi.dsh-click:hover .dsh-go { background: currentColor; }
.dsh-kpi.dsh-click:hover .dsh-go i, .dsh-kpi.dsh-click:hover .dsh-go svg { color: #fff; }
.dsh-kpi .stat-top { padding-right: 34px; }

/* =====================================================================
   Premium minimal card system: one look for every card in the app.
   White surface, hairline border, layered soft shadow, calm type,
   one tinted icon chip, subtle lift on interactive cards.
   ===================================================================== */
:root {
  --card-bg: #ffffff;
  --card-border: rgba(15, 40, 28, 0.07);
  --card-shadow: 0 1px 2px rgba(15, 40, 28, 0.04), 0 12px 28px -18px rgba(15, 40, 28, 0.18);
  --card-shadow-hover: 0 1px 2px rgba(15, 40, 28, 0.05), 0 22px 40px -20px rgba(15, 40, 28, 0.32);
  --card-radius: 18px;
}
:root[data-theme='dark'] {
  --card-bg: #141c17;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 30px -18px rgba(0, 0, 0, 0.7);
  --card-shadow-hover: 0 22px 40px -18px rgba(0, 0, 0, 0.8);
}

.panel, .stat, .d-card, .role-card, .login-card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.panel { padding: 20px 22px; }
.panel-head h2, .panel-head h3, .panel-head b { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.panel-head p { font-size: 12.5px; color: var(--text-muted); }
.d-card:hover, .role-card:hover, .dsh-click:hover, button.stat:hover {
  transform: translateY(-2px); box-shadow: var(--card-shadow-hover); border-color: rgba(27, 138, 75, 0.28);
}

/* KPI tiles, new dashboards and the older stat tiles alike */
.stats { gap: 16px; }
.stat { padding: 18px 20px; gap: 4px; position: relative; overflow: hidden; text-align: left; }
.stat-top { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 12px; margin-bottom: 10px; }
.stat-label { font-size: 13px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.005em; }
.stat-value { font-size: 28px; font-weight: 650; letter-spacing: -0.035em; color: var(--text); }
.stat-hint { font-size: 12.5px; color: var(--text-faint); line-height: 1.4; }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.stat-icon.warn { background: rgba(240, 164, 60, 0.16); color: #b7791f; }
.stat-icon.bad { background: rgba(179, 56, 42, 0.12); color: #b3382a; }

/* dashboard KPI cards: same minimal surface, tinted icon chip, quiet curve */
.dsh-kpis > .dsh-kpi.stat { background: var(--card-bg); background-image: none; border: 1px solid var(--card-border); padding: 18px 20px 58px; }
.dsh-kpis > .dsh-kpi:nth-child(4n+1) { color: #1a8a4a; }
.dsh-kpis > .dsh-kpi:nth-child(4n+2) { color: #2b8fc9; }
.dsh-kpis > .dsh-kpi:nth-child(4n+3) { color: #e08a1e; }
.dsh-kpis > .dsh-kpi:nth-child(4n+4) { color: #7c4dd6; }
.dsh-kpis > .dsh-kpi:nth-child(4n+1) .stat-icon { background: rgba(26, 138, 74, 0.12); color: #1a8a4a; }
.dsh-kpis > .dsh-kpi:nth-child(4n+2) .stat-icon { background: rgba(43, 143, 201, 0.12); color: #2b8fc9; }
.dsh-kpis > .dsh-kpi:nth-child(4n+3) .stat-icon { background: rgba(224, 138, 30, 0.14); color: #c97a14; }
.dsh-kpis > .dsh-kpi:nth-child(4n+4) .stat-icon { background: rgba(124, 77, 214, 0.12); color: #7c4dd6; }
.dsh-kpis > .dsh-kpi .stat-icon.bad { background: rgba(179, 56, 42, 0.12); color: #b3382a; }
.dsh-kpi .dsh-wave { opacity: 0.55; height: 48px; }
.dsh-kpi .dsh-go { width: 26px; height: 26px; border-width: 1px; font-size: 13px; opacity: 0.85; }
.dsh-kpi .stat-icon { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
.dsh-kpi .stat-value { font-size: 28px; font-weight: 650; }
.dsh-kpi .stat-label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.dsh-kpi .dsh-delta { font-size: 12px; }

/* ---- every metric tile gets the same premium finish ----------------
   Applies to the older stat tiles (.stats > .stat), Support tiles (.sup-stat)
   and report summary cards (.rpt-card): tinted icon chip colour cycle, calm
   type and the quiet footer curve (decorative, not data). */
:root {
  --wave-g: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 60' preserveAspectRatio='none'><defs><linearGradient id='g' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%231a8a4a' stop-opacity='.26'/><stop offset='1' stop-color='%231a8a4a' stop-opacity='0'/></linearGradient></defs><path d='M0 46 C40 40 70 50 110 42 S190 30 230 26 S280 8 300 10 V60 H0Z' fill='url(%23g)'/><path d='M0 46 C40 40 70 50 110 42 S190 30 230 26 S280 8 300 10' fill='none' stroke='%231a8a4a' stroke-width='2' stroke-linecap='round' vector-effect='non-scaling-stroke'/></svg>");
  --wave-b: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 60' preserveAspectRatio='none'><defs><linearGradient id='g' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%232b8fc9' stop-opacity='.26'/><stop offset='1' stop-color='%232b8fc9' stop-opacity='0'/></linearGradient></defs><path d='M0 46 C40 40 70 50 110 42 S190 30 230 26 S280 8 300 10 V60 H0Z' fill='url(%23g)'/><path d='M0 46 C40 40 70 50 110 42 S190 30 230 26 S280 8 300 10' fill='none' stroke='%232b8fc9' stroke-width='2' stroke-linecap='round' vector-effect='non-scaling-stroke'/></svg>");
  --wave-a: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 60' preserveAspectRatio='none'><defs><linearGradient id='g' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%23e08a1e' stop-opacity='.26'/><stop offset='1' stop-color='%23e08a1e' stop-opacity='0'/></linearGradient></defs><path d='M0 46 C40 40 70 50 110 42 S190 30 230 26 S280 8 300 10 V60 H0Z' fill='url(%23g)'/><path d='M0 46 C40 40 70 50 110 42 S190 30 230 26 S280 8 300 10' fill='none' stroke='%23e08a1e' stroke-width='2' stroke-linecap='round' vector-effect='non-scaling-stroke'/></svg>");
  --wave-v: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 60' preserveAspectRatio='none'><defs><linearGradient id='g' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%237c4dd6' stop-opacity='.26'/><stop offset='1' stop-color='%237c4dd6' stop-opacity='0'/></linearGradient></defs><path d='M0 46 C40 40 70 50 110 42 S190 30 230 26 S280 8 300 10 V60 H0Z' fill='url(%23g)'/><path d='M0 46 C40 40 70 50 110 42 S190 30 230 26 S280 8 300 10' fill='none' stroke='%237c4dd6' stroke-width='2' stroke-linecap='round' vector-effect='non-scaling-stroke'/></svg>");
}
.stats > .stat:not(.dsh-kpi), .sup-stat, .rpt-card {
  position: relative; overflow: hidden; background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--card-radius); box-shadow: var(--card-shadow); padding: 18px 20px 54px;
}
.stats > .stat:not(.dsh-kpi)::after, .sup-stat::after, .rpt-card::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 44px; pointer-events: none; opacity: 0.55;
  background: var(--wave-g) bottom / 100% 100% no-repeat;
}
.stats > .stat:not(.dsh-kpi):nth-child(4n+2)::after, .sup-stats > :nth-child(4n+2)::after, .rpt-summary > :nth-child(4n+2)::after { background-image: var(--wave-b); }
.stats > .stat:not(.dsh-kpi):nth-child(4n+3)::after, .sup-stats > :nth-child(4n+3)::after, .rpt-summary > :nth-child(4n+3)::after { background-image: var(--wave-a); }
.stats > .stat:not(.dsh-kpi):nth-child(4n+4)::after, .sup-stats > :nth-child(4n+4)::after, .rpt-summary > :nth-child(4n+4)::after { background-image: var(--wave-v); }
.stats > .stat:not(.dsh-kpi) > *, .sup-stat > *, .rpt-card > * { position: relative; z-index: 1; }
.stats > .stat:not(.dsh-kpi) .stat-icon:not(.warn):not(.bad) { background: var(--tone-soft); color: var(--tone); }
.sup-stat, .rpt-card { gap: 4px; }
.sup-stat b, .rpt-card b { font-size: 26px; font-weight: 650; letter-spacing: -0.03em; color: var(--text); line-height: 1.1; }
.sup-stat span, .rpt-card-label { font-size: 13px; color: var(--text-muted); }
.sup-stat.bad b { color: var(--danger); }
.sup-stat.warn b { color: var(--warning); }
button.sup-stat { cursor: pointer; }
button.sup-stat:hover, button.sup-stat[aria-pressed='true'] { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); border-color: rgba(27, 138, 75, 0.35); }

/* Leads board columns, table wrappers anywhere */
.board-col { background: color-mix(in srgb, var(--card-bg) 70%, #eef5f0); border: 1px solid var(--card-border); border-radius: var(--card-radius); box-shadow: var(--card-shadow); }
.table-wrap { box-shadow: var(--card-shadow); border-color: var(--card-border); }

/* boards: Dealer leads columns and lead cards */
.onb-column { background: color-mix(in srgb, var(--card-bg) 70%, #eef5f0); border: 1px solid var(--card-border); border-radius: var(--card-radius); box-shadow: var(--card-shadow); padding: 12px; }
.lead-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px; box-shadow: var(--card-shadow); transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease; }
.lead-card:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); border-color: rgba(27, 138, 75, 0.3); background: var(--card-bg); }

/* dealership cards and role cards: tidy interior rhythm */
.d-card { padding: 20px 22px; overflow: hidden; }
.d-card-head { gap: 12px; }
.d-card-foot, .role-card-foot { border-top: 1px solid var(--card-border); margin-top: 14px; padding-top: 12px; }
.role-card { padding: 18px 20px; }

/* login card gets the same shell, a little more air */
.login-card { border-radius: 22px; box-shadow: 0 30px 60px -30px rgba(11, 61, 34, 0.45); }

:root[data-theme='dark'] .dsh-kpis > .dsh-kpi.stat { background: var(--card-bg); }
:root[data-theme='dark'] .dsh-kpis > .dsh-kpi:nth-child(n) .stat-icon { background: rgba(255, 255, 255, 0.08); }

/* ---- dark mode keeps the green identity --------------------------- */
:root[data-theme='dark'] { --bg: #0b130e; }
:root[data-theme='dark'] .search, :root[data-theme='dark'] .scope select, :root[data-theme='dark'] .dsh-field select { background: #141c17; border-color: rgba(255, 255, 255, 0.1); }
:root[data-theme='dark'] .dsh-kpi.stat { background-color: #141c17; background-image: none; }
:root[data-theme='dark'] .dsh-kpi .stat-label { color: var(--text); }

/* =====================================================================
   Card styles per page. theme-igo.js sets body[data-variant]:
   aurora (dashboards, the rules above) and seven others below.
   --tone / --tone-soft cycle green, blue, amber, violet across tiles.
   ===================================================================== */
.stats > .stat:nth-child(4n+1), .sup-stats > :nth-child(4n+1), .rpt-summary > :nth-child(4n+1) { --tone: #1a8a4a; --tone-soft: rgba(26, 138, 74, 0.12); --tone-wash: #eaf6ee; }
.stats > .stat:nth-child(4n+2), .sup-stats > :nth-child(4n+2), .rpt-summary > :nth-child(4n+2) { --tone: #2b8fc9; --tone-soft: rgba(43, 143, 201, 0.12); --tone-wash: #e8f2fb; }
.stats > .stat:nth-child(4n+3), .sup-stats > :nth-child(4n+3), .rpt-summary > :nth-child(4n+3) { --tone: #d9801a; --tone-soft: rgba(224, 138, 30, 0.14); --tone-wash: #fdf1df; }
.stats > .stat:nth-child(4n+4), .sup-stats > :nth-child(4n+4), .rpt-summary > :nth-child(4n+4) { --tone: #7c4dd6; --tone-soft: rgba(124, 77, 214, 0.12); --tone-wash: #f1ebfc; }

/* 1. LEDGER: flat, crisp, thick coloured edge on the left, icon ringed on the right */
body[data-variant='ledger'] { --card-radius: 12px; --card-shadow: none; --card-shadow-hover: 0 10px 24px -16px rgba(15, 40, 28, 0.35); --card-border: rgba(15, 40, 28, 0.12); }
body[data-variant='ledger'] .stats > .stat:not(.dsh-kpi), body[data-variant='ledger'] .sup-stat, body[data-variant='ledger'] .rpt-card {
  border-radius: 12px; box-shadow: none; border-left: 4px solid var(--tone); padding: 16px 18px;
}
body[data-variant='ledger'] .stats > .stat::after, body[data-variant='ledger'] .sup-stat::after, body[data-variant='ledger'] .rpt-card::after { content: none; }
body[data-variant='ledger'] .stat-top { flex-direction: row; justify-content: space-between; padding-right: 0; }
body[data-variant='ledger'] .stats > .stat .stat-icon:not(.warn):not(.bad) { background: transparent; border: 1.5px solid var(--tone); color: var(--tone); width: 34px; height: 34px; border-radius: 50%; font-size: 17px; }
body[data-variant='ledger'] .stat-value, body[data-variant='ledger'] .sup-stat b, body[data-variant='ledger'] .rpt-card b { font-size: 30px; }

/* 2. OUTLINE: clean top rule in the tile colour, dashed divider above the note */
body[data-variant='outline'] { --card-radius: 16px; --card-shadow: 0 1px 0 rgba(15, 40, 28, 0.05); --card-border: rgba(15, 40, 28, 0.1); }
body[data-variant='outline'] .stats > .stat:not(.dsh-kpi), body[data-variant='outline'] .sup-stat, body[data-variant='outline'] .rpt-card {
  border-radius: 16px; border-top: 3px solid var(--tone); box-shadow: 0 1px 0 rgba(15, 40, 28, 0.05); padding: 16px 18px 14px;
}
body[data-variant='outline'] .stats > .stat::after, body[data-variant='outline'] .sup-stat::after, body[data-variant='outline'] .rpt-card::after { content: none; }
body[data-variant='outline'] .stats > .stat .stat-icon:not(.warn):not(.bad) { background: none; color: var(--tone); width: 26px; height: 26px; font-size: 20px; }
body[data-variant='outline'] .stat-top { margin-bottom: 4px; gap: 8px; }
body[data-variant='outline'] .stat-hint { border-top: 1px dashed var(--card-border); margin-top: 10px; padding-top: 8px; }
body[data-variant='outline'] .sup-stat span, body[data-variant='outline'] .rpt-card-label { border-top: 1px dashed var(--card-border); margin-top: 8px; padding-top: 8px; }

/* 3. TINT: pastel filled tile, no border or shadow, soft white icon chip */
body[data-variant='tint'] { --card-radius: 24px; --card-shadow: 0 10px 24px -20px rgba(15, 40, 28, 0.25); --card-border: rgba(15, 40, 28, 0.04); }
body[data-variant='tint'] .stats > .stat:not(.dsh-kpi), body[data-variant='tint'] .sup-stat, body[data-variant='tint'] .rpt-card {
  background: var(--tone-wash); border: none; box-shadow: none; border-radius: 24px; padding: 20px 22px;
}
body[data-variant='tint'] .stats > .stat::after, body[data-variant='tint'] .sup-stat::after, body[data-variant='tint'] .rpt-card::after { content: none; }
body[data-variant='tint'] .stats > .stat .stat-icon:not(.warn):not(.bad) { background: #fff; color: var(--tone); box-shadow: 0 6px 14px -8px rgba(15, 40, 28, 0.3); border-radius: 14px; }
body[data-variant='tint'] .stat-label, body[data-variant='tint'] .sup-stat span, body[data-variant='tint'] .rpt-card-label { color: color-mix(in srgb, var(--tone) 55%, #14231b); font-weight: 600; }

/* 4. EMBER: deep green gradient tile, white type, soft glow in the corner */
body[data-variant='ember'] { --card-radius: 18px; --card-shadow: 0 1px 2px rgba(15, 40, 28, 0.04), 0 14px 28px -20px rgba(15, 40, 28, 0.3); }
body[data-variant='ember'] .stats > .stat:not(.dsh-kpi), body[data-variant='ember'] .sup-stat, body[data-variant='ember'] .rpt-card {
  background: linear-gradient(145deg, #14693a 0%, #0c3f23 100%); border: none; color: #fff; border-radius: 18px; padding: 18px 20px;
  box-shadow: 0 20px 34px -22px rgba(11, 61, 34, 0.8);
}
body[data-variant='ember'] .stats > .stat:not(.dsh-kpi)::after, body[data-variant='ember'] .sup-stat::after, body[data-variant='ember'] .rpt-card::after {
  content: ''; left: auto; right: -34px; top: -40px; bottom: auto; width: 150px; height: 150px; border-radius: 50%; opacity: 1;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 70%); background-size: auto; background-position: center;
}
body[data-variant='ember'] .stat-label, body[data-variant='ember'] .sup-stat span, body[data-variant='ember'] .rpt-card-label { color: rgba(255, 255, 255, 0.82); }
body[data-variant='ember'] .stat-value, body[data-variant='ember'] .sup-stat b, body[data-variant='ember'] .rpt-card b { color: #fff; }
body[data-variant='ember'] .stat-hint { color: rgba(255, 255, 255, 0.66); }
body[data-variant='ember'] .stats > .stat .stat-icon { background: rgba(255, 255, 255, 0.15); color: #fff; }
body[data-variant='ember'] .sup-stat.bad b, body[data-variant='ember'] .sup-stat.warn b { color: #ffd9a6; }

/* 5. WATERMARK: white tile, big soft circle in the corner in the tile colour */
body[data-variant='watermark'] { --card-radius: 20px; }
body[data-variant='watermark'] .stats > .stat:not(.dsh-kpi), body[data-variant='watermark'] .sup-stat, body[data-variant='watermark'] .rpt-card { border-radius: 20px; padding: 20px 22px; }
body[data-variant='watermark'] .stats > .stat:not(.dsh-kpi)::after, body[data-variant='watermark'] .sup-stat::after, body[data-variant='watermark'] .rpt-card::after {
  content: ''; left: auto; right: -30px; bottom: -40px; top: auto; width: 130px; height: 130px; border-radius: 50%; opacity: 1;
  background-image: none; background-color: var(--tone-soft);
}
body[data-variant='watermark'] .stats > .stat .stat-icon:not(.warn):not(.bad) { background: var(--tone); color: #fff; border-radius: 50%; }

/* 6. RAIL: compact tile with a coloured rail along the bottom edge */
body[data-variant='rail'] { --card-radius: 14px; --card-shadow: 0 1px 2px rgba(15, 40, 28, 0.06), 0 8px 18px -14px rgba(15, 40, 28, 0.2); }
body[data-variant='rail'] .stats > .stat:not(.dsh-kpi), body[data-variant='rail'] .sup-stat, body[data-variant='rail'] .rpt-card {
  border-radius: 14px; padding: 14px 16px 16px; border-bottom: 4px solid var(--tone);
}
body[data-variant='rail'] .stats > .stat::after, body[data-variant='rail'] .sup-stat::after, body[data-variant='rail'] .rpt-card::after { content: none; }
body[data-variant='rail'] .stats > .stat .stat-icon:not(.warn):not(.bad) { background: var(--tone-soft); color: var(--tone); width: 32px; height: 32px; border-radius: 10px; font-size: 17px; }
body[data-variant='rail'] .stat-value, body[data-variant='rail'] .sup-stat b, body[data-variant='rail'] .rpt-card b { font-size: 24px; }

/* 7. RING: centred tile, icon in a haloed ring */
body[data-variant='ring'] { --card-radius: 26px; --card-shadow: 0 16px 30px -22px rgba(15, 40, 28, 0.3); }
body[data-variant='ring'] .stats > .stat:not(.dsh-kpi), body[data-variant='ring'] .sup-stat, body[data-variant='ring'] .rpt-card { border-radius: 26px; padding: 22px 20px; text-align: center; justify-items: center; align-items: center; }
body[data-variant='ring'] .stats > .stat::after, body[data-variant='ring'] .sup-stat::after, body[data-variant='ring'] .rpt-card::after { content: none; }
body[data-variant='ring'] .stat-top { flex-direction: column; align-items: center; gap: 12px; padding-right: 0; }
body[data-variant='ring'] .stats > .stat .stat-icon:not(.warn):not(.bad) { width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--tone); border: 2px solid var(--tone); box-shadow: 0 0 0 6px var(--tone-soft); font-size: 22px; }
body[data-variant='ring'] .stat-value, body[data-variant='ring'] .stat-hint { text-align: center; align-self: center; }
body[data-variant='ring'] .stat { align-items: center; }
body[data-variant='ring'] .sup-stat::before, body[data-variant='ring'] .rpt-card::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 5px var(--tone-soft); margin-bottom: 8px; }

/* panels, dealership cards, role cards and lead cards follow each page's radius and shadow through the variables above */

/* ---- small screens ------------------------------------------------ */
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { margin: 0; height: 100dvh; top: 0; border-radius: 0; z-index: 90; }
  .scrim { z-index: 80; }
  .igo-hero { padding: 20px; }
  .igo-hero h1 { font-size: 24px; }
  .topbar { padding: 12px 16px 4px; }
}

/* ===================================================================
   Sign-in screen: brand art on the left, card on the right
   =================================================================== */
.login { position: relative; display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr auto; min-height: 100dvh; padding: 0; place-items: stretch; background: #eef8f1; color: #0f3b24; }
/* One picture runs behind both halves, so the curve flows straight into the card. The card sits exactly over the card drawn in the artwork. */
.login-art { grid-column: 1; grid-row: 1; min-height: 560px; background: #b2e1f8 url('/assets/login-art.png') 0 0 / 100% 100% no-repeat; }
.login-stage { display: none; }
.login-side { grid-column: 1; grid-row: 1; position: relative; z-index: 1; pointer-events: none; }
.login-card { pointer-events: auto; position: absolute; left: 57.9%; top: 12.6%; width: 39.9%; max-width: none; min-height: 80.9%; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; padding: 24px clamp(18px, 3.2vw, 56px); gap: 16px; background: #fff; border: 1px solid rgba(15, 59, 36, 0.08); border-radius: 22px; box-shadow: 0 30px 60px -28px rgba(11, 61, 34, 0.4), 0 2px 6px rgba(11, 61, 34, 0.06); }.login-secure { position: absolute; top: 14px; right: 16px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: #e7f5ec; border: 1px solid #cfe7d8; color: #14703a; font-size: 12px; font-weight: 600; }
.login-brand { margin: 18px 0 4px; gap: 16px; }
.login-card .login-logo { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 8px 20px -10px rgba(11, 61, 34, 0.4); }
.login-brand b { font-size: 22px; font-weight: 700; color: #0f3b24; }
.login-brand small { display: block; margin-top: 4px; font-size: 15px; color: #5c7366; }
.login-card .field { gap: 8px; }
.login-card .field-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #0f3b24; }
.login-card .field-label i { font-size: 18px; color: #17803f; }
.login-card .field input { height: 46px; padding: 0 14px; background: #fff; border: 1px solid #c9d7ce; border-radius: 12px; font-size: 14.5px; color: #0f3b24; box-shadow: inset 0 1px 2px rgba(11, 61, 34, 0.04); }
.login-card .field input::placeholder { color: #8aa194; }
.login-card .field input:focus { outline: none; border-color: #1f8f45; box-shadow: 0 0 0 3px rgba(31, 143, 69, 0.18); }
.login-card .pw-wrap input { padding-right: 46px; }
.login-card .pw-toggle { color: #5c7366; }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.login-remember { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: #274d38; cursor: pointer; }
.login-remember input { width: 17px; height: 17px; margin: 0; accent-color: #17803f; }
.login-forgot { padding: 0; border: 0; background: none; color: #17803f; font-size: 13px; font-weight: 600; cursor: pointer; }
.login-forgot:hover { text-decoration: underline; }
.login-card .login-btn { gap: 10px; height: 50px; border: 0; border-radius: 12px; font-size: 16px; font-weight: 700; color: #fff; background: linear-gradient(90deg, #0f5a2e 0%, #1f8f45 100%); box-shadow: 0 14px 24px -14px rgba(15, 90, 46, 0.75); }
.login-card .login-btn:hover:not(:disabled) { filter: brightness(1.07); }
.login-card .login-btn i { font-size: 19px; }
.login-or { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #6a8174; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: #d6e3db; }
.login-notice { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 14px; border-radius: 12px; background: #eef7f1; border: 1px solid #cfe3d6; color: #2c5a3f; font-size: 13px; }
.login-notice i { font-size: 17px; color: #17803f; }

.login-foot { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 0 28px; background: linear-gradient(90deg, #0a4a24 0%, #0f5a2e 55%, #0a4a24 100%); color: #e8f6ee; font-size: 13px; }
.login-foot b { font-weight: 600; }
.login-foot em { display: inline-block; width: 1px; height: 14px; margin: 0 12px; background: rgba(255, 255, 255, 0.4); vertical-align: middle; }
.login-foot-tag { font-style: italic; }
.login-foot-tag b { color: #7be0a0; }
.login-foot-tag i { margin-left: 4px; color: #7be0a0; font-size: 16px; vertical-align: -2px; }

@media (max-width: 960px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-side { display: grid; place-items: center; padding: 32px 16px; pointer-events: auto; background: linear-gradient(180deg, #bfe8fb 0%, #e6f5ec 38%, #d6ede0 100%); }
  .login-card { position: relative; left: auto; top: auto; width: 100%; max-width: 430px; min-height: 0; padding: 26px 30px 28px; display: grid; }
  .login-foot { flex-direction: column; justify-content: center; gap: 2px; padding: 8px 16px; text-align: center; }
}
@media (max-width: 440px) { .login-card { padding: 22px 18px 22px; } .login-brand b { font-size: 19px; } .login-row { flex-wrap: wrap; } }
