/* ============ THEME TOKENS ============ */
:root{
  --font-display:'Plus Jakarta Sans',system-ui,sans-serif;
  --font-body:'Inter',system-ui,sans-serif;
  --accent:#6366f1; --accent-2:#22d3ee; --accent-3:#0ea5e9;
  --gold:#eab308; --emerald:#10b981; --rose:#f43f5e; --amber:#f59e0b; --violet:#8b5cf6;
  --radius:16px; --radius-sm:11px; --radius-lg:22px;
  --shadow-sm:0 1px 2px rgba(15,23,42,.06),0 1px 3px rgba(15,23,42,.08);
  --shadow:0 6px 24px rgba(15,23,42,.08);
  --shadow-lg:0 24px 60px rgba(15,23,42,.14);
  --sidebar-w:264px; --sidebar-collapsed:76px; --topbar-h:66px;
  --transition:.22s cubic-bezier(.4,0,.2,1);
}
/* LIGHT */
html[data-theme="light"]{
  --bg:#f4f6fb; --bg-2:#eef1f8; --surface:#ffffff; --surface-2:#f8fafc; --surface-3:#f1f5f9;
  --border:#e5e9f2; --border-strong:#d6dbe8;
  --text:#0f172a; --text-2:#475569; --text-3:#94a3b8;
  --glass:rgba(255,255,255,.72); --glass-border:rgba(255,255,255,.6);
  --sidebar-bg:#0b1120; --sidebar-text:#cbd5e1; --sidebar-text-dim:#64748b; --sidebar-active:rgba(99,102,241,.16);
  --chart-grid:rgba(15,23,42,.06);
}
/* DARK */
html[data-theme="dark"]{
  --bg:#070b16; --bg-2:#0b1120; --surface:#0f1626; --surface-2:#141d31; --surface-3:#1a2438;
  --border:#1e293b; --border-strong:#2a3a55;
  --text:#f1f5f9; --text-2:#94a3b8; --text-3:#64748b;
  --glass:rgba(15,22,38,.66); --glass-border:rgba(148,163,184,.12);
  --sidebar-bg:#080d19; --sidebar-text:#cbd5e1; --sidebar-text-dim:#5b6b85; --sidebar-active:rgba(99,102,241,.2);
  --chart-grid:rgba(148,163,184,.1);
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:var(--font-body);background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;line-height:1.5;overflow:hidden}
::-webkit-scrollbar{width:9px;height:9px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border-strong);border-radius:20px}
::-webkit-scrollbar-thumb:hover{background:var(--text-3)}
h1,h2,h3,h4,h5{font-family:var(--font-display);font-weight:700;letter-spacing:-.01em;color:var(--text)}
a{color:inherit;text-decoration:none}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
input,select,textarea{font-family:inherit;font-size:14px;color:var(--text)}
svg[data-lucide]{width:19px;height:19px;stroke-width:2}

