:root {
    --ink: #16232B; --ink-2: #41525E; --ink-3: #6B7A85; --line: #DDE3E7; --line-2: #E9EDF0;
    --surface: #F3F5F6; --card: #FFFFFF; --canvas: #EDF0F2;
    --primary: #0E6E55; --primary-deep: #0A4A3A; --primary-soft: #E3F1EC; --primary-mid: #12805F;
    --gold: #B78A2E; --gold-soft: #F7EFDD;
    --info: #1C6FB8; --info-soft: #E4EFF9; --warn: #B0680C; --warn-soft: #FBF0DD;
    --danger: #B0322C; --danger-soft: #F9E6E5; --ok: #1E7B45; --ok-soft: #E4F3EA;
    --violet: #6D4FA1; --violet-soft: #EFEAF7;
    --radius: 8px; --radius-sm: 4px;
    --shadow: 0 1px 2px rgba(22,35,43,.06), 0 2px 8px rgba(22,35,43,.06);
    --shadow-lg: 0 4px 10px rgba(22,35,43,.10), 0 12px 32px rgba(22,35,43,.12);
    --font: "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono: "Cascadia Code", "Consolas", "SF Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; width: 100%; }
body { font-family: var(--font); font-size: 13px; color: var(--ink); background: var(--canvas); }
button { font-family: var(--font); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C3CCD2; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* App Shell */
#app { display: grid; grid-template-columns: 262px 1fr; grid-template-rows: 52px 1fr; width: 100%; height: 100vh; overflow-x: hidden; grid-template-areas: "nav topbar" "nav content"; }
#app.nav-collapsed { grid-template-columns: 0 1fr; }

/* Top Bar */
.topbar { grid-area: topbar; background: linear-gradient(135deg, var(--primary-deep) 0%, #0C5A46 100%); color: #fff; display: flex; align-items: center; gap: 10px; padding: 0 14px; z-index: 40; }
.topbar .hamburger { background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; padding: 6px; border-radius: 6px; display: grid; place-items: center; width: 32px; height: 32px; transition: all .12s; flex: none; }
.topbar .hamburger:hover { background: rgba(255,255,255,.12); color: #fff; }
.brandline { display: flex; align-items: center; gap: 9px; min-width: 0; text-decoration: none; color: #fff; flex: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; background: linear-gradient(135deg, var(--primary-mid), #0C5A46); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; border: 1px solid rgba(255,255,255,.2); flex: none; }
.brand-mark span { color: #EFD9A7; }
.brandline .t1 { font-size: 13px; font-weight: 700; white-space: nowrap; letter-spacing: -.2px; }
.brandline .t2 { font-size: 9.5px; color: rgba(255,255,255,.55); white-space: nowrap; letter-spacing: .3px; }
.top-divider { width: 1px; height: 22px; background: rgba(255,255,255,.1); flex: none; }
.globalsearch { flex: 1; max-width: 440px; position: relative; }
.globalsearch form { margin: 0; width: 100%; }
.globalsearch input { width: 100%; height: 32px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.08); border-radius: 8px; color: #fff; padding: 0 40px 0 34px; font-size: 12.5px; transition: all .2s; }
.globalsearch input::placeholder { color: rgba(255,255,255,.4); }
.globalsearch input:focus { outline: none; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.12); }
.globalsearch .gs-ico { position: absolute; left: 10px; top: 8px; color: rgba(255,255,255,.4); pointer-events: none; }
.globalsearch kbd { position: absolute; right: 8px; top: 6px; font-family: var(--mono); font-size: 9.5px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.4); border-radius: 4px; padding: 2px 5px; pointer-events: none; border: 1px solid rgba(255,255,255,.06); }

/* Top Icons */
.top-ico { position: relative; background: none; border: 0; color: rgba(255,255,255,.65); cursor: pointer; width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; text-decoration: none; transition: all .12s; flex: none; }
.top-ico:hover { background: rgba(255,255,255,.1); color: #fff; }
.top-ico svg { display: block; }
.top-ico .dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; background: #E4B33C; color: #3A2C05; border-radius: 8px; font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid var(--primary-deep); }
.notifdrop { display: none; position: absolute; top: calc(100% + 8px); right: -8px; width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 100; overflow: hidden; }
.top-ico.open .notifdrop { display: block; }
.notif-h { padding: 11px 15px; font-size: 11.5px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .5px; }
.notif-list { max-height: 280px; overflow-y: auto; }
.notif-item { display: block; padding: 10px 15px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink); transition: background .1s; }
.notif-item:hover { background: var(--surface); }
.notif-item.unread { background: var(--primary-soft); }
.notif-item .ni-title { font-size: 12px; font-weight: 600; line-height: 1.3; }
.notif-item .ni-msg { font-size: 11px; color: var(--ink-3); line-height: 1.4; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-item .ni-time { font-size: 9.5px; color: var(--ink-3); font-family: var(--mono); margin-top: 4px; }
.notif-load { padding: 20px; text-align: center; font-size: 11px; color: var(--ink-3); }
.notif-foot { display: flex; justify-content: center; padding: 9px 15px; font-size: 11.5px; font-weight: 600; color: var(--primary); text-decoration: none; border-top: 1px solid var(--line); }
.notif-foot:hover { background: var(--primary-soft); }

/* User Chip */
.userchip { position: relative; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 3px 10px 3px 3px; cursor: pointer; user-select: none; transition: all .12s; flex: none; }
.userchip:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #E4B33C, #B78A2E); color: #2E2306; font-weight: 700; font-size: 10.5px; display: grid; place-items: center; flex: none; }
.uc-info { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.userchip .un { font-size: 11.5px; font-weight: 600; color: #fff; }
.userchip .ur { font-size: 9.5px; color: rgba(255,255,255,.5); }
.userchip .userchev { color: rgba(255,255,255,.4); transition: transform .2s; flex: none; }
.userchip.open .userchev { transform: rotate(180deg); }
.userdrop { display: none; position: absolute; top: calc(100% + 6px); right: 0; min-width: 170px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 100; overflow: hidden; padding: 4px; }
.userchip.open .userdrop { display: block; }
.ud-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 12px; color: var(--ink); text-decoration: none; transition: background .1s; border-radius: 6px; }
.ud-item:hover { background: var(--surface); color: var(--primary); }
.ud-item svg { flex: none; color: var(--ink-3); }
.ud-item:hover svg { color: var(--primary); }
.ud-item:last-child { color: var(--danger); }
.ud-item:last-child svg { color: var(--danger); }
.ud-item:last-child:hover { background: var(--danger-soft); }

.envtag { font-size: 9px; font-weight: 700; letter-spacing: 1px; background: rgba(228,179,60,.15); color: #EFD9A7; padding: 3px 9px; border-radius: 4px; border: 1px solid rgba(228,179,60,.2); flex: none; }

/* Left Nav */
.nav { grid-area: nav; background: linear-gradient(180deg, #0C1A22 0%, #0F1E26 100%); color: #C6D3DA; display: flex; flex-direction: column; overflow: hidden; z-index: 41; border-right: 1px solid rgba(255,255,255,.04); }
#app.nav-collapsed .nav { display: none; }

/* Nav Brand */
.nav-brand { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
.nav-brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--primary-mid), #0C5A46); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; border: 1px solid rgba(255,255,255,.15); flex: none; position: relative; }
.nbm-sub { color: #EFD9A7; }
.nav-brand-text { min-width: 0; }
.nbt-title { font-size: 13px; font-weight: 700; color: #fff; letter-spacing: -.3px; line-height: 1.2; }
.nbt-sub { font-size: 9.5px; color: #7E97A3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Nav Search */
.nav-search-box { position: relative; margin: 10px 6px 6px; }
.nav-search-box input { width: 100%; height: 30px; background: #15262E; border: 1px solid #253B46; border-radius: 7px; color: #DFE9EE; padding: 0 26px 0 30px; font-size: 12px; transition: border-color .15s; }
.nav-search-box input::placeholder { color: #4F6978; }
.nav-search-box input:focus { outline: none; border-color: var(--primary); background: #182B33; }
.nav-search-box .nsb-ico { position: absolute; left: 9px; top: 7px; font-size: 12px; color: #4F6978; pointer-events: none; }
.nav-search-box .nsb-clr { position: absolute; right: 7px; top: 6px; font-size: 10px; color: #4F6978; cursor: pointer; padding: 2px 4px; border-radius: 3px; display: none; }
.nav-search-box .nsb-clr:hover { color: #fff; background: #253B46; }
.nav-search-box input:not(:placeholder-shown) ~ .nsb-clr { display: block; }

.nav-scroll { flex: 1; overflow-y: auto; padding: 4px 4px 12px; }
.nav-scroll::-webkit-scrollbar-thumb { background: #253B46; border-radius: 4px; }
.nav-scroll::-webkit-scrollbar { width: 4px; }
.nav-scroll::-webkit-scrollbar-track { background: transparent; }

.ng { margin-bottom: 1px; }
.ng-h { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; color: #6A8899; font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; padding: 10px 8px 4px; cursor: pointer; text-align: left; transition: color .15s; user-select: none; }
.ng-h:hover { color: #9BB5C4; }
.ng-h .ng-chev { font-size: 8px; color: #4F6978; transition: transform .2s; }
.ng.open .ng-h .ng-chev { transform: rotate(180deg); }

.ng-items { display: none; padding: 1px 0 4px; }
.ng.open .ng-items { display: block; }

.nv { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: #B0C8D6; font-size: 12.5px; padding: 6px 10px; border-radius: 6px; cursor: pointer; text-align: left; position: relative; text-decoration: none; transition: all .12s; }
.nv .ni { width: 20px; text-align: center; font-size: 13px; color: #5F7D8D; flex: none; transition: color .12s; }
.nv .nl { transition: color .12s; }
.nv:hover { background: rgba(255,255,255,.06); color: #fff; }
.nv:hover .ni { color: #BDD8CE; }
.nv.active { background: rgba(14,110,85,.25); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
.nv.active .ni { color: #7DD4B0; }
.nv.active .nl { color: #fff; }
.nv .cnt { margin-left: auto; font-size: 10px; font-family: var(--mono); background: rgba(255,255,255,.08); color: #7E97A3; border-radius: 7px; padding: 1px 6px; flex: none; }
.nv.active .cnt { background: rgba(255,255,255,.15); color: #BDD8CE; }

/* Nav filter: hide non-matching items */
.nav-filtering .ng.open .ng-items { display: block !important; }
.nav-filtering .ng { margin-bottom: 0; }
.nv.nav-hidden { display: none; }
.nav-filtering .ng-h.nav-hidden { display: none; }

/* Nav Foot */
.nav-foot { border-top: 1px solid rgba(255,255,255,.06); padding: 10px 12px; }
.nf-user { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.nf-avatar { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, #E4B33C, #B78A2E); color: #2E2306; font-weight: 700; font-size: 11px; display: grid; place-items: center; flex: none; }
.nf-info { min-width: 0; }
.nf-name { font-size: 11.5px; font-weight: 600; color: #D6E3EA; line-height: 1.2; }
.nf-role { font-size: 9.5px; color: #5F7D8D; line-height: 1.2; margin-top: 1px; }
.nf-meta { font-size: 9px; color: #3F5A6A; padding-left: 36px; }

/* Content */
.content { grid-area: content; overflow-y: auto; padding: 16px 22px 60px; position: relative; }
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-3); margin-bottom: 10px; flex-wrap: wrap; letter-spacing: .2px; }
.crumbs a { color: var(--ink-3); text-decoration: none; cursor: pointer; }
.crumbs a:hover { color: var(--primary); }
.crumbs .sep { color: #C8D1D7; font-size: 10px; }
.crumbs .here { color: var(--ink); font-weight: 600; }
.pagehead { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.pagehead h1 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; line-height: 1.2; color: var(--ink); }
.pagehead .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; max-width: 760px; line-height: 1.5; }
.pagehead .ph-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Chips (filter toggles) */
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .15s ease; }
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Dashboard Hero */
.dash-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 20px 22px; background: linear-gradient(135deg, var(--primary-deep) 0%, #0C5A46 100%); border-radius: 10px; color: #fff; box-shadow: 0 2px 10px rgba(10,74,58,.25); }
.dash-hero-text { flex: 1; min-width: 0; }
.dash-hero-text h1 { font-size: 18px; font-weight: 600; letter-spacing: -.2px; }
.dash-hero-text p { font-size: 12px; color: #BDD8CE; margin-top: 2px; }
.dash-hero-actions { display: flex; gap: 8px; flex: none; }
.dash-btn { height: 36px; padding: 0 18px; border-radius: 8px; font-size: 12.5px; font-weight: 600; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); color: #fff; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none; transition: all .15s; }
.dash-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.dash-btn.primary { background: #fff; border-color: #fff; color: var(--primary-deep); }
.dash-btn.primary:hover { background: #F0F5F2; }
.dash-btn-ico { font-size: 14px; line-height: 1; }

/* Quick Actions */
.dash-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.dq-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; transition: all .2s; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.dq-card::after { content: '→'; position: absolute; bottom: -14px; right: 8px; font-size: 14px; color: var(--primary); opacity: 0; transition: all .25s cubic-bezier(.22,1,.36,1); }
.dq-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(22,35,43,.12); border-color: var(--primary); }
.dq-card:hover .dq-ico { transform: scale(1.1); }
.dq-card:hover .dq-label { color: var(--primary-deep); }
.dq-card:hover::after { opacity: 1; bottom: 6px; }
.dq-ico { transition: transform .2s; }
.dq-ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; color: #fff; }
.dq-label { font-size: 12px; font-weight: 700; }
.dq-desc { font-size: 10px; color: var(--ink-3); line-height: 1.3; }

/* Table row clickable */
.tbl-row { cursor: pointer; transition: background .12s; }
.tbl-row:hover { background: #F0F9F5 !important; }
.tbl-name { font-weight: 600; }
.mono { font-family: var(--mono); }
.mono.accent { color: var(--primary); font-weight: 600; }
.tbl-empty { text-align: center; color: var(--ink-3); padding: 30px; font-size: 12px; }

/* Pipeline Chart */
.pipeline-chart { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding: 0 4px; }
.pc-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; min-width: 0; }
.pc-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.pc-bar { width: 100%; max-width: 40px; flex: 1; border-radius: 5px 5px 0 0; overflow: hidden; background: var(--line-2); display: flex; flex-direction: column-reverse; min-height: 4px; }
.pc-fill { border-radius: 5px 5px 0 0; transition: height .6s cubic-bezier(.22,1,.36,1); min-height: 4px; width: 100%; }
.pc-label { font-size: 9.5px; color: var(--ink-3); font-weight: 600; text-align: center; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pc-pct { font-size: 9px; font-family: var(--mono); color: var(--ink-3); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; transition: all .15s ease; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.btn:hover { background: #F6F8F9; border-color: #C8D1D7; color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(14,110,85,.25); }
.btn.primary:hover { background: var(--primary-mid); border-color: var(--primary-mid); box-shadow: 0 2px 8px rgba(14,110,85,.35); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; box-shadow: 0 1px 3px rgba(183,138,46,.25); }
.btn.gold:hover { background: #D09B32; border-color: #D09B32; box-shadow: 0 2px 8px rgba(183,138,46,.35); }
.btn.danger { color: var(--danger); border-color: #E3B7B4; }
.btn.danger:hover { background: var(--danger-soft); border-color: #D9A09C; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: #E8EDEF; border-color: transparent; }
.btn.sm { height: 26px; padding: 0 10px; font-size: 11.5px; border-radius: var(--radius-sm); }
.btn.lg { height: 38px; padding: 0 18px; font-size: 13.5px; border-radius: var(--radius); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { font-size: 13px; font-weight: 600; letter-spacing: -.2px; }
.card-h .hint { font-size: 11px; color: var(--ink-3); }
.card-h .push { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 14px 16px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(195px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--kpi-accent, var(--primary)); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-wrap: wrap; align-items: flex-start; gap: 13px; transition: all .2s ease; position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; top: 0; right: 0; width: 80px; height: 80px; border-radius: 50%; background: var(--kpi-accent, var(--primary)); opacity: .03; transform: translate(20px, -30px); pointer-events: none; }
.kpi:hover { box-shadow: 0 4px 16px rgba(22,35,43,.1), 0 1px 3px rgba(22,35,43,.06); transform: translateY(-2px); border-color: var(--kpi-accent, var(--primary)); }
.kpi-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; flex: none; }
.kpi-body { flex: 1; min-width: 0; }
.kpi .kl { font-size: 10.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.kpi .kv { font-size: 22px; font-weight: 700; letter-spacing: -.5px; margin-top: 3px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi .kv small { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.kpi-trend { width: 100%; font-size: 10.5px; color: var(--ink-3); margin-top: -5px; font-weight: 500; }
.kpi-trend.up { color: var(--ok); font-weight: 600; }
.kpi-trend.down { color: var(--danger); font-weight: 600; }

/* Pipeline */
.pipeline { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow); }
.pl-step { flex: 1; min-width: 96px; position: relative; padding: 9px 8px 9px 20px; border-right: 1px solid var(--line-2); }
.pl-step:first-child { padding-left: 14px; }
.pl-step:last-child { border-right: 0; }
.pl-step:after { content: ""; position: absolute; right: -9px; top: 50%; transform: translateY(-50%) rotate(45deg); width: 17px; height: 17px; background: var(--card); border-top: 1px solid var(--line-2); border-right: 1px solid var(--line-2); z-index: 2; }
.pl-step:last-child:after { display: none; }
.pl-step .sn { font-size: 9.5px; font-weight: 700; letter-spacing: .6px; color: var(--ink-3); text-transform: uppercase; }
.pl-step .sv { font-size: 11.5px; font-weight: 600; margin-top: 2px; }
.pl-step .sd { font-size: 9.5px; color: var(--ink-3); margin-top: 1px; font-family: var(--mono); }
.pl-step.done { background: var(--primary-soft); }
.pl-step.done:after { background: var(--primary-soft); }
.pl-step.done .sv { color: var(--primary-deep); }
.pl-step.done .sn:before { content: "\2713 "; color: var(--ok); }
.pl-step.now { background: var(--primary); color: #fff; }
.pl-step.now:after { background: var(--primary); border-color: var(--primary); }
.pl-step.now .sn { color: #BFE3D6; }
.pl-step.now .sd { color: #BFE3D6; }
.pl-step.hold { background: var(--warn-soft); }
.pl-step.hold:after { background: var(--warn-soft); }

/* Command bar */
.cmdbar { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.cmdbar .vr { width: 1px; height: 20px; background: var(--line); flex: none; }
.cmdbar .push { margin-left: auto; }

/* Row actions */
.rowact { display: flex; gap: 3px; }

/* Filter bar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.f-item { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.f-item.grow { flex: 1; min-width: 200px; }
.f-item label { font-size: 10.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; }

/* Inputs */
.form-control, .form-select { height: 32px; border: 1px solid #C4CED4; border-radius: var(--radius-sm); padding: 0 10px; font-size: 12.5px; font-family: var(--font); color: var(--ink); background: var(--card); }
.form-control:hover, .form-select:hover { border-color: #9FAEB6; }
.form-control:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(14,110,85,.18); }
textarea.form-control { height: auto; min-height: 64px; padding: 8px 10px; resize: vertical; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { background: #F6F9FA; color: var(--ink-2); text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.tbl th:hover { color: var(--primary); }
.tbl th .sort { font-size: 9px; color: var(--primary); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 12px; }
.tbl tbody tr:hover { background: #F5FAF8; }
.tbl tbody tr.sel { background: var(--primary-soft); }

/* Badges */
.bdg { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; border-radius: 11px; padding: 3px 10px; white-space: nowrap; }
.bdg:before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bdg.ok { background: var(--ok-soft); color: var(--ok); }
.bdg.info { background: var(--info-soft); color: var(--info); }
.bdg.warn { background: var(--warn-soft); color: var(--warn); }
.bdg.danger { background: var(--danger-soft); color: var(--danger); }
.bdg.gold { background: var(--gold-soft); color: #8A6516; }
.bdg.violet { background: var(--violet-soft); color: var(--violet); }
.bdg.mut { background: #EBEFF1; color: var(--ink-3); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 9px 15px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -2px; white-space: nowrap; display: flex; gap: 7px; align-items: center; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }

/* Timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline:before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl { position: relative; padding: 0 0 16px 8px; }
.tl:last-child { padding-bottom: 0; }
.tl:before { content: ""; position: absolute; left: -19px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--primary); }
.tl .tt { font-size: 12.5px; font-weight: 600; }
.tl .tm { font-size: 10.5px; color: var(--ink-3); font-family: var(--mono); margin: 1px 0 2px; }
.tl .tx { font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.tl.warn:before { border-color: var(--warn); }
.tl.danger:before { border-color: var(--danger); }

/* Wizard */
.wiz { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow-x: auto; box-shadow: var(--shadow); }
.wz { flex: 1; min-width: 120px; display: flex; gap: 9px; align-items: center; padding: 11px 14px; border-right: 1px solid var(--line-2); font-size: 11.5px; color: var(--ink-3); }
.wz:last-child { border-right: 0; }
.wz .n { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #B9C6CD; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; flex: none; }
.wz.done { color: var(--primary-deep); }
.wz.done .n { background: var(--primary); border-color: var(--primary); color: #fff; }
.wz.now { color: var(--ink); font-weight: 700; }
.wz.now .n { border-color: var(--primary); color: var(--primary); }

/* Wizard steps */
.wizard-step { display: none; }
.wizard-step.active { display: block; }

/* Customer Type Bar */
.cust-type-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.ctb-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--ink); min-width: 0; flex: 1; transition: all .15s; box-shadow: var(--shadow); }
.ctb-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.ctb-item.active { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(14,110,85,.2); }
.ctb-ico { font-size: 18px; flex: none; }
.ctb-l1 { font-size: 12.5px; font-weight: 700; display: block; line-height: 1.2; }
.ctb-l2 { font-size: 10px; color: var(--ink-3); display: block; margin-top: 1px; }
.ctb-item.active .ctb-l2 { color: rgba(255,255,255,.7); }

/* Customer Form Wizard */
.cust-form-wiz { display: flex; gap: 6px; margin-bottom: 16px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.cfw-step { display: flex; align-items: center; gap: 8px; flex: 1; position: relative; }
.cfw-step:not(:last-child):after { content: ''; flex: 1; height: 1px; background: var(--line-2); margin-left: 8px; }
.cfs-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; background: var(--line-2); color: var(--ink-3); }
.cfw-step.done .cfs-n { background: var(--primary); color: #fff; }
.cfw-step.now .cfs-n { background: var(--primary-soft); color: var(--primary); border: 2px solid var(--primary); }
.cfs-l { font-size: 11px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.cfs-d { font-size: 8.5px; color: var(--ink-3); white-space: nowrap; display: none; }
.cfw-step.now .cfs-d, .cfw-step.done .cfs-d { display: block; }
.cfw-step.now .cfs-l { color: var(--ink); font-weight: 700; }
.cfw-step.done .cfs-l { color: var(--primary-deep); }

/* Form grid (legacy) */
.form { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px 14px; }
.fld { display: flex; flex-direction: column; gap: 4px; }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c6 { grid-column: span 6; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
@media (max-width: 1200px) { .c2, .c3 { grid-column: span 4; } }
@media (max-width: 900px) { .c2, .c3, .c4, .c6, .c8 { grid-column: span 12; } }
.fld > label { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.fld > label .req { color: var(--danger); font-weight: 700; }
.fld .fhelp { font-size: 10px; color: var(--ink-3); }
.fieldset-h { grid-column: span 12; display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.fieldset-h h4 { font-size: 12px; font-weight: 700; color: var(--primary-deep); text-transform: uppercase; letter-spacing: .6px; }
.fieldset-h:after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.split { display: grid; grid-template-columns: 1fr 340px; gap: 14px; align-items: start; }
@media (max-width: 1150px) { .split { grid-template-columns: 1fr; } }

/* Form Sections */
.form-section { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.fs-head { display: flex; align-items: center; gap: 12px; padding: 13px 18px; background: #F8FBFA; border-bottom: 1px solid var(--line-2); }
.fs-ico { font-size: 20px; flex: none; }
.fs-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.fs-sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.fs-body { padding: 16px 18px 18px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px 14px; }

/* Form Submit Bar */
.form-section-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: #F8FBFA; border-top: 1px solid var(--line-2); gap: 10px; }
.form-submit-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.fsb-right { display: flex; align-items: center; gap: 12px; }
.fsb-hint { font-size: 11px; color: var(--ink-3); }

/* Roles Grid */
.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.role-card { display: flex; align-items: center; gap: 12px; padding: 15px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); cursor: pointer; transition: all .15s; position: relative; }
.role-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(22,35,43,.1); transform: translateY(-1px); }
.rc-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); display: grid; place-items: center; font-size: 20px; flex: none; }
.rc-body { flex: 1; min-width: 0; }
.rc-name { font-size: 13px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 5px; }
.rc-desc { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.3; }
.rc-count { font-size: 15px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; text-align: center; }
.rc-count small { font-size: 9px; font-weight: 400; color: var(--ink-3); display: block; }
.rc-lock { position: absolute; top: 8px; right: 8px; font-size: 11px; opacity: .4; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(22,35,43,.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; }
.modal-box { width: 560px; max-width: 94vw; max-height: 88vh; background: var(--card); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.modal-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.modal-close { background: none; border: 0; font-size: 18px; color: var(--ink-3); cursor: pointer; padding: 4px; margin-left: auto; line-height: 1; border-radius: 4px; }
.modal-close:hover { background: var(--surface); color: var(--ink); }
.modal-body { flex: 1; overflow-y: auto; padding: 14px 20px 10px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-2); background: #F8FBFA; }

/* Permission Modal Groups */
.pm-group { margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pm-header { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--surface); cursor: pointer; user-select: none; }
.pm-header:hover { background: #EBF0F2; }
.pm-chev { font-size: 9px; color: var(--ink-3); transition: transform .15s; flex: none; }
.pm-ico { font-size: 15px; flex: none; }
.pm-title { font-size: 12px; font-weight: 700; color: var(--ink); }
.pm-body { padding: 6px 12px 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.pm-item { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 8px; border-radius: 5px; transition: background .1s; }
.pm-item:hover { background: var(--primary-soft); }
.pm-item input { display: none; }
.pm-cbox { width: 16px; height: 16px; border-radius: 4px; border: 2px solid #C4CED4; flex: none; position: relative; transition: all .1s; }
.pm-item input:checked + .pm-cbox { background: var(--primary); border-color: var(--primary); }
.pm-item input:checked + .pm-cbox:after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pm-lbl { font-size: 11.5px; color: var(--ink); font-weight: 500; }

/* Toggle All Switch */
.tg-all { display: inline-flex; align-items: center; cursor: pointer; }
.tg-all input { display: none; }
.tg-slider { width: 28px; height: 16px; background: #C4CED4; border-radius: 8px; position: relative; transition: background .15s; }
.tg-slider:after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s; }
.tg-all input:checked + .tg-slider { background: var(--primary); }
.tg-all input:checked + .tg-slider:after { transform: translateX(12px); }

/* Profile Layout */
.profile-layout { display: grid; grid-template-columns: 1fr 280px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .profile-layout { grid-template-columns: 1fr; } }
.profile-hero { display: flex; align-items: center; gap: 16px; padding: 20px 22px; background: linear-gradient(135deg, var(--primary-deep) 0%, #0C5A46 100%); border-radius: 10px; color: #fff; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(10,74,58,.25); }
.ph-avatar { width: 52px; height: 52px; border-radius: 13px; background: linear-gradient(135deg, #E4B33C, #B78A2E); color: #2E2306; font-weight: 800; font-size: 20px; display: grid; place-items: center; flex: none; border: 2px solid rgba(255,255,255,.2); }
.ph-info { flex: 1; min-width: 0; }
.ph-name { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.ph-role { margin-top: 3px; }
.ph-meta { display: flex; gap: 14px; font-size: 11.5px; color: #BDD8CE; margin-top: 4px; }
.ph-actions { flex: none; }

.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.ps-card { display: flex; align-items: center; gap: 11px; background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 13px 15px; box-shadow: var(--shadow); }
.ps-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; flex: none; }
.ps-body { min-width: 0; }
.ps-num { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ps-label { font-size: 10.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }

/* Eligibility Layout */
.elig-layout { display: grid; grid-template-columns: 1fr 320px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .elig-layout { grid-template-columns: 1fr; } }
.elig-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.elig-r-item { display: flex; flex-direction: column; gap: 2px; background: var(--surface); padding: 10px 12px; border-radius: 7px; }
.elig-r-label { font-size: 10px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.elig-r-value { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Calculator Layout */
.calc-layout { display: grid; grid-template-columns: 1fr 300px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .calc-layout { grid-template-columns: 1fr; } }
.calc-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.calc-kpi { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 14px; display: flex; align-items: center; gap: 12px; border-left: 3px solid var(--calc-accent, var(--primary)); }
.ck-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; flex: none; }
.ck-body { min-width: 0; }
.ck-label { font-size: 10px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.ck-value { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 1px; }

/* Calc Methods */
.calc-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.cm-item { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; transition: all .15s; position: relative; }
.cm-item:hover { border-color: var(--primary); }
.cm-item.active { border-color: var(--primary); background: var(--primary-soft); }
.cm-item input { position: absolute; opacity: 0; }
.cm-ico { font-size: 20px; }
.cm-label { font-size: 12px; font-weight: 700; color: var(--ink); }
.cm-desc { font-size: 10px; color: var(--ink-3); line-height: 1.3; }
.cm-item.active .cm-label { color: var(--primary-deep); }

/* Calculator Compare */
.calc-compare { display: flex; align-items: stretch; gap: 0; }
.cc-card { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; border-left: 3px solid var(--cc-accent, var(--primary)); }
.cc-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #F8FBFA; border-bottom: 1px solid var(--line-2); }
.cc-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; background: var(--info-soft); color: var(--info); padding: 2px 8px; border-radius: 4px; }
.cc-month { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.cc-body { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.cc-row { display: flex; justify-content: space-between; font-size: 12px; }
.cc-row span:first-child { color: var(--ink-3); }
.cc-divider { display: flex; align-items: center; justify-content: center; padding: 0 8px; flex: none; }

/* Notification Cards */
.notif-card { display: flex; align-items: flex-start; gap: 13px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; box-shadow: var(--shadow); transition: all .15s; }
.notif-card:last-child { margin-bottom: 0; }
.notif-card.unread { border-color: var(--primary); background: var(--primary-soft); }
.notif-card:hover { box-shadow: 0 3px 12px rgba(22,35,43,.08); }
.notif-card.unread:hover { border-color: var(--primary-mid); }
.nc-badge { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; flex: none; }
.nc-body { flex: 1; min-width: 0; }
.nc-title { font-size: 13.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.notif-card.unread .nc-title { font-weight: 700; }
.nc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex: none; }
.nc-msg { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nc-meta { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.nc-time { font-size: 10px; color: var(--ink-3); font-family: var(--mono); }
.nc-type { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); padding: 1px 6px; border-radius: 3px; background: var(--line-2); }
.nc-actions { display: flex; gap: 4px; align-items: center; flex: none; }

/* Product Cards */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; margin-bottom: 14px; }
.prod-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 18px; border-top: 3px solid var(--prod-accent, var(--primary)); transition: all .2s; display: flex; flex-direction: column; gap: 10px; }
.prod-card:hover { box-shadow: 0 6px 20px rgba(22,35,43,.1); transform: translateY(-2px); }
.pc-badge { display: flex; align-items: center; gap: 8px; }
.pc-badge span { font-size: 10px; font-weight: 700; font-family: var(--mono); padding: 2px 8px; border-radius: 4px; }
.pc-cat { font-size: 10px; color: var(--ink-3); font-weight: 600; }
.pc-name { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -.2px; line-height: 1.2; }
.pc-desc { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.pc-divider { height: 1px; background: var(--line-2); margin: 2px 0; }
.pc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.pcs-item { display: flex; flex-direction: column; gap: 1px; }
.pcs-label { font-size: 9.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.pcs-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pc-footer { display: flex; gap: 12px; flex-wrap: wrap; }
.pcf-item { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.pcf-label { font-size: 9.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.pcf-value { font-size: 12px; font-weight: 600; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-31 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .grid-2, .grid-3, .grid-31 { grid-template-columns: 1fr; } }

/* Alerts */
.alertbox { display: flex; gap: 10px; border-radius: var(--radius); padding: 11px 14px; font-size: 12px; margin-bottom: 12px; align-items: flex-start; line-height: 1.5; }
.alertbox.warn { background: var(--warn-soft); color: #6B4108; border: 1px solid #EAD3AC; }
.alertbox.info { background: var(--info-soft); color: #134B7C; border: 1px solid #BDD8EE; }
.alertbox.danger { background: var(--danger-soft); color: #7C221E; border: 1px solid #ECC6C4; }
.alertbox.ok { background: var(--ok-soft); color: #135633; border: 1px solid #BCE0CB; }

/* KV list */
.kv-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 12px; }
.kv-list dt { color: var(--ink-3); white-space: nowrap; }
.kv-list dd { font-weight: 600; }

/* Risk */
.risk-A { color: var(--ok); font-weight: 700; }
.risk-B { color: #4C8A2E; font-weight: 700; }
.risk-C { color: var(--warn); font-weight: 700; }
.risk-D { color: #C1541B; font-weight: 700; }
.risk-E { color: var(--danger); font-weight: 700; }

/* Pill */
.pill { display: inline-block; font-size: 10px; font-weight: 700; font-family: var(--mono); background: #EEF2F4; color: var(--ink-2); border-radius: 4px; padding: 2px 7px; }

/* Progress */
.progressbar { height: 7px; background: #E6EBEE; border-radius: 5px; overflow: hidden; min-width: 70px; }
.progressbar i { display: block; height: 100%; background: var(--primary); border-radius: 5px; }
.progressbar.warn i { background: var(--warn); }
.progressbar.danger i { background: var(--danger); }

/* Footer */
.appfooter { position: fixed; left: 262px; right: 0; bottom: 0; height: 28px; background: #FBFCFD; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 16px; font-size: 10.5px; color: var(--ink-3); z-index: 30; }
#app.nav-collapsed ~ .appfooter, #app.nav-collapsed .appfooter { left: 0; }
.appfooter .rt { font-family: var(--mono); color: var(--primary-deep); font-weight: 700; }
.appfooter .push { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.appfooter kbd { font-family: var(--mono); background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; font-size: 9px; box-shadow: 0 1px 0 var(--line); }

/* Pager */
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--ink-3); }
.pager strong { color: var(--ink); font-weight: 600; }
.pager .push { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.pager button { min-width: 26px; height: 26px; border: 1px solid var(--line); background: var(--card); border-radius: 5px; font-size: 11.5px; cursor: pointer; color: var(--ink-2); }
.pager button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }

/* Login page */
.login-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #0A4A3A 0%, #0E6E55 100%); }
.login-card { width: 400px; padding: 40px 36px; background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }

/* DB map */
.dbmap { border: 1px dashed #B9C6CD; background: #F7FAF9; border-radius: var(--radius); padding: 9px 14px; margin-top: 16px; font-size: 10.5px; color: var(--ink-3); }
.dbmap .dm-h { font-weight: 800; letter-spacing: .8px; text-transform: uppercase; font-size: 9.5px; color: var(--primary-deep); margin-bottom: 5px; }
.dbmap .dm-t { display: inline-block; font-family: var(--mono); font-size: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 2px 7px; margin: 2px 4px 2px 0; color: var(--ink-2); }

/* Responsive */
@media (max-width: 860px) {
    #app { grid-template-columns: 0 1fr; }
    #app.nav-open { grid-template-columns: 262px 1fr; }
    .content { padding: 12px 12px 60px; }
    .appfooter { left: 0; }
}

/* Link style */
.lnk { color: var(--info); font-weight: 600; cursor: pointer; text-decoration: none; }
.lnk:hover { text-decoration: underline; }

/* Loading Overlay */
#loadingOverlay { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(22,35,43,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
#loadingOverlay.active { opacity: 1; pointer-events: all; }
#loadingOverlay .spinner { position: relative; width: 48px; height: 48px; }
#loadingOverlay .spinner i { position: absolute; inset: 0; border: 3px solid transparent; border-radius: 50%; }
#loadingOverlay .spinner .s1 { border-top-color: var(--primary-mid); animation: spin .8s linear infinite; }
#loadingOverlay .spinner .s2 { inset: 5px; border-right-color: var(--gold); animation: spin .6s linear reverse infinite; }
#loadingOverlay .spinner .s3 { inset: 10px; border-bottom-color: #fff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#loadingOverlay .ldot { margin-top: 18px; display: flex; gap: 5px; }
#loadingOverlay .ldot span { width: 7px; height: 7px; border-radius: 50%; background: var(--primary-soft); animation: ldot 1.2s ease-in-out infinite; }
#loadingOverlay .ldot span:nth-child(2) { animation-delay: .15s; }
#loadingOverlay .ldot span:nth-child(3) { animation-delay: .3s; }
@keyframes ldot { 0%,80%,100% { transform: scale(.5); opacity: .3; } 40% { transform: scale(1); opacity: 1; } }
#loadingOverlay .ltext { margin-top: 12px; font-size: 12px; color: #DCEDE6; font-weight: 500; letter-spacing: .5px; }

/* Page transition */
#content { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
