/* NeutroSFE — Lightning-style design system (sidebar navigation, white header, grey canvas, pill buttons).
   Tokens first; components keep the class names used across the Blade views. */
:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-card: 0;
  --radius: 0;
  --heat-1: #dcf3e0;
  --heat-2: #b4e4bd;
  --heat-3: #7fcc8f;
  --heat-4: #43a85c;
  --heat-5: #1f7a3b;
  --heat-ink: #0e3b1c;
  --radius-sm: 0;
  --sidebar-w: 188px;
  --header-h: 52px;
  --navbar-h: 42px;
  --utility-h: 40px;

  --canvas: #f3f3f3;
  --surface: #ffffff;
  --surface-2: #f3f3f3;
  --surface-3: #fafaf9;
  --border: #e5e5e5;
  --border-strong: #c9c9c9;
  --input-border: #939393;
  --text: #03234d;
  --text-2: #5c5c5c;
  --text-3: #747474;
  --brand: #066afe;
  --brand-hover: #0250d9;
  --brand-text: #0250d9;
  --brand-soft: #eef4ff;
  --brand-soft-2: #d8e6fe;
  --link: #0b5cab;
  --danger: #ba0517;
  --danger-soft: #feded8;
  --warning: #a96404;
  --warning-soft: #fef1cd;
  --success: #2e844a;
  --success-soft: #cdefc4;
  --info-soft: #eef4ff;
  --focus: 0 0 0 2px #fff, 0 0 0 4px #066afe;
  --shadow: 0 2px 2px rgba(0, 0, 0, .08);
  --shadow-card: 0 0 2px rgba(0, 0, 0, .1), 0 2px 4px rgba(0, 0, 0, .06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, .18);

  --side-bg: #0f2a2e;
  --side-text: #c6d4d6;
  --side-text-2: #7f9a9e;
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(45, 212, 167, .14);
  --side-active-text: #5eead4;

  /* aliases used by older markup */
  --primary: var(--brand);
  --primary-hover: var(--brand-hover);
  --primary-soft: var(--brand-soft);
  --accent: var(--brand-text);
  --bg: var(--canvas);
}

:root[data-theme="dark"] {
  --heat-1: #1d3a27;
  --heat-2: #24533a;
  --heat-3: #2c7046;
  --heat-4: #3a9459;
  --heat-5: #5bc77a;
  --heat-ink: #e6f6ea;
  --canvas: #0f1218;
  --surface: #181c24;
  --surface-2: #1f242e;
  --surface-3: #1b2029;
  --border: #2a313d;
  --border-strong: #3a4352;
  --input-border: #566173;
  --text: #e6ecf5;
  --text-2: #aab4c3;
  --text-3: #8591a3;
  --brand: #3b8bff;
  --brand-hover: #5d9fff;
  --brand-text: #78acff;
  --brand-soft: rgba(59, 139, 255, .14);
  --brand-soft-2: rgba(59, 139, 255, .24);
  --link: #78acff;
  --danger: #ff6b5f;
  --danger-soft: rgba(255, 107, 95, .16);
  --warning: #f4b13e;
  --warning-soft: rgba(244, 177, 62, .16);
  --success: #5bc77a;
  --success-soft: rgba(91, 199, 122, .16);
  --info-soft: rgba(59, 139, 255, .14);
  --focus: 0 0 0 2px #181c24, 0 0 0 4px #3b8bff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-card: 0 0 0 1px #262c37, 0 2px 4px rgba(0, 0, 0, .4);
  --shadow-lg: 0 6px 20px rgba(0, 0, 0, .6);
  --side-bg: #0a1519;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 13px; line-height: 1.5; color: var(--text); background: var(--canvas); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 400; color: var(--text); }
[x-cloak] { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ================= Shell ================= */
.lx-shell { display: flex; min-height: 100vh; }

/* Sidebar (collapsible module groups) */
.sidebar { width: var(--sidebar-w); background: var(--side-bg); color: var(--side-text); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 60; transition: transform .2s; }
.sidebar-brand { height: var(--header-h); display: flex; align-items: center; gap: 8px; padding: 0 12px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .2px; border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }
.side-brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #2dd4a7, #0e7c66); display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800; }
.sidebar-search { padding: 10px 8px 6px; }
.sidebar-search input { width: 100%; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-sm); padding: 7px 10px; color: #fff; font: inherit; font-size: 13px; }
.sidebar-search input::placeholder { color: var(--side-text-2); }
.sidebar-search input:focus { outline: none; border-color: rgba(94, 234, 212, .5); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 6px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-section { margin-top: 2px; }
.nav-head, .nav-link { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border-radius: var(--radius-sm); color: var(--side-text); font-size: 13px; line-height: 1.3; background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; text-decoration: none; }
.nav-head:hover, .nav-link:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.nav-head .chev { margin-left: auto; transition: transform .15s; width: 15px; height: 15px; opacity: .6; }
.nav-head.open .chev { transform: rotate(90deg); }
.nav-sub { padding-left: 6px; border-left: 1px solid rgba(255,255,255,.08); margin-left: 16px; }
.nav-sub .nav-head, .nav-sub .nav-link { font-size: 12.5px; padding: 6px 8px; }
.nav-link.active { background: var(--side-active); color: var(--side-active-text); font-weight: 500; }
.nav-link.planned { color: var(--side-text-2); }
.nav-link .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--side-text-2); margin-left: auto; opacity: .7; }
.sidebar-foot { padding: 10px 16px; font-size: 11.5px; color: var(--side-text-2); border-top: 1px solid rgba(255,255,255,.06); margin-bottom: var(--utility-h); }
.lx-rail-scrim { display: none; }
.lx-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; padding-bottom: var(--utility-h); }