/* ============ AUTH ============ */
#auth{position:fixed;inset:0;display:flex;z-index:100;background:var(--bg)}
.auth-visual{flex:1;position:relative;overflow:hidden;background:
   radial-gradient(1200px 600px at 20% 10%,rgba(99,102,241,.35),transparent 55%),
   radial-gradient(900px 500px at 90% 90%,rgba(34,211,238,.28),transparent 55%),
   linear-gradient(135deg,#0b1120,#0a1b2e 60%,#071225);display:none;flex-direction:column;justify-content:space-between;padding:54px}
@media(min-width:900px){.auth-visual{display:flex}}
.auth-visual::before{content:"";position:absolute;inset:0;background-image:linear-gradient(rgba(148,163,184,.06) 1px,transparent 1px),linear-gradient(90deg,rgba(148,163,184,.06) 1px,transparent 1px);background-size:44px 44px;mask-image:radial-gradient(circle at 50% 40%,#000,transparent 75%)}
.auth-visual>*{position:relative;z-index:1}
.auth-brand{display:flex;align-items:center;gap:13px;color:#fff}
.auth-hero h1{color:#fff;font-size:42px;line-height:1.1;margin-bottom:18px}
.auth-hero p{color:#aab6cf;font-size:16px;max-width:430px}
.auth-badges{display:flex;gap:10px;flex-wrap:wrap;margin-top:28px}
.auth-badge{display:flex;align-items:center;gap:8px;padding:9px 14px;border:1px solid rgba(148,163,184,.2);border-radius:30px;color:#cbd5e1;font-size:12.5px;background:rgba(255,255,255,.03);backdrop-filter:blur(8px)}
.auth-stat-row{display:flex;gap:30px;color:#fff}
.auth-stat b{font-family:var(--font-display);font-size:26px;display:block}
.auth-stat span{color:#8ea0bd;font-size:12.5px}
.auth-form-wrap{width:100%;max-width:480px;display:flex;align-items:center;justify-content:center;padding:28px}
.auth-card{width:100%;max-width:400px}
.auth-card .logo-lg{display:flex;align-items:center;gap:12px;margin-bottom:30px}
.auth-card h2{font-size:26px;margin-bottom:6px}
.auth-card .sub{color:var(--text-2);font-size:14px;margin-bottom:26px}
.field{margin-bottom:16px}
.field label{display:block;font-size:12.5px;font-weight:600;color:var(--text-2);margin-bottom:7px}
.input{width:100%;height:46px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 14px;transition:var(--transition);outline:none}
.input:focus{border-color:var(--accent);box-shadow:0 0 0 4px rgba(99,102,241,.14)}
textarea.input{height:auto;padding:12px 14px;min-height:88px;resize:vertical}
.input-group{position:relative}
.input-group .eye{position:absolute;right:12px;top:50%;transform:translateY(-50%);color:var(--text-3);cursor:pointer}
.row-between{display:flex;align-items:center;justify-content:space-between}
.checkbox{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text-2);cursor:pointer;user-select:none}
.link{color:var(--accent);font-size:13px;font-weight:600}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 18px;border-radius:var(--radius-sm);font-weight:600;font-size:14px;transition:var(--transition);white-space:nowrap}
.btn svg{width:17px;height:17px}
.btn-primary{background:linear-gradient(135deg,var(--accent),var(--accent-3));color:#fff;box-shadow:0 8px 20px rgba(99,102,241,.3)}
.btn-primary:hover{filter:brightness(1.08);transform:translateY(-1px)}
.btn-block{width:100%}
.btn-ghost{background:var(--surface-2);border:1px solid var(--border);color:var(--text)}
.btn-ghost:hover{background:var(--surface-3)}
.btn-sm{height:36px;padding:0 13px;font-size:13px;border-radius:9px}
.btn-icon{width:40px;height:40px;padding:0;border-radius:11px}
.role-pick{display:flex;gap:10px;margin:22px 0 4px}
.role-opt{flex:1;border:1.5px solid var(--border);border-radius:var(--radius-sm);padding:13px;cursor:pointer;transition:var(--transition);text-align:center}
.role-opt.active{border-color:var(--accent);background:rgba(99,102,241,.08)}
.role-opt .ic{width:38px;height:38px;border-radius:11px;display:flex;align-items:center;justify-content:center;margin:0 auto 9px;background:var(--surface-3);color:var(--accent)}
.role-opt b{font-size:13.5px;display:block}
.role-opt span{font-size:11px;color:var(--text-3)}
.auth-note{margin-top:20px;padding:11px 13px;background:rgba(234,179,8,.08);border:1px solid rgba(234,179,8,.22);border-radius:11px;font-size:12px;color:var(--text-2);display:flex;gap:9px}
.auth-note svg{color:var(--gold);flex-shrink:0;width:16px;height:16px;margin-top:1px}

/* ============ APP SHELL ============ */
#app{display:none;height:100vh}
.shell{display:flex;height:100vh}
/* Sidebar */
.sidebar{width:var(--sidebar-w);flex-shrink:0;background:var(--sidebar-bg);display:flex;flex-direction:column;transition:width var(--transition);position:relative;z-index:40}
.sidebar.collapsed{width:var(--sidebar-collapsed)}
.sb-head{height:var(--topbar-h);display:flex;align-items:center;gap:11px;padding:0 20px;flex-shrink:0;border-bottom:1px solid rgba(148,163,184,.08)}
.logo-mark{width:38px;height:38px;border-radius:11px;background:linear-gradient(135deg,var(--accent),var(--accent-2));display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 6px 16px rgba(99,102,241,.4);position:relative}
.logo-mark svg{color:#fff;width:21px;height:21px}
.logo-txt{display:flex;flex-direction:column;line-height:1.15;overflow:hidden;white-space:nowrap}
.logo-txt b{font-family:var(--font-display);font-size:16px;color:#fff;font-weight:800}
.logo-txt span{font-size:10px;color:#8ea0bd;letter-spacing:.14em;text-transform:uppercase}
.sidebar.collapsed .logo-txt{display:none}
.sb-nav{flex:1;overflow-y:auto;padding:14px 12px;overflow-x:hidden}
.sb-nav::-webkit-scrollbar{width:5px}
.nav-group-label{font-size:10px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--sidebar-text-dim);padding:16px 12px 7px}
.sidebar.collapsed .nav-group-label{opacity:0;height:14px;padding:6px 0}
.nav-item{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:11px;color:var(--sidebar-text);font-size:13.5px;font-weight:500;cursor:pointer;transition:var(--transition);margin-bottom:2px;position:relative;white-space:nowrap}
.nav-item:hover{background:rgba(148,163,184,.08);color:#fff}
.nav-item.active{background:var(--sidebar-active);color:#fff;font-weight:600}
.nav-item.active::before{content:"";position:absolute;left:-12px;top:50%;transform:translateY(-50%);width:3px;height:20px;background:var(--accent);border-radius:0 3px 3px 0}
.nav-item svg{flex-shrink:0;width:18px;height:18px}
.nav-item .nav-badge{margin-left:auto;background:var(--rose);color:#fff;font-size:10px;font-weight:700;padding:1px 7px;border-radius:20px}
.sidebar.collapsed .nav-item{justify-content:center;padding:11px}
.sidebar.collapsed .nav-item span,.sidebar.collapsed .nav-item .nav-badge{display:none}
.sb-foot{padding:12px;border-top:1px solid rgba(148,163,184,.08);flex-shrink:0}
.sb-user{display:flex;align-items:center;gap:11px;padding:8px;border-radius:11px;cursor:pointer;transition:var(--transition)}
.sb-user:hover{background:rgba(148,163,184,.08)}
.avatar{width:36px;height:36px;border-radius:10px;background:linear-gradient(135deg,var(--violet),var(--accent));display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:13px;flex-shrink:0;font-family:var(--font-display)}
.sb-user .u-info{overflow:hidden;white-space:nowrap}
.sb-user .u-info b{font-size:13px;color:#fff;display:block;font-weight:600}
.sb-user .u-info span{font-size:11px;color:#8ea0bd}
.sidebar.collapsed .sb-user .u-info,.sidebar.collapsed .sb-user .chev{display:none}

/* Main */
.main{flex:1;display:flex;flex-direction:column;min-width:0}
.topbar{height:var(--topbar-h);flex-shrink:0;display:flex;align-items:center;gap:14px;padding:0 24px;background:var(--glass);backdrop-filter:blur(16px);border-bottom:1px solid var(--border);position:relative;z-index:30}
.hamburger{color:var(--text-2)}
.search-global{flex:1;max-width:440px;position:relative}
.search-global svg{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--text-3);width:17px;height:17px}
.search-global input{width:100%;height:42px;background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:0 14px 0 40px;outline:none;transition:var(--transition)}
.search-global input:focus{border-color:var(--accent);box-shadow:0 0 0 4px rgba(99,102,241,.1)}
.search-global .kbd{position:absolute;right:11px;top:50%;transform:translateY(-50%);font-size:11px;color:var(--text-3);border:1px solid var(--border);border-radius:6px;padding:2px 7px;background:var(--surface)}
.topbar-right{margin-left:auto;display:flex;align-items:center;gap:9px}
.icon-btn{width:40px;height:40px;border-radius:11px;display:flex;align-items:center;justify-content:center;color:var(--text-2);transition:var(--transition);position:relative;border:1px solid transparent}
.icon-btn:hover{background:var(--surface-2);color:var(--text);border-color:var(--border)}
.icon-btn .dot{position:absolute;top:9px;right:10px;width:8px;height:8px;background:var(--rose);border-radius:50%;border:2px solid var(--glass)}
.role-switch{display:flex;background:var(--surface-2);border:1px solid var(--border);border-radius:11px;padding:3px;gap:2px}
.role-switch button{padding:7px 13px;border-radius:8px;font-size:12.5px;font-weight:600;color:var(--text-2);transition:var(--transition);display:flex;align-items:center;gap:6px}
.role-switch button svg{width:15px;height:15px}
.role-switch button.active{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}
html[data-theme="dark"] .role-switch button.active{background:var(--accent);color:#fff}

/* Content */
.content{flex:1;overflow-y:auto;padding:26px 28px 60px}
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:22px;flex-wrap:wrap}
.page-head .pt h1{font-size:25px;margin-bottom:5px}
.page-head .pt p{color:var(--text-2);font-size:13.5px;max-width:580px}
.breadcrumb{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--text-3);margin-bottom:10px}
.breadcrumb svg{width:13px;height:13px}
.head-actions{display:flex;gap:9px;flex-wrap:wrap}

.demo-ribbon{display:inline-flex;align-items:center;gap:7px;background:rgba(234,179,8,.1);border:1px solid rgba(234,179,8,.25);color:var(--gold);font-size:11.5px;font-weight:600;padding:5px 11px;border-radius:20px;margin-bottom:16px}
.demo-ribbon svg{width:14px;height:14px}

/* Cards / bento */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);transition:var(--transition)}
.card-pad{padding:20px}
.bento{display:grid;grid-template-columns:repeat(12,1fr);gap:16px}
.stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px 19px;box-shadow:var(--shadow-sm);transition:var(--transition);position:relative;overflow:hidden}
.stat:hover{box-shadow:var(--shadow);transform:translateY(-2px);border-color:var(--border-strong)}
.stat .stat-ic{width:40px;height:40px;border-radius:11px;display:flex;align-items:center;justify-content:center;margin-bottom:14px}
.stat .stat-ic svg{width:20px;height:20px}
.stat .lbl{font-size:12.5px;color:var(--text-2);font-weight:500;margin-bottom:6px}
.stat .val{font-family:var(--font-display);font-size:26px;font-weight:800;letter-spacing:-.02em;line-height:1}
.stat .delta{display:inline-flex;align-items:center;gap:3px;font-size:11.5px;font-weight:600;margin-top:9px;padding:2px 7px;border-radius:20px}
.stat .delta svg{width:12px;height:12px}
.delta.up{color:var(--emerald);background:rgba(16,185,129,.1)}
.delta.down{color:var(--rose);background:rgba(244,63,94,.1)}
.delta.flat{color:var(--text-3);background:var(--surface-3)}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px}
.card-head h3{font-size:15px}
.card-head .ch-sub{font-size:12px;color:var(--text-3);margin-top:2px}
.chart-box{position:relative;width:100%}

/* Badges */
.badge{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;padding:3px 10px;border-radius:20px;white-space:nowrap;border:1px solid transparent}
.badge svg{width:12px;height:12px}
.badge.green{color:var(--emerald);background:rgba(16,185,129,.12);border-color:rgba(16,185,129,.2)}
.badge.amber{color:var(--amber);background:rgba(245,158,11,.12);border-color:rgba(245,158,11,.2)}
.badge.red{color:var(--rose);background:rgba(244,63,94,.12);border-color:rgba(244,63,94,.2)}
.badge.blue{color:var(--accent-3);background:rgba(14,165,233,.12);border-color:rgba(14,165,233,.2)}
.badge.indigo{color:var(--accent);background:rgba(99,102,241,.12);border-color:rgba(99,102,241,.2)}
.badge.violet{color:var(--violet);background:rgba(139,92,246,.12);border-color:rgba(139,92,246,.2)}
.badge.gold{color:var(--gold);background:rgba(234,179,8,.12);border-color:rgba(234,179,8,.2)}
.badge.gray{color:var(--text-2);background:var(--surface-3);border-color:var(--border)}

/* Table */
.toolbar{display:flex;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap}
.toolbar .search{position:relative;flex:1;min-width:200px;max-width:320px}
.toolbar .search svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--text-3);width:16px;height:16px}
.toolbar .search input{width:100%;height:40px;background:var(--surface);border:1px solid var(--border);border-radius:11px;padding:0 12px 0 37px;outline:none;transition:var(--transition)}
.toolbar .search input:focus{border-color:var(--accent)}
.select{height:40px;background:var(--surface);border:1px solid var(--border);border-radius:11px;padding:0 32px 0 13px;outline:none;cursor:pointer;font-weight:500;color:var(--text);appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center}
.table-wrap{overflow-x:auto;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface)}
table{width:100%;border-collapse:collapse;font-size:13px}
thead th{text-align:left;padding:13px 16px;font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--text-3);background:var(--surface-2);border-bottom:1px solid var(--border);white-space:nowrap;position:sticky;top:0}
thead th.sortable{cursor:pointer;user-select:none}
thead th.sortable:hover{color:var(--text)}
thead th .th-in{display:inline-flex;align-items:center;gap:5px}
tbody td{padding:13px 16px;border-bottom:1px solid var(--border);color:var(--text-2);vertical-align:middle;white-space:nowrap}
tbody tr{transition:background .15s}
tbody tr:hover{background:var(--surface-2)}
tbody tr:last-child td{border-bottom:none}
.cell-primary{color:var(--text);font-weight:600}
.cell-main{display:flex;align-items:center;gap:11px}
.co-logo{width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:12px;flex-shrink:0;font-family:var(--font-display)}
.cell-sub{font-size:11.5px;color:var(--text-3);font-weight:400}
.row-actions{display:flex;gap:4px}
.row-actions .icon-btn{width:32px;height:32px;border-radius:9px}
.row-actions .icon-btn svg{width:16px;height:16px}
.pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;flex-wrap:wrap}
.pagination .pinfo{font-size:12.5px;color:var(--text-3)}
.pager{display:flex;gap:4px}
.pager button{min-width:34px;height:34px;border-radius:9px;border:1px solid var(--border);background:var(--surface);font-size:13px;font-weight:600;color:var(--text-2);transition:var(--transition)}
.pager button:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}
.pager button.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.pager button:disabled{opacity:.4;cursor:not-allowed}

/* Kanban */
.kanban{display:flex;gap:14px;overflow-x:auto;padding-bottom:12px}
.kcol{min-width:272px;width:272px;flex-shrink:0;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);display:flex;flex-direction:column;max-height:70vh}
.kcol-head{padding:13px 15px;display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--surface-2);border-radius:var(--radius) var(--radius) 0 0}
.kcol-head .kdot{width:9px;height:9px;border-radius:50%;flex-shrink:0}
.kcol-head b{font-size:12.5px;font-weight:700}
.kcol-head .kcount{margin-left:auto;background:var(--surface);border:1px solid var(--border);font-size:11px;font-weight:700;color:var(--text-2);padding:1px 8px;border-radius:20px}
.kcol-body{padding:10px;overflow-y:auto;display:flex;flex-direction:column;gap:9px;flex:1}
.kcard{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:13px;cursor:grab;transition:var(--transition);box-shadow:var(--shadow-sm)}
.kcard:hover{border-color:var(--accent);box-shadow:var(--shadow)}
.kcard.dragging{opacity:.4}
.kcard .kc-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.kcard b{font-size:13px;font-weight:600;color:var(--text)}
.kcard .kc-amt{font-family:var(--font-display);font-size:15px;font-weight:700;color:var(--text);margin:6px 0}
.kcard .kc-meta{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--text-3);margin-top:8px}
.kcol.drop-hint{outline:2px dashed var(--accent);outline-offset:-2px}

/* Drawer */
.overlay{position:fixed;inset:0;background:rgba(7,11,22,.6);backdrop-filter:blur(3px);z-index:80;opacity:0;pointer-events:none;transition:opacity .25s}
.overlay.show{opacity:1;pointer-events:auto}
.drawer{position:fixed;top:0;right:0;height:100vh;width:min(540px,100%);background:var(--surface);border-left:1px solid var(--border);z-index:90;transform:translateX(100%);transition:transform .32s cubic-bezier(.4,0,.2,1);display:flex;flex-direction:column;box-shadow:var(--shadow-lg)}
.drawer.show{transform:translateX(0)}
.drawer-head{padding:20px 22px;border-bottom:1px solid var(--border);display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.drawer-body{flex:1;overflow-y:auto;padding:22px}
.drawer-foot{padding:16px 22px;border-top:1px solid var(--border);display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.modal{position:fixed;top:50%;left:50%;transform:translate(-50%,-48%) scale(.97);width:min(520px,94%);max-height:90vh;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);z-index:90;opacity:0;pointer-events:none;transition:var(--transition);display:flex;flex-direction:column;box-shadow:var(--shadow-lg)}
.modal.show{opacity:1;pointer-events:auto;transform:translate(-50%,-50%) scale(1)}
.modal-head{padding:20px 22px 0;display:flex;align-items:flex-start;justify-content:space-between}
.modal-body{padding:18px 22px;overflow-y:auto}
.modal-foot{padding:14px 22px 20px;display:flex;gap:10px;justify-content:flex-end}
.modal.confirm{width:min(420px,92%)}
.confirm-ic{width:52px;height:52px;border-radius:14px;display:flex;align-items:center;justify-content:center;margin-bottom:14px}

/* Detail bits */
.kv{display:grid;grid-template-columns:1fr 1fr;gap:14px 18px;margin:4px 0 18px}
.kv .k{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-3);font-weight:600;margin-bottom:3px}
.kv .v{font-size:13.5px;color:var(--text);font-weight:500}
.section-label{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-3);font-weight:700;margin:20px 0 11px;display:flex;align-items:center;gap:8px}
.section-label::after{content:"";flex:1;height:1px;background:var(--border)}
.profile-hero{display:flex;align-items:center;gap:15px;margin-bottom:6px}
.profile-hero .co-logo{width:58px;height:58px;border-radius:15px;font-size:20px}
.profile-hero h2{font-size:21px}
.timeline{position:relative;padding-left:26px}
.timeline::before{content:"";position:absolute;left:8px;top:4px;bottom:4px;width:2px;background:var(--border)}
.tl-item{position:relative;padding-bottom:18px}
.tl-item::before{content:"";position:absolute;left:-22px;top:3px;width:12px;height:12px;border-radius:50%;background:var(--surface);border:2.5px solid var(--accent)}
.tl-item.done::before{background:var(--accent)}
.tl-item b{font-size:13px;display:block}
.tl-item span{font-size:11.5px;color:var(--text-3)}