/* Global header */
.lx-header { position: sticky; top: 0; z-index: 40; height: var(--header-h); background: var(--surface); display: flex; align-items: center; gap: 14px; padding: 0 18px; }
.lx-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.lx-icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--text-2); display: grid; place-items: center; cursor: pointer; position: relative; }
.lx-icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.lx-icon-btn svg.lucide { width: 21px; height: 21px; }
.lx-badge-dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
.lx-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); background: #d8e6fe; color: #0250d9; font-weight: 700; font-size: 13px; display: grid; place-items: center; cursor: pointer; padding: 0; font-family: inherit; }
.lx-avatar-lg { width: 44px; height: 44px; font-size: 15px; cursor: default; }
.lx-user-menu { min-width: 260px; }
.lx-user-card { display: flex; gap: 12px; align-items: center; padding: 8px 10px; }
.lx-user-card small { display: block; color: var(--text-3); font-size: 12px; }
.lx-menu-toggle { display: none; }

.crumbs { color: var(--text-3); font-size: 13px; display: flex; gap: 6px; align-items: center; overflow: hidden; white-space: nowrap; min-width: 0; }
.crumbs b { color: var(--text); font-weight: 600; font-size: 14px; }
.crumbs svg.lucide { width: 14px; height: 14px; }
.lx-header-spacer { flex: 1; }
.lx-header { border-bottom: 1px solid var(--border); box-shadow: 0 2px 4px rgba(0, 0, 0, .05); }

.lx-canvas { flex: 1; padding: 16px 18px 32px; }

/* Utility bar */
.lx-utility { position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; height: var(--utility-h); background: var(--surface); border-top: 1px solid var(--border-strong); display: flex; align-items: center; gap: 4px; padding: 0 12px; z-index: 45; box-shadow: 0 -1px 3px rgba(0, 0, 0, .05); }
.lx-utility-item { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; border-radius: 0; text-decoration: none !important; }
.lx-utility-item:hover { background: var(--surface-2); }
.lx-utility-item svg.lucide { width: 16px; height: 16px; color: var(--text-2); }
.lx-utility-spacer { flex: 1; }
.lx-utility-meta { color: var(--text-3); font-size: 12px; }
.lx-utility-pop { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; min-width: 240px; }

/* ================= Dropdowns ================= */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 4px; z-index: 80; }
.dropdown-menu a, .dropdown-menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border-radius: 0; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; text-decoration: none; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ================= Page header (object home) ================= */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 14px; flex-wrap: wrap; }
.page-head > div:first-of-type, .page-head > .obj-icon + div { flex: 1; min-width: 220px; }
.page-head .obj-icon + div { margin-left: -4px; }
.page-head h1 { font-size: 24px; font-weight: 400; letter-spacing: -.2px; line-height: 1.2; }
.page-head p { margin: 4px 0 0; color: var(--text-2); font-size: 12.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.obj-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.obj-icon svg.lucide { width: 22px; height: 22px; color: #fff; stroke-width: 2; }

/* ================= Cards ================= */
.card { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: visible; }
.card-head { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 16px 18px; }
.card > .card-body:last-child, .card > .table-wrap:last-child { border-radius: 0 0 var(--radius-card) var(--radius-card); }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; }

.stat { padding: 16px 18px; }
.stat-label { color: var(--text-2); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-label svg.lucide { width: 16px; height: 16px; }
.stat-value { font-size: 28px; font-weight: 300; margin-top: 6px; letter-spacing: -.5px; }
.stat-foot { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Welcome hero (home) */
.lx-hero { background: var(--brand-soft); border-radius: var(--radius-card); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); padding: 26px; display: grid; grid-template-columns: minmax(220px, 1fr) 2.4fr; gap: 18px; align-items: center; margin-bottom: 14px; }
.lx-hero h1 { font-size: 30px; font-weight: 300; }
.lx-hero p { margin: 6px 0 0; color: var(--text); font-size: 14px; }
.lx-hero-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.lx-hero-card { background: var(--surface); border-radius: 0; padding: 18px; min-height: 150px; display: flex; flex-direction: column; }
.lx-hero-card .lx-hero-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; margin-bottom: 14px; }
.lx-hero-card .lx-hero-icon svg.lucide { width: 18px; height: 18px; }
.lx-hero-card .v { font-size: 28px; font-weight: 300; color: var(--text); line-height: 1.1; }
.lx-hero-card .l { color: var(--brand-text); font-size: 15px; margin-top: 4px; }
.lx-hero-card .d { color: var(--text-2); font-size: 12.5px; margin-top: 4px; }

/* ================= Buttons (pill) ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 16px; border-radius: 9999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--brand-text); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--surface-2); }
.btn svg.lucide { width: 15px; height: 15px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: none; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 9999px 0 0 9999px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 9999px 9999px 0; }

/* ================= Forms ================= */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 3px; }
.field .req { color: var(--danger); }
.field label .req { float: left; margin-right: 3px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.input, .select, textarea.input { width: 100%; height: 32px; padding: 0 12px; border: 1px solid var(--input-border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
textarea.input { height: auto; min-height: 64px; padding: 6px 12px; resize: vertical; }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.input.is-invalid, .select.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.error { color: var(--danger); font-size: 12px; margin-top: 3px; }
.error:empty { display: none; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ================= Badges / alerts ================= */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 15px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text); border: 1px solid transparent; line-height: 18px; white-space: nowrap; }
.badge-success { background: var(--success-soft); color: #194e31; }
.badge-danger { background: var(--danger-soft); color: #8e030f; }
.badge-warning { background: var(--warning-soft); color: #6f3400; }
.badge-info { background: var(--brand-soft-2); color: #022ac0; }
.badge-primary { background: var(--brand-soft-2); color: #022ac0; }
:root[data-theme="dark"] .badge-success { color: var(--success); }
:root[data-theme="dark"] .badge-danger { color: var(--danger); }
:root[data-theme="dark"] .badge-warning { color: var(--warning); }
:root[data-theme="dark"] .badge-info, :root[data-theme="dark"] .badge-primary { color: var(--brand-text); }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; border: 1px solid transparent; }
.alert svg.lucide { width: 18px; height: 18px; }
.alert-success { background: var(--success-soft); color: #194e31; }
.alert-danger { background: var(--danger-soft); color: #8e030f; }
.alert-warning { background: var(--warning-soft); color: #6f3400; }
.alert-info { background: var(--brand-soft); color: var(--text); border-color: var(--brand-soft-2); }
:root[data-theme="dark"] .alert-success { color: var(--success); }
:root[data-theme="dark"] .alert-danger { color: var(--danger); }
:root[data-theme="dark"] .alert-warning { color: var(--warning); }

/* ================= Tables (Lightning data table) ================= */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--text); font-size: 12.5px; padding: 8px 12px; border-bottom: 1px solid var(--border-strong); background: var(--surface-3); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.table th + th { box-shadow: inset 1px 0 0 var(--border); }
.table td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: var(--brand-soft); }
.table-wrap { overflow: auto; }
.table .center { text-align: center; }

/* Grid toolbar + AG Grid */
.grid-toolbar { display: flex; gap: 8px; align-items: center; padding: 12px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.grid-toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.grid-toolbar .search svg { position: absolute; left: 10px; top: 8px; width: 16px; height: 16px; color: var(--text-2); }
.grid-toolbar .search input { padding-left: 32px; border-radius: 0; border-color: var(--border-strong); }
.grid-toolbar .count { color: var(--text-2); font-size: 12px; margin-left: auto; }
.grid-toolbar .btn-ghost { width: 32px; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%; }
.ns-grid { height: 300px; width: 100%; } /* sized to one page by ns.grid */
.ns-grid .ag-floating-bottom .ag-row { font-weight: 700; background: var(--surface-2); }
.card > .ns-grid { border-radius: 0 0 var(--radius-card) var(--radius-card); overflow: hidden; }
/* "html" outranks the AG Grid theme file, which loads after this one and sets the same variables */
html .ag-theme-quartz, html .ag-theme-quartz-dark {
  --ag-font-family: var(--font); --ag-font-size: 11.5px; --ag-border-color: var(--border); --ag-row-border-color: var(--border);
  --ag-header-background-color: var(--surface-3); --ag-background-color: var(--surface);
  --ag-odd-row-background-color: var(--surface); --ag-row-hover-color: var(--brand-soft);
  --ag-selected-row-background-color: var(--brand-soft-2); --ag-active-color: var(--brand);
  --ag-wrapper-border-radius: 0; --ag-header-foreground-color: var(--text); --ag-foreground-color: var(--text);
  --ag-header-column-separator-display: block; --ag-header-column-separator-color: var(--border-strong); --ag-header-column-separator-height: 50%;
  --ag-row-height: 34px; --ag-header-height: 36px; --ag-input-focus-border-color: var(--brand); --ag-borders: none; --ag-cell-horizontal-padding: 12px;
}
.ag-theme-quartz .ag-header, .ag-theme-quartz-dark .ag-header { border-bottom: 1px solid var(--border-strong); }
.ag-theme-quartz .ag-header-cell-text, .ag-theme-quartz-dark .ag-header-cell-text { font-weight: 600; }
.ag-theme-quartz .ag-root-wrapper, .ag-theme-quartz-dark .ag-root-wrapper { border: 0; }
/* vertical line between columns in the rows, like the header dividers */
.ag-theme-quartz .ag-row .ag-cell, .ag-theme-quartz-dark .ag-row .ag-cell { border-right: 1px solid var(--border) !important; }
.ag-cell .badge { font-size: inherit; line-height: 1.6; padding: 0 5px; vertical-align: middle; }
/* header (MREP style): title + small funnel in the header row; search-style inputs and (All) pickers below */
html .ag-theme-quartz, html .ag-theme-quartz-dark { --ag-header-column-separator-height: 100%; --ag-header-column-separator-color: var(--border); --ag-header-cell-horizontal-padding: 8px; }
.ag-theme-quartz .ag-header-cell-text, .ag-theme-quartz-dark .ag-header-cell-text { font-size: 11px; font-weight: 400; color: var(--text-2); }
.ag-header-row-column-filter { background: var(--surface); }
.ag-header-row-column-filter .ag-header-cell, .ag-floating-filter { padding-left: 4px !important; padding-right: 4px !important; }
.ag-header-cell-filter-button { margin-left: auto; padding-left: 4px; }
.ag-header-cell-filter-button .ns-funnel, .ns-funnel { width: 11px; height: 11px; color: #a8a8a8; display: block; }
.ag-header-cell-filter-button:hover .ns-funnel { color: var(--text-2); }
.ag-header-cell-filtered .ns-funnel, .ag-filter-active .ns-funnel { color: var(--brand); }
.ag-header-cell-label .ag-filter-icon { display: none; } /* the header funnel turns blue instead */
.ag-floating-filter-body { flex: 1; min-width: 0; }
.ag-floating-filter .ag-input-field-input, .ag-floating-filter input {
  height: 24px !important; border: 1px solid transparent !important; border-radius: 0 !important; box-shadow: none !important; font-size: 11px !important;
  padding: 0 4px 0 20px !important; background: transparent url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27%3E%3Ccircle cx=%277%27 cy=%277%27 r=%274.5%27 fill=%27none%27 stroke=%27%23888%27 stroke-width=%271.6%27/%3E%3Cpath d=%27M10.5 10.5 14 14%27 stroke=%27%23888%27 stroke-width=%271.6%27 stroke-linecap=%27round%27/%3E%3C/svg%3E") no-repeat 4px center / 12px 12px !important; }
.ag-floating-filter .ag-input-field-input:hover, .ag-floating-filter input:hover { border-color: var(--border) !important; }
.ag-floating-filter .ag-input-field-input:focus, .ag-floating-filter input:focus { border-color: var(--brand) !important; background-color: var(--surface) !important; }
.ag-theme-quartz .ag-popup input, .ag-theme-quartz-dark .ag-popup input, .ag-popup .ag-picker-field-wrapper { border-radius: 0 !important; }

/* pager under the grid */
.ag-theme-quartz .ag-paging-panel, .ag-theme-quartz-dark .ag-paging-panel { height: 52px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-2); gap: 4px; }
.ag-paging-panel .ag-picker-field-wrapper { border-radius: 0 !important; min-height: 26px; }
.ag-paging-button { border-radius: 0; }
.ag-paging-button:not(.ag-disabled):hover { color: var(--brand); }

/* pick-values filter (e.g. Teams) */
.pick-floating { position: relative; width: 100%; height: 24px; border: 1px solid transparent; border-radius: 0; background: transparent; color: var(--text); font: inherit; font-size: 11px; text-align: left; padding: 0 18px 0 4px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pick-floating::after { content: ""; position: absolute; right: 6px; top: 50%; margin-top: -2px; border: 4px solid transparent; border-top-color: var(--text); border-bottom: 0; }
.pick-floating:hover { border-color: var(--border); }
.pick-floating.active { color: var(--brand-text); background: var(--brand-soft); border-color: var(--brand); font-weight: 600; }
.pick-filter { width: 230px; font-size: 12.5px; }
.pick-search { padding: 8px; border-bottom: 1px solid var(--border); }
.pick-search input { width: 100%; height: 28px; border: 1px solid var(--border-strong); border-radius: 0; padding: 0 8px; font: inherit; background: var(--surface); color: var(--text); }
.pick-search input:focus { outline: none; border-color: var(--brand); }
.pick-list { max-height: 240px; overflow-y: auto; padding: 4px 0; }
.pick-item { display: flex; align-items: center; gap: 8px; padding: 5px 10px; cursor: pointer; }
.pick-item:hover { background: var(--surface-2); }
.pick-item input { margin: 0; accent-color: var(--brand); }
.pick-empty { padding: 10px; color: var(--text-3); text-align: center; }
.pick-foot { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-top: 1px solid var(--border); }
.pick-foot button { border: 0; background: none; color: var(--link); font: inherit; cursor: pointer; padding: 0; }
.pick-count { color: var(--text-2); }
.ag-cell a { color: var(--link); }
.cell-actions { display: flex; gap: 2px; align-items: center; height: 100%; }
.cell-actions button, .cell-actions a { border: 1px solid transparent; background: none; color: var(--text-2); cursor: pointer; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.cell-actions button:hover, .cell-actions a:hover { border-color: var(--border-strong); background: var(--surface); color: var(--brand-text); }
.cell-actions svg.lucide { width: 15px; height: 15px; }

/* ================= Modal ================= */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 7, 7, .55); z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; display: flex; flex-direction: column; max-height: 88vh; }
.modal-body { overflow-y: auto; }
.modal-lg { max-width: 860px; }
.modal-xl { max-width: 1080px; height: 88vh; }

/* Sectioned forms: profile header, step navigation, section content */
.form-profile { display: flex; align-items: center; gap: 14px; padding: 14px 24px; background: var(--brand-soft); border-bottom: 1px solid var(--border); }
.form-profile > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.form-profile strong { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-profile .muted { font-size: 12.5px; }
.form-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 17px; flex: none; }
.form-sections { display: flex; }
.form-steps { width: 250px; flex: none; border-right: 1px solid var(--border); background: var(--surface-2); padding: 12px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.form-step { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; border-radius: 10px; padding: 9px 10px; cursor: pointer; color: var(--text); font: inherit; border-left: 3px solid transparent; }
.form-step:hover { background: var(--surface); }
.form-step.active { background: var(--surface); box-shadow: var(--shadow); border-left-color: var(--brand); }
.form-step-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; flex: none; color: var(--text-2); }
.form-step-icon svg.lucide { width: 16px; height: 16px; }
.form-step.active .form-step-icon { background: var(--brand); border-color: var(--brand); color: #fff; }
.form-step.invalid .form-step-icon { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.form-step-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.form-step-text strong { font-size: 13px; font-weight: 600; }
.form-step-text small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-step.invalid small { color: var(--danger); font-weight: 600; }
.form-step-state { color: var(--success); display: grid; place-items: center; }
.form-step-state svg.lucide { width: 16px; height: 16px; }
.form-section-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.form-section-head h4 { font-size: 17px; font-weight: 600; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; align-content: start; }
@media (max-width: 900px) {
  .modal-xl { height: auto; }
  .form-sections { flex-direction: column; }
  .form-steps { width: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .form-step { width: auto; flex: none; }
  .form-step-text small { display: none; }
  .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) { .form-grid.cols-3 { grid-template-columns: 1fr; } }
.modal-head { padding: 16px 20px; border-bottom: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center; position: relative; }
.modal-head h3 { font-size: 20px; font-weight: 400; text-align: center; }
.modal-head .icon-btn, .modal-head .lx-icon-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.modal-body { padding: 18px 24px; }
.modal-foot { padding: 12px 20px; border-top: 2px solid var(--border-strong); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 0; background: none; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ================= Toasts ================= */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); top: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 120; }
.toast { background: var(--success); color: #fff; padding: 12px 18px; border-radius: 0; box-shadow: var(--shadow-lg); font-size: 14px; min-width: 320px; max-width: 520px; display: flex; gap: 8px; align-items: center; }
.toast.error { background: var(--danger); }

/* ================= Tabs (in-page) ================= */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-strong); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 9px 12px; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; position: relative; white-space: nowrap; }
.tab:hover { color: var(--brand-text); text-decoration: none; }
.tab.active { color: var(--brand-text); }
.tab.active::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }

/* ================= Tree ================= */
.tree ul { list-style: none; margin: 0; padding-left: 22px; border-left: 1px solid var(--border); }
.tree > ul { padding-left: 0; border: 0; }
.tree li { margin: 1px 0; }
.tree-node { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 0; }
.tree-node:hover { background: var(--brand-soft); }
.tree-toggle { width: 22px; height: 22px; border: 0; background: none; cursor: pointer; color: var(--text-2); display: grid; place-items: center; padding: 0; border-radius: 50%; }
.tree-toggle:hover { background: var(--surface-2); }

/* ================= Auth (login) ================= */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.05fr; background: var(--surface); }
.auth-hero { background: radial-gradient(circle at 15% 15%, #1b96ff 0, #066afe 30%, #0250d9 60%, #002775 100%); color: #eaf2ff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-hero h1 { font-size: 34px; line-height: 1.15; color: #fff; max-width: 460px; font-weight: 300; }
.auth-hero p { color: #d8e6fe; max-width: 440px; font-size: 15px; }
.auth-points { display: grid; gap: 12px; margin-top: 28px; }
.auth-points div { display: flex; gap: 10px; align-items: center; color: #fff; }
.auth-points svg.lucide { color: #fff; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--canvas); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 30px 32px; }
.auth-card h2 { font-size: 24px; font-weight: 300; margin-bottom: 6px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .input { height: 38px; }
.auth-card .btn { height: 38px; }
.brand-mark { width: 40px; height: 30px; border-radius: 15px; background: #fff; color: #066afe; display: grid; place-items: center; font-weight: 800; font-size: 15px; }

/* ================= Empty / roadmap / misc ================= */
.empty { text-align: center; padding: 44px 20px; color: var(--text-2); }
.empty .icon { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft-2); color: var(--brand); }
.empty .icon svg.lucide { width: 44px; height: 44px; stroke-width: 1.5; }
.empty h2 { font-size: 22px; font-weight: 300; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft-2); color: var(--brand-text); display: grid; place-items: center; font-weight: 700; font-size: 13px; }

/* Matrix */
.matrix td.center input { width: 16px; height: 16px; accent-color: var(--brand); }
.matrix tr.group td { background: var(--surface-2); font-weight: 600; }
.matrix td.indent-1 { padding-left: 28px; }
.matrix td.indent-2 { padding-left: 46px; }

/* ================= Responsive ================= */
@media (max-width: 1200px) {
  .lx-hero { grid-template-columns: 1fr; }
  .lx-hero-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ================= File upload (drop zone, queue) ================= */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9999px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { border: 0; background: none; padding: 5px 14px; border-radius: 9999px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button svg.lucide { width: 14px; height: 14px; }
.seg button.active { background: var(--surface); color: var(--brand-text); box-shadow: var(--shadow); }
.dropzone { display: flex; align-items: center; gap: 12px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-3); padding: 10px 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); outline: none; }
.dropzone .dz-icon { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft-2); color: var(--brand); }
.dropzone .dz-icon svg.lucide { width: 18px; height: 18px; }
.dropzone .dz-text { flex: 1; min-width: 0; }
.dropzone .dz-btn { flex-shrink: 0; pointer-events: none; }
.dropzone.over .dz-icon { background: var(--brand); color: #fff; }
.dropzone strong { display: block; font-size: 13px; font-weight: 600; }
.dropzone.disabled { cursor: not-allowed; opacity: .6; }
.progress { height: 6px; border-radius: 9999px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width .25s; }
.queue td { white-space: nowrap; }
.queue td.wrap { white-space: normal; }
.queue tr.detail td, .queue tr.detail:hover td { background: var(--surface-3); white-space: normal; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .lx-rail-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 55; }
  .lx-main { margin-left: 0; }
  .lx-utility { left: 0; }
  .lx-menu-toggle { display: grid; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
@media (max-width: 640px) {
  .lx-canvas { padding: 12px 12px 24px; }
  .grid-2, .grid-3, .grid-4, .form-grid, .lx-hero-cards { grid-template-columns: 1fr; }
  .lx-header { padding: 0 10px; gap: 8px; }
  .kv { grid-template-columns: 1fr; }
  .lx-utility-meta { display: none; }
}

/* Distributor data status calendar (sales upload) */
.feed-cal { overflow: hidden; }
.feed-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px 10px; }
.feed-month { display: flex; align-items: center; gap: 4px; }
.feed-month-label { position: relative; font-size: 18px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-sm); cursor: pointer; min-width: 170px; text-align: center; }
.feed-month-label:hover { background: var(--surface-2); }
.feed-month-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.feed-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-3); }
.feed-tools .search { position: relative; min-width: 220px; flex: 0 1 280px; }
.feed-tools .search svg { position: absolute; left: 10px; top: 8px; width: 16px; height: 16px; color: var(--text-2); }
.feed-tools .search input { padding-left: 32px; }
.seg-count { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 9999px; background: var(--border); color: var(--text-2); }
.seg button.active .seg-count { background: var(--brand-soft-2); color: var(--brand-text); }
.feed-legend { display: flex; align-items: center; gap: 4px; margin-left: auto; font-size: 11.5px; color: var(--text-2); flex-wrap: wrap; }
.feed-legend .feed-cell { width: 14px; height: 14px; min-width: 0; border-radius: 1px; display: inline-block; }
.feed-legend .feed-cell + span { margin-right: 8px; }
.feed-legend span:first-child { margin-right: 2px; }

.feed-scroll { overflow-x: auto; }
.feed-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--border); }
.feed-pager .icon-btn:disabled { opacity: .35; cursor: default; background: none; }
.feed-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12px; transition: opacity .15s; }
.feed-table.loading { opacity: .5; }
.feed-table th, .feed-table td { padding: 1px; background: var(--surface); text-align: center; font-weight: 400; }
.feed-table thead th { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--border); padding: 8px 2px 6px; }
.feed-table tfoot th, .feed-table tfoot td { position: sticky; bottom: 0; z-index: 2; border-top: 1px solid var(--border-strong); background: var(--surface-3); padding: 7px 2px; font-size: 11px; }
.feed-table .feed-dist { position: sticky; left: 0; z-index: 1; text-align: left; min-width: 190px; max-width: 250px; padding: 4px 8px 4px 12px; border-right: 1px solid var(--border); }
.feed-table thead .feed-dist, .feed-table tfoot .feed-dist { z-index: 3; font-weight: 600; }
.feed-dist-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-dist-code { font-size: 10.5px; font-weight: 400; color: var(--text-2); }
.feed-day { min-width: 48px; line-height: 1.1; }
.feed-day span { display: block; font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .3px; }
.feed-day b { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-top: 2px; border-radius: 50%; font-size: 12.5px; font-weight: 600; }
.feed-day.sortable { cursor: pointer; user-select: none; }
.feed-day.sortable:not(.is-today):hover b { background: var(--surface-2); }
.feed-day.is-sorted { box-shadow: inset 0 -2px 0 var(--brand); }
.feed-day .sort-mark { display: block; height: 10px; font-size: 8px; font-style: normal; line-height: 10px; color: var(--brand-text); }
.feed-day.is-sun span { color: var(--danger); }
.feed-day.is-holiday b { box-shadow: inset 0 0 0 1.5px var(--warning); color: var(--warning); }
.feed-day.is-today b { background: var(--brand); color: #fff; }
.feed-table td.is-today { background: var(--brand-soft); }
.feed-table tbody tr:hover th, .feed-table tbody tr:hover td { background: var(--surface-2); }
.feed-table tbody tr:hover td.is-today { background: var(--brand-soft-2); }
.feed-table .feed-sum { min-width: 92px; text-align: right; padding-right: 16px; border-left: 1px solid var(--border); }
.feed-table .feed-sum b { font-size: 13px; font-weight: 600; }
.feed-foot-count { font-size: 10px; color: var(--text-3); }
.feed-empty { padding: 40px; text-align: center; color: var(--text-2); }

.feed-cell { display: grid; place-items: center; height: 34px; min-width: 46px; border-radius: 1px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: default; transition: transform .1s, box-shadow .1s; }
.feed-cell[class*="heat-"]:hover { transform: scale(1.08); box-shadow: var(--shadow-lg); position: relative; z-index: 1; }
.feed-cell.heat-1 { background: var(--heat-1); color: var(--heat-ink); }
.feed-cell.heat-2 { background: var(--heat-2); color: var(--heat-ink); }
.feed-cell.heat-3 { background: var(--heat-3); color: var(--heat-ink); }
.feed-cell.heat-4 { background: var(--heat-4); color: #fff; }
.feed-cell.heat-5 { background: var(--heat-5); color: #fff; }
.feed-cell.is-negative { box-shadow: inset 0 0 0 2px var(--danger); color: var(--danger); background: var(--danger-soft); }
.feed-cell.is-missing { background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.feed-cell.is-off { background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, transparent 4px 8px); color: var(--text-3); font-weight: 500; font-size: 10px; }
.feed-cell.is-due { border: 1.5px dashed var(--brand); color: var(--brand-text); }
.feed-cell.is-future { border: 1px dashed var(--border-strong); opacity: .6; }
@media (max-width: 900px) { .feed-legend { margin-left: 0; } }

/* DSR product mapping workbench */
.map-card { overflow: visible; }
.map-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.map-tools .search { position: relative; flex: 0 1 300px; min-width: 220px; }
.map-tools .search svg { position: absolute; left: 10px; top: 8px; width: 16px; height: 16px; color: var(--text-2); }
.map-tools .search input { padding-left: 32px; border-radius: 0; }
.map-tools-right { display: flex; gap: 8px; margin-left: auto; }
.map-summary { display: flex; gap: 6px 18px; flex-wrap: wrap; padding: 8px 14px; font-size: 12px; color: var(--text-2); background: var(--surface-3); border-bottom: 1px solid var(--border); }
.map-table td { vertical-align: top; }
.map-table > tbody > tr.is-picked > td { background: var(--brand-soft); }
.map-name { font-weight: 600; }
.map-members { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; padding: 0; border: 0; background: none; color: var(--link); font: inherit; font-size: 11.5px; cursor: pointer; text-align: left; }
.map-members svg.lucide { width: 13px; height: 13px; transition: transform .15s; }
.map-choices { display: flex; flex-wrap: wrap; gap: 4px; }
.map-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; text-align: left; }
.map-chip:hover { border-color: var(--brand); }
.map-chip.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); font-weight: 600; }
.map-chip .badge { font-size: 10px; }
.map-reason { margin-top: 3px; }
.conf-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; font-style: normal; }
.conf-dot.conf-high { background: var(--success); }
.conf-dot.conf-medium { background: var(--warning); }
.conf-dot.conf-low { background: var(--text-3); }
.conf-dot.conf-none { background: var(--danger); }
.conf-dot.conf-own { background: var(--brand); }
.seg .conf-dot { margin-right: 2px; }
.map-pick { position: relative; margin-top: 6px; }
.map-pick .input { height: 28px; border-radius: 0; font-size: 12px; border-color: var(--border-strong); }
.map-drop { left: 0; right: 0; top: 100%; max-height: 260px; overflow: auto; }
.map-card .table-wrap { overflow: visible; } /* the product picker opens below the row */
.map-drop button { display: flex; gap: 6px; align-items: center; width: 100%; text-align: left; }
.map-drop button.hi { background: var(--surface-2); }
.map-detail > td { background: var(--surface-3); padding: 6px 12px 12px 46px; }
.map-detail .table { background: var(--surface); border: 1px solid var(--border); font-size: 12px; }
.map-empty { text-align: center; padding: 36px !important; color: var(--text-2); }
.map-empty svg.lucide { width: 28px; height: 28px; margin-bottom: 6px; color: var(--success); }
.map-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-3); }
.map-period .input { width: 150px; height: 30px; border-radius: 0; }
.map-period .muted svg.lucide { width: 15px; height: 15px; vertical-align: -3px; }
.map-pick .input.has-choice { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.map-pick .input { padding-right: 28px; }
.map-caret { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 26px; display: grid; place-items: center; border: 0; background: none; color: var(--text-2); cursor: pointer; }
.map-caret:hover { color: var(--brand); }
.map-caret svg.lucide { width: 15px; height: 15px; transition: transform .15s; }
.map-drop-head { padding: 6px 10px 2px; font-size: 10.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; }
.map-drop button.chosen { font-weight: 600; color: var(--brand-text); }
.map-reason .conf-dot { vertical-align: 0; }
/* movable / resizable columns */
.map-table { table-layout: fixed; min-width: 100%; }
.map-table .map-sel { width: 34px; }
.map-table > thead th { position: relative; cursor: grab; user-select: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-table > thead th.map-sel { cursor: default; }
.map-table > thead th.dragging { opacity: .45; }
.map-table > thead th.drag-over { box-shadow: inset 3px 0 0 var(--brand); background: var(--brand-soft); }
.map-th { display: inline-flex; align-items: center; gap: 4px; }
.map-grip { width: 12px !important; height: 12px !important; color: var(--text-3); opacity: 0; transition: opacity .15s; }
.map-table > thead th:hover .map-grip { opacity: 1; }
.map-resize { position: absolute; top: 0; right: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 2; }
.map-resize::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 3px; width: 1px; background: var(--border-strong); }
.map-resize:hover::after { top: 0; bottom: 0; width: 2px; right: 2px; background: var(--brand); }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }
.map-table td.wrap { overflow-wrap: anywhere; }
.map-reset { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--link); font: inherit; font-size: 12px; cursor: pointer; padding: 0; }
.map-reset svg.lucide { width: 13px; height: 13px; }
/* form section heading (field type "section") */
.form-grid .form-section { margin: 6px 0 -4px; }
.form-section-title { font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--brand-text); padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.form-grid .form-section:first-child { margin-top: 0; }

/* Territory Hierarchy Tree (MREP-style tree-grid; row tint by level as in MREP) */
.tt-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tt-toolbar .search { position: relative; flex: 0 1 320px; min-width: 220px; }
.tt-toolbar .search svg { position: absolute; left: 10px; top: 8px; width: 16px; height: 16px; color: var(--text-2); }
.tt-toolbar .search input { padding-left: 32px; border-radius: 0; }
.tt-toolbar .count { color: var(--text-2); font-size: 12px; }
.tt-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11.5px; table-layout: fixed; }
.tt-table th, .tt-table td { padding: 5px 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); vertical-align: middle; text-align: left; overflow-wrap: anywhere; }
.tt-table { border-top: 1px solid var(--border); border-left: 1px solid var(--border); background: var(--surface); }
.tt-table thead th { position: sticky; top: var(--header-h); z-index: 2; background: var(--surface-3); font-size: 11px; font-weight: 400; color: var(--text-2); cursor: pointer; user-select: none; white-space: nowrap; }
.tt-table thead tr.tt-filters th { top: calc(var(--header-h) + 30px); cursor: default; padding: 2px 4px; background: var(--surface); }
.tt-table thead th .ns-funnel { float: right; margin-top: 2px; }
.tt-table thead th .ns-funnel.on { color: var(--brand); }
.tt-sort { font-style: normal; font-size: 8px; margin-left: 4px; color: var(--brand-text); }
.tt-filter { width: 100%; height: 24px; border: 1px solid transparent; border-radius: 0; padding: 0 4px 0 20px; font: inherit; font-size: 11px; color: var(--text);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.5' fill='none' stroke='%23888' stroke-width='1.6'/%3E%3Cpath d='M10.5 10.5 14 14' stroke='%23888' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 4px center / 12px 12px; }
.tt-filter:hover { border-color: var(--border); }
.tt-filter:focus { outline: none; border-color: var(--brand); background-color: var(--surface); }
.tt-node { display: inline-flex; align-items: center; gap: 4px; }
.tt-toggle { width: 16px; height: 16px; padding: 0; border: 0; background: none; color: var(--text-2); cursor: pointer; font-size: 9px; line-height: 16px; }
.tt-toggle i { font-style: normal; }
.tt-leaf { display: inline-block; width: 16px; }
.tt-inactive { color: var(--text-3); text-decoration: line-through; }
.tt-vacant { color: var(--danger); font-weight: 600; }
.tt-last { display: block; color: var(--text-3); font-size: 10.5px; }
.tt-empty { text-align: center; padding: 30px !important; color: var(--text-2); }
.tt-table tbody tr td { background: var(--dc, var(--surface)); }   /* --dc = designation colour, set per row */
.tt-table tbody tr:hover td { box-shadow: inset 0 0 0 9999px rgba(6, 106, 254, .06); }
:root[data-theme="dark"] .tt-table tbody tr td { background: color-mix(in srgb, var(--dc, var(--surface)) 14%, var(--surface)); }
.tt-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tt-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 11px; cursor: pointer; }
.tt-chip i { width: 12px; height: 12px; background: var(--dc); border: 1px solid rgba(0, 0, 0, .15); }
.tt-chip b { font-weight: 600; color: var(--text-2); }
.tt-chip:hover, .tt-chip.active { border-color: var(--brand); }
.tt-chip.active { background: var(--brand-soft); color: var(--brand-text); }