/* Toast */
#toasts{position:fixed;bottom:24px;right:24px;z-index:120;display:flex;flex-direction:column;gap:10px;max-width:360px}
.toast{display:flex;align-items:flex-start;gap:11px;background:var(--surface);border:1px solid var(--border);border-left:3px solid var(--accent);border-radius:12px;padding:13px 15px;box-shadow:var(--shadow-lg);animation:slideIn .3s cubic-bezier(.4,0,.2,1);min-width:280px}
.toast.success{border-left-color:var(--emerald)}
.toast.error{border-left-color:var(--rose)}
.toast.warn{border-left-color:var(--amber)}
.toast .t-ic{width:20px;height:20px;flex-shrink:0;margin-top:1px}
.toast.success .t-ic{color:var(--emerald)}.toast.error .t-ic{color:var(--rose)}.toast.warn .t-ic{color:var(--amber)}.toast.info .t-ic{color:var(--accent)}
.toast b{font-size:13px;display:block;margin-bottom:2px}
.toast p{font-size:12px;color:var(--text-2)}
@keyframes slideIn{from{transform:translateX(120%);opacity:0}to{transform:translateX(0);opacity:1}}

/* Notif panel */
.popover{position:absolute;top:calc(100% + 10px);right:0;width:360px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);z-index:50;overflow:hidden;opacity:0;pointer-events:none;transform:translateY(-8px);transition:var(--transition)}
.popover.show{opacity:1;pointer-events:auto;transform:translateY(0)}
.pop-head{padding:14px 16px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
.pop-head b{font-size:14px}
.pop-list{max-height:380px;overflow-y:auto}
.notif{display:flex;gap:11px;padding:13px 16px;border-bottom:1px solid var(--border);cursor:pointer;transition:background .15s}
.notif:hover{background:var(--surface-2)}
.notif.unread{background:rgba(99,102,241,.04)}
.notif .n-ic{width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.notif .n-ic svg{width:17px;height:17px}
.notif p{font-size:12.5px;color:var(--text);line-height:1.4}
.notif span{font-size:11px;color:var(--text-3);margin-top:3px;display:block}

/* Misc layout */
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.flex{display:flex}.items-center{align-items:center}.gap{gap:10px}.wrap{flex-wrap:wrap}
.mt{margin-top:16px}.mb{margin-bottom:16px}
.empty{text-align:center;padding:50px 20px;color:var(--text-3)}
.empty .e-ic{width:66px;height:66px;border-radius:18px;background:var(--surface-2);display:flex;align-items:center;justify-content:center;margin:0 auto 16px}
.empty .e-ic svg{width:30px;height:30px;color:var(--text-3)}
.empty h4{font-size:15px;color:var(--text-2);margin-bottom:6px}
.empty p{font-size:13px;max-width:340px;margin:0 auto}
.skel{background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface-3) 50%,var(--surface-2) 75%);background-size:200% 100%;animation:shimmer 1.4s infinite;border-radius:8px}
@keyframes shimmer{to{background-position:-200% 0}}
.progress{height:7px;background:var(--surface-3);border-radius:20px;overflow:hidden}
.progress .bar{height:100%;border-radius:20px;background:linear-gradient(90deg,var(--accent),var(--accent-2));transition:width .6s}
.score-ring{position:relative;width:52px;height:52px;flex-shrink:0}
.mono{font-variant-numeric:tabular-nums}
.scaffold-feats{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px;margin-top:8px}
.feat{display:flex;gap:11px;padding:15px;background:var(--surface);border:1px solid var(--border);border-radius:13px;transition:var(--transition)}
.feat:hover{border-color:var(--border-strong);box-shadow:var(--shadow-sm)}
.feat .f-ic{width:38px;height:38px;border-radius:10px;background:rgba(99,102,241,.1);color:var(--accent);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.feat .f-ic svg{width:18px;height:18px}
.feat b{font-size:13.5px;display:block;margin-bottom:3px}
.feat p{font-size:12px;color:var(--text-3);line-height:1.4}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--border);margin-bottom:18px;overflow-x:auto}
.tab{padding:10px 15px;font-size:13.5px;font-weight:600;color:var(--text-2);cursor:pointer;border-bottom:2px solid transparent;transition:var(--transition);white-space:nowrap}
.tab:hover{color:var(--text)}
.tab.active{color:var(--accent);border-bottom-color:var(--accent)}
.list-row{display:flex;align-items:center;gap:13px;padding:13px 0;border-bottom:1px solid var(--border)}
.list-row:last-child{border-bottom:none}
.switch{width:40px;height:23px;border-radius:20px;background:var(--surface-3);border:1px solid var(--border);position:relative;cursor:pointer;transition:var(--transition);flex-shrink:0}
.switch::after{content:"";position:absolute;top:2px;left:2px;width:17px;height:17px;border-radius:50%;background:#fff;transition:var(--transition);box-shadow:var(--shadow-sm)}
.switch.on{background:var(--accent);border-color:var(--accent)}
.switch.on::after{left:19px}
.chip{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:500;padding:5px 11px;border-radius:20px;background:var(--surface-2);border:1px solid var(--border);color:var(--text-2)}
@media(max-width:1100px){.grid-3{grid-template-columns:1fr 1fr}}
@media(max-width:860px){
  .sidebar{position:fixed;left:0;top:0;transform:translateX(-100%);box-shadow:var(--shadow-lg)}
  .sidebar.mobile-open{transform:translateX(0)}
  .grid-2,.grid-3{grid-template-columns:1fr}
  .search-global{display:none}
  .content{padding:18px 16px 50px}
}
.mobile-scrim{position:fixed;inset:0;background:rgba(7,11,22,.5);z-index:39;display:none}
.mobile-scrim.show{display:block}
@media(max-width:860px){.mobile-scrim.show{display:block}}
@media(min-width:861px){.mobile-scrim{display:none!important}}

/* =================================================================
   Laravel build additions (server-driven tables, forms, search, auth)
   ================================================================= */
#app{display:block}
.btn:disabled,.btn.busy{opacity:.6;pointer-events:none}
.btn.busy::after{content:"";width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.btn-danger{background:var(--rose);color:#fff}.btn-danger:hover{filter:brightness(1.08)}
.btn-ok{background:var(--emerald);color:#fff}
.field .err{color:var(--rose);font-size:12px;margin-top:5px;display:block}
.input.invalid{border-color:var(--rose)}
select.input{appearance:auto;padding-right:10px}
.hint{font-size:12px;color:var(--text-3);margin-top:5px}
.stat.clickable{cursor:pointer}.stat.clickable:hover{border-color:var(--accent)}
.stat.active-filter{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.table-loading td{opacity:.45}
.toolbar .search input{min-width:200px}
.search-global{position:relative}
.search-results{position:absolute;top:calc(100% + 8px);left:0;right:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);z-index:60;max-height:420px;overflow:auto;display:none}
.search-results.show{display:block}
.search-results .sr-group{padding:8px 14px 4px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--text-3);font-weight:700}
.search-results .sr-item{display:flex;gap:10px;align-items:center;padding:9px 14px;cursor:pointer;font-size:13px}
.search-results .sr-item:hover,.search-results .sr-item.hl{background:var(--surface-2)}
.search-results .sr-item svg{width:16px;height:16px;color:var(--text-3);flex-shrink:0}
.search-results .sr-item small{display:block;color:var(--text-3);font-size:11.5px}
.notif{cursor:pointer}
.notif p b{color:var(--text)}
.secret-box{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;letter-spacing:.08em;background:var(--surface-2);border:1px dashed var(--border-strong);border-radius:10px;padding:10px 12px;word-break:break-all;margin:10px 0;user-select:all}
.qr-box{display:flex;justify-content:center;margin:12px 0}
.qr-box canvas,.qr-box img{background:#fff;padding:10px;border-radius:12px}
.otp-row{display:flex;gap:8px;justify-content:center;margin:6px 0 14px}
.otp-row .otp{width:46px;height:54px;text-align:center;font-size:20px;font-weight:700;padding:0}
.auth-err{color:var(--rose);font-size:13px;min-height:18px;margin-top:12px}
.demo-creds{margin-top:18px;padding:11px 13px;background:rgba(99,102,241,.07);border:1px solid rgba(99,102,241,.2);border-radius:11px;font-size:12px;color:var(--text-2);line-height:1.55}
.demo-creds code{font-family:ui-monospace,monospace;color:var(--text)}
.perm-grid{width:100%;border-collapse:collapse}
.perm-grid th,.perm-grid td{padding:8px 6px;text-align:center;font-size:12.5px;border-bottom:1px solid var(--border)}
.perm-grid td:first-child,.perm-grid th:first-child{text-align:left}
.perm-grid input{width:16px;height:16px;accent-color:var(--accent);cursor:pointer}
.perm-grid .na{color:var(--text-3)}
.cov{display:inline-flex;min-width:46px;justify-content:center;font-size:11.5px;font-weight:700;padding:4px 8px;border-radius:8px;cursor:pointer;background:var(--surface-3);color:var(--text-3)}
.cov.full{background:rgba(16,185,129,.14);color:var(--emerald)}.cov.part{background:rgba(99,102,241,.12);color:var(--accent)}
.diff{font-family:ui-monospace,monospace;font-size:12px;background:var(--surface-2);border-radius:10px;padding:10px 12px;white-space:pre-wrap;word-break:break-word;max-height:260px;overflow:auto}
.msg{display:flex;gap:10px;margin-bottom:12px}.msg.agent{flex-direction:row-reverse}
.msg .bubble{padding:12px;flex:1;border-radius:12px;background:var(--surface-2);border:1px solid var(--border)}
.msg.agent .bubble{background:rgba(99,102,241,.08)}.msg.note .bubble{background:rgba(234,179,8,.08);border-style:dashed}
.msg .meta{font-size:11px;color:var(--text-3);margin-bottom:4px}
.msg .body{font-size:13px;white-space:pre-wrap}
.kcard[draggable=true]{cursor:grab}
.kcol.drop-hint{outline:2px dashed var(--accent);outline-offset:-4px}
.pager-mini{display:flex;justify-content:center;gap:8px;margin-top:16px}
.seg{display:inline-flex;background:var(--surface-2);border:1px solid var(--border);border-radius:11px;padding:3px}
.seg button{padding:7px 12px;border-radius:8px;font-size:12.5px;font-weight:600;color:var(--text-2);display:inline-flex;gap:6px;align-items:center}
.seg button.active{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}
.seg button svg{width:15px;height:15px}
.live-row{display:flex;gap:12px;align-items:flex-start;padding:12px 0;border-bottom:1px solid var(--border)}
.live-row.new{animation:flash 1.6s ease}
@keyframes flash{from{background:rgba(99,102,241,.14)}to{background:transparent}}
.check-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--border);font-size:13px;cursor:pointer}
.check-row input{width:17px;height:17px;accent-color:var(--emerald)}
.check-row.locked{cursor:default;opacity:.85}
.note-card{border-left:3px solid var(--accent);background:rgba(99,102,241,.05)}
.inline-form{display:flex;gap:8px;align-items:flex-end}
.inline-form .field{flex:1;margin:0}
.sb-foot{display:flex;align-items:center;gap:6px}
.sb-foot .sb-user{flex:1;min-width:0}
.sidebar.collapsed .sb-logout{display:none}
.env-pill{font-size:10.5px;font-weight:700;letter-spacing:.06em;padding:4px 9px;border-radius:20px;background:rgba(245,158,11,.14);color:var(--amber);text-transform:uppercase}
@media(max-width:700px){.search-global{display:none}}
.stat-ic{width:40px;height:40px;border-radius:11px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.stat-ic svg{width:20px;height:20px}