/* ================= Employee ledger & self-service ================= */
.ledger-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 18px 22px; margin-bottom: 14px; }
.ledger-hero h2 { font-size: 22px; font-weight: 400; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ledger-figures { display: flex; gap: 22px; }
.ledger-figures div { display: flex; flex-direction: column; }
.ledger-figures small { color: var(--text-3); font-size: 11.5px; }
.ledger-figures strong { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ledger-pane { margin-bottom: 14px; }
.ledger-panels .card-head h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ledger-panels .card-head h3 svg.lucide { width: 16px; height: 16px; color: var(--brand-text); }
.timeline { list-style: none; margin: 0; padding: 14px 20px; }
.timeline li { display: flex; gap: 14px; padding: 0 0 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; flex: none; }
.timeline-icon svg.lucide { width: 16px; height: 16px; }
.leave-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.leave-cards .stat-value { font-size: 26px; }
.ess-hero { grid-template-columns: 1fr auto; }
.ess-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ess-tile { color: inherit; text-decoration: none; transition: box-shadow .15s; }
.ess-tile:hover { box-shadow: var(--shadow-lg); }
.ess-balance { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.ess-balance span { font-size: 12px; color: var(--text-2); font-weight: 600; }
.ess-balance strong { font-size: 20px; font-weight: 500; }
.ess-bar { height: 6px; border-radius: 3px; background: var(--success-soft); margin-top: 4px; overflow: hidden; }
.ess-bar div { height: 6px; background: var(--warning); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-2); padding-bottom: 4px; }
.cal-day { min-height: 78px; border-radius: 10px; border: 1px solid var(--border); padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; background: var(--surface); }
.cal-num { font-weight: 600; font-size: 13px; }
.cal-code { font-weight: 600; }
.cal-time { color: var(--text-2); }
.cal-time b { color: var(--warning); }
.cal-today { box-shadow: 0 0 0 2px var(--brand); }
.cal-P { background: var(--success-soft); } .cal-P .cal-code { color: var(--success); }
.cal-A { background: var(--danger-soft); } .cal-A .cal-code { color: var(--danger); }
.cal-HD { background: var(--warning-soft); } .cal-HD .cal-code { color: var(--warning); }
.cal-L { background: var(--brand-soft); } .cal-L .cal-code { color: var(--brand-text); }
.cal-H, .cal-W { background: var(--surface-2); color: var(--text-3); }
.cal-blank { background: transparent; border-style: dashed; color: var(--text-3); }
.cal-none .cal-code { color: var(--text-3); font-weight: 400; }
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; border: 1px solid var(--border); }
.cal-dot.cal-P { background: var(--success); } .cal-dot.cal-A { background: var(--danger); } .cal-dot.cal-L { background: var(--brand); }
.cal-dot.cal-HD { background: var(--warning); } .cal-dot.cal-none { background: var(--surface); }
.print-only { display: none; }
@media (max-width: 900px) { .ess-hero { grid-template-columns: 1fr; } .ess-actions { justify-content: flex-start; } .cal-day { min-height: 54px; } .cal-time { display: none; } }
@media print {
  .sidebar, .lx-header, .lx-utility, .no-print, .tabs, .toasts { display: none !important; }
  .lx-main, .lx-canvas { margin: 0 !important; padding: 0 !important; overflow: visible !important; height: auto !important; }
  body, .lx-canvas { background: #fff !important; }
  .ledger-pane { display: block !important; break-inside: avoid-page; }
  .print-only { display: block; font-size: 16px; margin: 14px 0 8px; }
  .card { box-shadow: none !important; border: 1px solid #ddd; }
}
