:root{
  --bg:#0c0b14;
  --bg-2:#11101b;
  --panel:#181624;
  --panel-2:#1e1b2c;
  --panel-3:#242037;
  --border:#2c2740;
  --border-soft:#241f35;
  --text:#f7f4ff;
  --muted:#a9a3b7;
  --muted-2:#777185;
  --magenta:#ec3dff;
  --magenta-2:#b92cff;
  --purple:#9a6cff;
  --cyan:#24d9ff;
  --green:#22c997;
  --red:#ff647c;
  --yellow:#f6c95f;
  --blue:#4d8dff;
  --orange:#ff9f43;
  --shadow:0 18px 45px rgba(0,0,0,.24);
  --radius:18px;
  --sidebar:270px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:radial-gradient(circle at top right,rgba(184,44,255,.09),transparent 28%),linear-gradient(180deg,#0b0a12 0%,#0f0d18 100%);color:var(--text);font-family:Inter,Segoe UI,Arial,sans-serif;min-height:100vh}
button,input,select{font:inherit}
button{cursor:pointer}
.app-shell{display:flex;min-height:100vh}
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar);background:rgba(14,12,23,.96);border-right:1px solid var(--border-soft);backdrop-filter:blur(16px);z-index:50;display:flex;flex-direction:column;transition:transform .28s ease}
.brand-block{display:flex;align-items:center;gap:12px;padding:20px 18px;border-bottom:1px solid var(--border-soft)}
.brand-logo-wrap{width:46px;height:46px;border-radius:14px;background:linear-gradient(145deg,var(--magenta-2),#6d28d9);padding:7px;display:grid;place-items:center;box-shadow:0 0 28px rgba(236,61,255,.23)}
.brand-logo{width:100%;height:100%;object-fit:contain;filter:brightness(0) invert(1)}
.brand-title{font-weight:800;font-size:14px;line-height:1.25}.brand-subtitle{font-size:10px;color:var(--muted);margin-top:4px}
.nav-list{padding:14px 10px 20px;overflow:auto;display:flex;flex-direction:column;gap:5px}
.nav-item{border:0;background:transparent;color:#c8c2d5;display:flex;align-items:center;gap:11px;padding:11px 12px;border-radius:12px;text-align:left;transition:.2s ease;font-size:13px}
.nav-item svg{width:18px;height:18px}.nav-item:hover{background:#1b1728;color:#fff;transform:translateX(2px)}
.nav-item.active{background:linear-gradient(90deg,rgba(236,61,255,.18),rgba(154,108,255,.08));color:#fff;box-shadow:inset 2px 0 0 var(--magenta)}
.sidebar-footer{margin-top:auto;padding:14px 16px 18px;border-top:1px solid var(--border-soft)}
.source-pill{display:flex;align-items:center;gap:8px;color:#d9d3e5;font-size:12px}.pulse-dot{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 0 0 rgba(34,201,151,.5);animation:pulse 2s infinite}.tiny{font-size:10px;color:var(--muted-2);margin-top:6px;line-height:1.4}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(34,201,151,.45)}70%{box-shadow:0 0 0 8px rgba(34,201,151,0)}100%{box-shadow:0 0 0 0 rgba(34,201,151,0)}}
.main-panel{margin-left:var(--sidebar);width:calc(100% - var(--sidebar));min-height:100vh}
.topbar{position:sticky;top:0;z-index:35;display:flex;justify-content:space-between;align-items:center;gap:18px;padding:18px 24px;background:rgba(12,11,20,.88);backdrop-filter:blur(18px);border-bottom:1px solid var(--border-soft)}
.topbar h1{font-size:21px;margin:0 0 5px;font-weight:800}.topbar p{margin:0;color:var(--muted);font-size:12px}.topbar-left{display:flex;align-items:center;gap:10px}.topbar-actions{display:flex;align-items:center;gap:10px}.last-updated{display:flex;flex-direction:column;gap:2px;font-size:11px;padding:0 8px}.last-updated strong{font-size:12px}.muted{color:var(--muted)}
.icon-btn,.action-btn,.reset-btn{border:1px solid var(--border);color:#f7f3ff;background:#171421;border-radius:11px;display:inline-flex;align-items:center;gap:8px;justify-content:center;transition:.2s ease}.action-btn{padding:10px 13px;font-size:12px}.action-btn svg,.icon-btn svg,.reset-btn svg{width:16px;height:16px}.action-btn:hover,.icon-btn:hover,.reset-btn:hover{transform:translateY(-1px);border-color:#4b3b67}.action-btn.primary{background:linear-gradient(135deg,#a92df4,var(--magenta));border-color:transparent;box-shadow:0 9px 28px rgba(236,61,255,.18)}.action-btn.ghost{background:#171421}.icon-btn{width:38px;height:38px}.mobile-only{display:none}
.export-menu-wrap{position:relative}.export-menu{position:absolute;right:0;top:46px;width:220px;padding:8px;background:#181523;border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow);display:none;z-index:80}.export-menu.open{display:block;animation:fadeUp .16s ease}.export-menu button{width:100%;border:0;background:transparent;color:#e9e4f2;padding:10px;border-radius:9px;display:flex;align-items:center;gap:9px;text-align:left;font-size:12px}.export-menu button:hover{background:#242034}.export-menu svg{width:16px;height:16px}.menu-sep{height:1px;background:var(--border);margin:5px 0}
@keyframes fadeUp{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
.filter-panel{margin:18px 24px 0;padding:15px;background:linear-gradient(180deg,rgba(29,25,43,.95),rgba(20,18,31,.95));border:1px solid var(--border);border-radius:16px;box-shadow:0 12px 30px rgba(0,0,0,.16)}
.filter-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}.filter-title{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:800}.filter-title svg{width:16px}.quick-dates{display:flex;gap:6px;flex-wrap:wrap}.quick-dates button{border:1px solid var(--border);background:#14111d;color:var(--muted);padding:6px 9px;border-radius:9px;font-size:10px}.quick-dates button:hover,.quick-dates button.active{color:#fff;border-color:#773899;background:rgba(236,61,255,.12)}
.filter-grid{display:grid;grid-template-columns:repeat(6,minmax(120px,1fr));gap:10px;align-items:end}.filter-grid label,.line-profile-toolbar label,.calendar-toolbar label{display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:10px;font-weight:700}.filter-grid input,.filter-grid select,.line-profile-toolbar select,.calendar-toolbar input{width:100%;background:#11101a;color:#f7f4ff;border:1px solid var(--border);border-radius:10px;padding:9px 10px;outline:none}.filter-grid input:focus,.filter-grid select:focus,.line-profile-toolbar select:focus,.calendar-toolbar input:focus{border-color:#78429c;box-shadow:0 0 0 3px rgba(236,61,255,.08)}.reset-btn{padding:9px 10px;font-size:11px;height:36px}.active-filter-row{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}.filter-chip{border:1px solid rgba(236,61,255,.25);background:rgba(236,61,255,.08);color:#e9d9f3;border-radius:999px;padding:5px 8px;font-size:9px}
.content-area{padding:18px 24px 40px}.page{display:none;animation:pageIn .28s ease}.page.active{display:block}@keyframes pageIn{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(170px,1fr));gap:14px;margin-bottom:16px}.kpi-grid.compact{grid-template-columns:repeat(5,minmax(150px,1fr))}.kpi-card{position:relative;overflow:hidden;background:linear-gradient(145deg,#181522,#1d192a);border:1px solid var(--border);border-radius:var(--radius);padding:17px;min-height:126px;transition:.22s ease;box-shadow:0 8px 24px rgba(0,0,0,.13)}.kpi-card:before{content:"";position:absolute;right:-35px;top:-35px;width:95px;height:95px;border-radius:50%;background:radial-gradient(circle,rgba(236,61,255,.15),transparent 70%)}.kpi-card:hover{transform:translateY(-4px);border-color:#4d3d68;box-shadow:var(--shadow)}.kpi-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.kpi-icon{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:rgba(236,61,255,.12);color:var(--magenta)}.kpi-icon svg{width:17px;height:17px}.kpi-badge{font-size:9px;border-radius:999px;padding:4px 7px;background:#232034;color:var(--muted)}.kpi-label{margin-top:12px;color:var(--muted);font-size:11px}.kpi-value{font-size:25px;font-weight:850;margin-top:4px;letter-spacing:-.5px}.kpi-foot{margin-top:7px;font-size:9px;color:var(--muted-2)}.tone-green .kpi-icon{background:rgba(34,201,151,.1);color:var(--green)}.tone-cyan .kpi-icon{background:rgba(36,217,255,.1);color:var(--cyan)}.tone-red .kpi-icon{background:rgba(255,100,124,.1);color:var(--red)}.tone-yellow .kpi-icon{background:rgba(246,201,95,.1);color:var(--yellow)}.tone-purple .kpi-icon{background:rgba(154,108,255,.11);color:var(--purple)}
.grid-2{display:grid;grid-template-columns:1.35fr 1fr;gap:16px;margin-bottom:16px}.panel{background:linear-gradient(180deg,#171520,#15131e);border:1px solid var(--border);border-radius:var(--radius);padding:16px;box-shadow:0 8px 24px rgba(0,0,0,.12);transition:.2s ease}.panel:hover{border-color:#3e3555}.panel.no-pad{padding:0;overflow:hidden}.panel-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}.panel h3{margin:0;font-size:14px}.panel p{margin:4px 0 0;color:var(--muted);font-size:10px}.chart-wrap{position:relative;height:260px}.chart-wrap.tall{height:300px}.chart-wrap.wide{height:330px}.section-title-row{display:flex;justify-content:space-between;align-items:end;margin:24px 0 12px}.section-title-row h2{margin:0;font-size:18px}.section-title-row p{margin:4px 0 0;color:var(--muted);font-size:10px}
.best-line-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:16px}.best-card{background:linear-gradient(145deg,#191625,#21182d);border:1px solid rgba(236,61,255,.16);border-radius:16px;padding:15px;transition:.22s ease;position:relative;overflow:hidden}.best-card:hover{transform:translateY(-4px);box-shadow:0 18px 35px rgba(0,0,0,.2);border-color:rgba(236,61,255,.38)}.best-card .category{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.7px}.best-card .line-name{font-size:20px;font-weight:850;margin-top:6px}.best-card .center-name{font-size:10px;color:var(--muted);margin-top:2px}.best-card .score{font-size:22px;color:var(--magenta);font-weight:850;margin:14px 0 10px}.mini-metrics{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.mini-metrics div{background:#14121d;border:1px solid #282339;border-radius:10px;padding:8px}.mini-metrics span{display:block;color:var(--muted);font-size:8px}.mini-metrics strong{display:block;margin-top:3px;font-size:10px}
.table-wrap{overflow:auto;border-radius:12px}table{border-collapse:collapse;width:100%;min-width:760px}th,td{padding:10px 11px;border-bottom:1px solid #282339;font-size:10px;text-align:left;white-space:nowrap}th{color:#bdb5ca;font-weight:800;background:#14121c;position:sticky;top:0;z-index:2}td{color:#eee9f5}.table-wrap tbody tr{transition:.15s ease}.table-wrap tbody tr:hover{background:#1d1928}.badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 7px;font-size:8px;font-weight:800;border:1px solid transparent}.badge.success{background:rgba(34,201,151,.1);color:#6be0bb;border-color:rgba(34,201,151,.2)}.badge.warning{background:rgba(246,201,95,.1);color:#f5d77d;border-color:rgba(246,201,95,.2)}.badge.danger{background:rgba(255,100,124,.1);color:#ff9aab;border-color:rgba(255,100,124,.2)}.badge.info{background:rgba(36,217,255,.09);color:#78e9ff;border-color:rgba(36,217,255,.18)}.badge.neutral{background:#242033;color:#c9c1d6;border-color:#322c43}.num-pos{color:var(--green)}.num-neg{color:var(--red)}
.method-banner{background:linear-gradient(90deg,rgba(236,61,255,.11),rgba(36,217,255,.07));border:1px solid rgba(236,61,255,.22);border-radius:14px;padding:12px 14px;margin-bottom:16px;font-size:11px;color:#dcd4e8;line-height:1.55}.method-banner strong{color:#fff}.line-profile-toolbar,.calendar-toolbar,.explorer-toolbar{display:flex;align-items:end;justify-content:space-between;gap:12px;margin-bottom:14px}.line-profile-toolbar label{width:260px}.calendar-toolbar label{width:180px}.calendar-legend{display:flex;gap:12px;flex-wrap:wrap;color:var(--muted);font-size:9px}.calendar-legend span{display:flex;align-items:center;gap:5px}.dot{width:8px;height:8px;border-radius:50%;display:inline-block}.dot.green{background:var(--green)}.dot.yellow{background:var(--yellow)}.dot.red{background:var(--red)}.dot.gray{background:#585264}
.center-card-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;margin-bottom:16px}.center-card{background:linear-gradient(145deg,#181522,#21172b);border:1px solid var(--border);border-radius:16px;padding:15px;transition:.2s ease;cursor:pointer}.center-card:hover{transform:translateY(-4px);border-color:#694084;box-shadow:var(--shadow)}.center-card h3{margin:0;font-size:14px}.center-card .big{font-size:23px;font-weight:850;color:var(--magenta);margin:12px 0 10px}.center-card-grid .mini-metrics{grid-template-columns:1fr 1fr}
.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;margin-bottom:16px}.calendar-weekday{padding:7px;text-align:center;color:var(--muted);font-size:9px;font-weight:800}.calendar-day{min-height:116px;border:1px solid var(--border);background:#16131f;border-radius:12px;padding:9px;transition:.18s ease;cursor:pointer}.calendar-day:hover{transform:translateY(-2px);border-color:#534169}.calendar-day.empty{opacity:.35;cursor:default}.calendar-day.future{opacity:.5}.calendar-day .day-num{font-size:11px;font-weight:850}.calendar-day .day-status{display:flex;align-items:center;gap:5px;font-size:8px;color:var(--muted);margin-top:7px}.calendar-day .metrics{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:8px}.calendar-day .metrics div{background:#100f17;border-radius:8px;padding:6px}.calendar-day .metrics span{display:block;color:var(--muted);font-size:7px}.calendar-day .metrics strong{font-size:9px}.calendar-day.complete{box-shadow:inset 0 0 0 1px rgba(34,201,151,.17)}.calendar-day.partial{box-shadow:inset 0 0 0 1px rgba(246,201,95,.18)}.calendar-day.missing{box-shadow:inset 0 0 0 1px rgba(255,100,124,.2)}
.search-box{display:flex;align-items:center;gap:8px;background:#16131f;border:1px solid var(--border);border-radius:11px;padding:8px 10px;width:min(420px,100%)}.search-box svg{width:16px;color:var(--muted)}.search-box input{background:transparent;border:0;outline:0;color:#fff;width:100%;font-size:11px}.explorer-table{max-height:610px}.explorer-table th{position:sticky;top:0}.pagination{display:flex;gap:6px;justify-content:flex-end;padding:12px}.pagination button{border:1px solid var(--border);background:#181522;color:var(--muted);border-radius:8px;padding:6px 9px;font-size:9px}.pagination button.active{color:#fff;border-color:#7b3fa0;background:rgba(236,61,255,.12)}
.report-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:16px}.report-card{background:linear-gradient(145deg,#191623,#21192d);border:1px solid var(--border);border-radius:16px;padding:16px;transition:.2s ease}.report-card:hover{transform:translateY(-3px);border-color:#513969}.report-card .report-icon{width:38px;height:38px;border-radius:11px;background:rgba(236,61,255,.11);color:var(--magenta);display:grid;place-items:center}.report-card .report-icon svg{width:18px}.report-card h3{font-size:13px;margin:11px 0 5px}.report-card p{color:var(--muted);font-size:9px;line-height:1.5;min-height:40px}.report-card .buttons{display:flex;gap:7px;margin-top:12px}.report-card .buttons button{flex:1;border:1px solid var(--border);background:#15121d;color:#e8e2ef;border-radius:9px;padding:8px;font-size:9px}.report-card .buttons button:hover{border-color:#754092;background:#22182d}.report-actions{display:flex;gap:10px;flex-wrap:wrap}
.toast-stack{position:fixed;right:18px;bottom:18px;z-index:120;display:flex;flex-direction:column;gap:8px}.toast{min-width:250px;max-width:360px;background:#1b1727;border:1px solid var(--border);border-left:3px solid var(--magenta);border-radius:12px;padding:11px 12px;box-shadow:var(--shadow);font-size:10px;animation:toastIn .2s ease}.toast.success{border-left-color:var(--green)}.toast.error{border-left-color:var(--red)}@keyframes toastIn{from{opacity:0;transform:translateX(10px)}to{opacity:1;transform:none}}
.loading-overlay{position:fixed;inset:0;background:rgba(7,6,11,.75);backdrop-filter:blur(7px);z-index:200;display:grid;place-items:center;transition:.2s}.loading-overlay.hidden{opacity:0;pointer-events:none}.loader-card{background:#171420;border:1px solid var(--border);border-radius:16px;padding:20px 24px;display:flex;align-items:center;gap:13px;box-shadow:var(--shadow);font-size:12px}.loader-ring{width:24px;height:24px;border:3px solid #332b43;border-top-color:var(--magenta);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
@media(max-width:1400px){.filter-grid{grid-template-columns:repeat(5,1fr)}.kpi-grid.compact{grid-template-columns:repeat(4,1fr)}.center-card-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:1150px){.kpi-grid,.best-line-grid{grid-template-columns:repeat(2,1fr)}.kpi-grid.compact{grid-template-columns:repeat(3,1fr)}.grid-2{grid-template-columns:1fr}.filter-grid{grid-template-columns:repeat(3,1fr)}.report-grid{grid-template-columns:repeat(2,1fr)}.center-card-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:860px){:root{--sidebar:250px}.mobile-only{display:inline-flex}.sidebar{transform:translateX(-100%)}.sidebar.open{transform:none}.main-panel{margin-left:0;width:100%}.topbar{padding:14px}.topbar-actions .last-updated{display:none}.topbar h1{font-size:17px}.filter-panel{margin:12px 14px 0}.content-area{padding:14px}.filter-grid{grid-template-columns:repeat(2,1fr)}.calendar-grid{grid-template-columns:repeat(7,minmax(90px,1fr));overflow:auto}.calendar-day{min-width:90px}.report-grid{grid-template-columns:1fr}.center-card-grid{grid-template-columns:1fr 1fr}}
@media(max-width:620px){.kpi-grid,.kpi-grid.compact,.best-line-grid,.center-card-grid{grid-template-columns:1fr}.filter-grid{grid-template-columns:1fr}.filter-head,.topbar,.calendar-toolbar,.line-profile-toolbar,.explorer-toolbar{align-items:flex-start;flex-direction:column}.topbar-actions{width:100%;justify-content:space-between}.quick-dates{width:100%}.line-profile-toolbar label,.calendar-toolbar label{width:100%}.chart-wrap,.chart-wrap.tall,.chart-wrap.wide{height:260px}.topbar p{display:none}}
@media print{
  body{background:#fff;color:#111}.sidebar,.topbar,.filter-panel,.toast-stack,.loading-overlay{display:none!important}.main-panel{margin:0;width:100%}.content-area{padding:0}.page{display:block!important;page-break-after:always}.panel,.kpi-card,.best-card,.center-card,.report-card{box-shadow:none!important;background:#fff!important;color:#111!important;border-color:#ddd!important}.panel p,.kpi-label,.kpi-foot,.best-card .category,.best-card .center-name,.muted{color:#555!important}table,th,td{color:#111!important;background:#fff!important;border-color:#ddd!important}.chart-wrap{break-inside:avoid}}

/* ===== v2 additions: theme, multi-select, live sync, manpower ===== */
.sync-block{display:flex;flex-direction:column;gap:2px;font-size:10px;min-width:105px}.sync-line{display:flex;align-items:center;gap:6px}.sync-dot{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 0 0 rgba(34,201,151,.45);animation:pulse 2s infinite}.sync-dot.syncing{background:var(--yellow);animation:spinDot .9s linear infinite}.sync-dot.error{background:var(--red);animation:none}@keyframes spinDot{50%{opacity:.35;transform:scale(.7)}}
.theme-switch{border:0;background:transparent;padding:0;width:74px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.theme-track-art{position:relative;width:68px;height:30px;border-radius:999px;background:linear-gradient(135deg,#33236f,#7345ba 55%,#a96bdd);box-shadow:inset 0 0 0 1px rgba(255,255,255,.1),0 7px 20px rgba(112,58,188,.2);overflow:hidden;transition:.35s ease}.theme-thumb{position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;color:#2e2a4a;background:radial-gradient(circle at 35% 30%,#f7f9ff,#d8deea 72%);box-shadow:0 3px 10px rgba(0,0,0,.28);transition:transform .36s cubic-bezier(.2,.8,.2,1),background .3s}.theme-thumb svg{width:14px;height:14px}.theme-stars{position:absolute;right:12px;top:6px;font-size:10px;color:#fff8c9;opacity:.82}.theme-cloud{position:absolute;left:30px;bottom:2px;font-size:14px;opacity:.18;color:#fff}.theme-switch[aria-checked="true"] .theme-track-art{background:linear-gradient(135deg,#bfe9f3,#e4f8ff 58%,#bce6f1)}.theme-switch[aria-checked="true"] .theme-thumb{transform:translateX(38px);background:radial-gradient(circle at 35% 30%,#fff9bd,#ffd94f 65%,#ffc928);color:#8b6200}.theme-switch[aria-checked="true"] .theme-stars{opacity:0}.theme-switch[aria-checked="true"] .theme-cloud{opacity:.8;color:#fff;left:10px}

.multi-select{position:relative;width:100%;min-width:0}.multi-select-trigger{width:100%;height:36px;border:1px solid var(--border);border-radius:10px;background:#11101a;color:var(--text);padding:8px 9px;display:flex;align-items:center;justify-content:space-between;gap:8px;text-align:left;outline:none}.multi-select-trigger:hover,.multi-select.open .multi-select-trigger{border-color:#78429c;box-shadow:0 0 0 3px rgba(236,61,255,.08)}.multi-select-trigger .multi-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px}.multi-select-trigger svg{width:14px;flex:0 0 auto;transition:.2s}.multi-select.open .multi-select-trigger svg{transform:rotate(180deg)}.multi-select-menu{display:none;position:absolute;left:0;right:0;top:calc(100% + 5px);z-index:95;background:#181523;border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);padding:8px;min-width:210px;max-height:280px;overflow:auto}.multi-select.open .multi-select-menu{display:block;animation:fadeUp .14s ease}.multi-actions{display:flex;gap:6px;padding-bottom:7px;margin-bottom:6px;border-bottom:1px solid var(--border-soft)}.multi-actions button{flex:1;border:1px solid var(--border);background:#12101a;color:var(--muted);border-radius:8px;padding:6px;font-size:9px}.multi-actions button:hover{color:var(--text);border-color:#6d458a}.multi-option{display:flex;flex-direction:row!important;align-items:center!important;gap:8px!important;padding:7px 6px!important;color:var(--text)!important;font-size:10px!important;font-weight:500!important;border-radius:8px;cursor:pointer}.multi-option:hover{background:#242033}.multi-option input{width:14px!important;height:14px!important;padding:0!important;accent-color:var(--magenta);box-shadow:none!important}.multi-option span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.multi-empty{padding:10px 7px;color:var(--muted);font-size:9px}

.manpower-status-cell{font-weight:800}.manpower-status-cell.absent,.manpower-absent{color:var(--red)}.manpower-status-cell.surplus,.manpower-surplus{color:var(--green)}.manpower-status-cell.balanced{color:var(--cyan)}

/* Light theme keeps the same accent family but switches surfaces and text. */
body[data-theme="light"]{
  --bg:#f5f6fb;--bg-2:#eef1f7;--panel:#ffffff;--panel-2:#f7f8fc;--panel-3:#eef0f7;--border:#d9dce8;--border-soft:#e5e7ef;--text:#191526;--muted:#6f6a7a;--muted-2:#918b9c;--shadow:0 18px 38px rgba(44,40,68,.11);
  background:radial-gradient(circle at top right,rgba(154,108,255,.10),transparent 28%),linear-gradient(180deg,#f7f8fb 0%,#eef1f6 100%);color:var(--text)
}
body[data-theme="light"] .sidebar{background:rgba(255,255,255,.95);border-color:var(--border-soft)}
body[data-theme="light"] .brand-logo-wrap{box-shadow:0 8px 20px rgba(154,108,255,.16)}
body[data-theme="light"] .brand-logo{filter:none}
body[data-theme="light"] .nav-item{color:#625d70}body[data-theme="light"] .nav-item:hover{background:#f0ecf8;color:#21192e}body[data-theme="light"] .nav-item.active{color:#241a32;background:linear-gradient(90deg,rgba(236,61,255,.12),rgba(154,108,255,.08))}
body[data-theme="light"] .topbar{background:rgba(247,248,252,.9)}
body[data-theme="light"] .action-btn,body[data-theme="light"] .icon-btn,body[data-theme="light"] .reset-btn{background:#fff;color:#2a2534;border-color:var(--border)}
body[data-theme="light"] .action-btn.primary{color:#fff;background:linear-gradient(135deg,#8e38e9,#cf45e9)}
body[data-theme="light"] .export-menu,body[data-theme="light"] .multi-select-menu{background:#fff;color:var(--text)}body[data-theme="light"] .export-menu button{color:#2c2636}body[data-theme="light"] .export-menu button:hover{background:#f2eef8}
body[data-theme="light"] .filter-panel{background:linear-gradient(180deg,rgba(255,255,255,.97),rgba(247,248,252,.97));box-shadow:0 12px 28px rgba(65,55,90,.07)}
body[data-theme="light"] .quick-dates button{background:#fff;color:#696273}body[data-theme="light"] .quick-dates button:hover,body[data-theme="light"] .quick-dates button.active{color:#351e45;background:#f7eefd}
body[data-theme="light"] .filter-grid input,body[data-theme="light"] .multi-select-trigger,body[data-theme="light"] .line-profile-toolbar select,body[data-theme="light"] .calendar-toolbar input{background:#fff;color:#211c2a;border-color:var(--border)}
body[data-theme="light"] .multi-actions button{background:#f7f7fb}body[data-theme="light"] .multi-option:hover{background:#f4eff9}
body[data-theme="light"] .kpi-card,body[data-theme="light"] .panel,body[data-theme="light"] .best-card,body[data-theme="light"] .center-card,body[data-theme="light"] .report-card{background:linear-gradient(145deg,#fff,#f7f8fc);box-shadow:0 8px 22px rgba(50,45,72,.06)}
body[data-theme="light"] .mini-metrics div,body[data-theme="light"] .calendar-day .metrics div{background:#f5f6fa;border-color:#e4e4ed}
body[data-theme="light"] th{color:#625d70;background:#f2f3f8}body[data-theme="light"] td{color:#2b2632}body[data-theme="light"] th,body[data-theme="light"] td{border-color:#e3e4ec}body[data-theme="light"] .table-wrap tbody tr:hover{background:#f6f2fa}
body[data-theme="light"] .method-banner{color:#554e61;background:linear-gradient(90deg,rgba(236,61,255,.08),rgba(36,217,255,.08))}body[data-theme="light"] .method-banner strong{color:#251d31}
body[data-theme="light"] .calendar-day{background:#fff}body[data-theme="light"] .search-box{background:#fff}body[data-theme="light"] .search-box input{color:#211c2a}body[data-theme="light"] .pagination button{background:#fff;color:#6f6879}
body[data-theme="light"] .report-card .buttons button{background:#fff;color:#2b2632}body[data-theme="light"] .toast{background:#fff;color:#2a2532}body[data-theme="light"] .loader-card{background:#fff;color:#2a2532}body[data-theme="light"] .loading-overlay{background:rgba(240,242,247,.72)}
body[data-theme="light"] .filter-chip{color:#5d3272;background:rgba(199,88,225,.08)}

@media(max-width:1150px){.sync-block{display:none}}
@media(max-width:860px){.theme-switch{width:68px}.last-updated{display:none!important}}

/* ===== v2.1 focused patch: line breakdowns, contextual KPI labels, premium winners ===== */
.line-breakdown-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px;align-items:start}
.line-mini-card{position:relative;overflow:hidden;background:linear-gradient(145deg,#15131f,#1d1929);border:1px solid var(--border-soft);border-radius:14px;padding:12px;min-width:0;transition:.2s ease}
.line-mini-card:hover{transform:translateY(-2px);border-color:#47385f;box-shadow:0 12px 28px rgba(0,0,0,.16)}
.line-mini-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:8px}.line-mini-head strong{display:block;font-size:12px}.line-mini-head span{display:block;margin-top:2px;color:var(--muted);font-size:8px;line-height:1.35}.line-mini-badge{flex:0 0 auto!important;margin:0!important;padding:4px 6px;border-radius:999px;background:rgba(154,108,255,.10);border:1px solid rgba(154,108,255,.18);color:var(--purple)!important;font-size:7px!important;font-weight:800;letter-spacing:.55px;text-transform:uppercase}.line-mini-chart{position:relative;height:180px}.line-breakdown-empty{padding:32px 14px;text-align:center;color:var(--muted);font-size:11px;border:1px dashed var(--border);border-radius:12px}
.kpi-label{line-height:1.3}

/* Premium Best Performing Line cards: restrained champagne / bronze, not bright yellow. */
.best-card.best-card-winner{background:radial-gradient(circle at 100% 0%,rgba(232,190,104,.15),transparent 38%),linear-gradient(145deg,#201a16 0%,#1c1720 56%,#251e16 100%);border:1px solid rgba(224,182,94,.42);box-shadow:0 10px 28px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,235,183,.05);padding:17px}
.best-card.best-card-winner:before{content:"";position:absolute;inset:0;background:linear-gradient(115deg,transparent 0%,rgba(255,234,184,.05) 37%,rgba(255,234,184,.12) 48%,transparent 60%);transform:translateX(-115%);transition:transform .7s ease;pointer-events:none}.best-card.best-card-winner:hover:before{transform:translateX(115%)}
.best-card.best-card-winner:hover{transform:translateY(-6px);border-color:rgba(245,205,118,.68);box-shadow:0 20px 42px rgba(0,0,0,.28),0 0 28px rgba(218,172,76,.09)}
.winner-glow{position:absolute;width:120px;height:120px;right:-48px;top:-48px;border-radius:50%;background:radial-gradient(circle,rgba(230,186,91,.22),transparent 68%);pointer-events:none}.winner-kicker{display:flex;align-items:center;gap:7px;position:relative;z-index:1;color:#ddbd73;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.78px}.winner-kicker svg{width:15px;height:15px;color:#e6c36d;filter:drop-shadow(0 0 7px rgba(226,183,82,.22))}.winner-rank{position:absolute;right:12px;top:12px;padding:4px 7px;border-radius:999px;border:1px solid rgba(235,200,121,.26);background:rgba(220,176,83,.08);color:#d8ba78;font-size:7px;font-weight:900;letter-spacing:1px}.best-card.best-card-winner .line-name{font-size:22px;margin-top:12px;color:#fff7e3;text-shadow:0 1px 12px rgba(220,178,83,.08)}.best-card.best-card-winner .center-name{color:#a99c86}.best-card.best-card-winner .score-label{margin-top:14px;color:#9f927b;font-size:8px;text-transform:uppercase;letter-spacing:.65px}.best-card.best-card-winner .score{margin:3px 0 11px;color:#e9c878;font-size:25px}.best-card.best-card-winner .mini-metrics div{background:rgba(15,13,17,.38);border-color:rgba(221,184,103,.13)}.best-card.best-card-winner .mini-metrics span{color:#9c927e}.best-card.best-card-winner .mini-metrics strong{color:#efe7d7}.best-card.best-card-empty{border-color:rgba(220,184,105,.14)}

body[data-theme="light"] .line-mini-card{background:linear-gradient(145deg,#fff,#f7f8fc);border-color:var(--border);box-shadow:0 5px 15px rgba(50,45,72,.04)}
body[data-theme="light"] .line-mini-card:hover{border-color:#c9b5db;box-shadow:0 11px 26px rgba(70,58,93,.08)}
body[data-theme="light"] .line-mini-badge{background:#f6effe;color:#7f4eb5!important;border-color:#e8dbf5}
body[data-theme="light"] .best-card.best-card-winner{background:radial-gradient(circle at 100% 0%,rgba(214,169,73,.14),transparent 40%),linear-gradient(145deg,#fffdf8,#fbf7ed 58%,#f8f2e5);border-color:rgba(184,137,47,.38);box-shadow:0 10px 26px rgba(109,83,36,.08)}
body[data-theme="light"] .best-card.best-card-winner:hover{border-color:rgba(177,128,38,.58);box-shadow:0 18px 36px rgba(120,88,30,.12),0 0 24px rgba(200,151,54,.08)}
body[data-theme="light"] .winner-kicker,body[data-theme="light"] .best-card.best-card-winner .score{color:#9d7324}body[data-theme="light"] .winner-kicker svg{color:#a87b25}body[data-theme="light"] .winner-rank{color:#956e27;background:rgba(190,145,55,.08);border-color:rgba(169,123,35,.22)}
body[data-theme="light"] .best-card.best-card-winner .line-name{color:#2f2619;text-shadow:none}body[data-theme="light"] .best-card.best-card-winner .center-name,body[data-theme="light"] .best-card.best-card-winner .score-label{color:#887963}body[data-theme="light"] .best-card.best-card-winner .mini-metrics div{background:rgba(255,255,255,.72);border-color:rgba(175,133,54,.14)}body[data-theme="light"] .best-card.best-card-winner .mini-metrics span{color:#887963}body[data-theme="light"] .best-card.best-card-winner .mini-metrics strong{color:#3d3325}

@media(max-width:620px){.line-breakdown-grid{grid-template-columns:1fr}.line-mini-chart{height:190px}}
@media print{.line-breakdown-grid{grid-template-columns:repeat(2,1fr)}.line-mini-card{break-inside:avoid;background:#fff!important;border-color:#ddd!important}.best-card.best-card-winner{background:#fff!important;border-color:#c8a55b!important}.winner-rank,.winner-glow{display:none!important}}


/* ===== v2.3 focused patch: clickable overview KPIs, volunteer variance, QC entity cards ===== */
.kpi-card-link{cursor:pointer;outline:none}
.kpi-card-link:after{content:"↗";position:absolute;right:13px;bottom:11px;font-size:11px;color:var(--muted-2);opacity:.55;transition:.2s ease}
.kpi-card-link:hover:after,.kpi-card-link:focus-visible:after{opacity:1;transform:translate(2px,-2px);color:var(--cyan)}
.kpi-card-link:focus-visible{border-color:var(--cyan);box-shadow:0 0 0 3px rgba(36,217,255,.13),var(--shadow)}
.variance-pair{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:1px}
.variance-stat{min-width:0;padding:7px 8px;border-radius:10px;background:rgba(255,255,255,.025);border:1px solid var(--border-soft);display:flex;flex-direction:column;gap:2px}
.variance-stat span{font-size:8px;font-weight:800;letter-spacing:.3px;text-transform:uppercase;color:var(--muted)}
.variance-stat strong{font-size:16px;line-height:1.1;letter-spacing:-.2px}
.variance-absent strong{color:var(--red)}.variance-surplus strong{color:var(--green)}
.kpi-text-value{display:block;font-size:16px;line-height:1.2;letter-spacing:-.15px;overflow-wrap:anywhere}
body[data-theme="light"] .variance-stat{background:rgba(255,255,255,.7);border-color:var(--border)}
@media(max-width:620px){.variance-stat strong{font-size:17px}.kpi-text-value{font-size:17px}}
@media print{.kpi-card-link:after{display:none!important}}

/* Keep the requested 5 + 5 QC card arrangement on desktop. */
#qualityKpis{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:1150px){#qualityKpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){#qualityKpis{grid-template-columns:1fr}}

/* ===== External Dashboard v1.1 presentation patch ===== */
/* Keep the original CNRS artwork unchanged and make it readable in dark mode. */
.brand-logo-wrap{
  background:#ffffff;
  border:1px solid rgba(255,255,255,.18);
  box-shadow:0 0 28px rgba(236,61,255,.18),0 6px 18px rgba(0,0,0,.16);
}
.brand-logo{filter:none!important}
body[data-theme="light"] .brand-logo-wrap{
  background:#ffffff;
  border-color:#e1e3eb;
  box-shadow:0 8px 20px rgba(154,108,255,.12);
}

/* Make native date controls fully legible in both themes. */
.filter-grid input[type="date"]{
  color-scheme:dark;
  background:#11101a;
  color:#f7f4ff!important;
  -webkit-text-fill-color:#f7f4ff;
}
.filter-grid input[type="date"]::-webkit-datetime-edit,
.filter-grid input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.filter-grid input[type="date"]::-webkit-datetime-edit-text,
.filter-grid input[type="date"]::-webkit-datetime-edit-month-field,
.filter-grid input[type="date"]::-webkit-datetime-edit-day-field,
.filter-grid input[type="date"]::-webkit-datetime-edit-year-field{
  color:#f7f4ff!important;
  -webkit-text-fill-color:#f7f4ff;
}
.filter-grid input[type="date"]::-webkit-calendar-picker-indicator{
  filter:invert(1) brightness(1.65);
  opacity:.85;
  cursor:pointer;
}
body[data-theme="light"] .filter-grid input[type="date"]{
  color-scheme:light;
  background:#ffffff;
  color:#211c2a!important;
  -webkit-text-fill-color:#211c2a;
}
body[data-theme="light"] .filter-grid input[type="date"]::-webkit-datetime-edit,
body[data-theme="light"] .filter-grid input[type="date"]::-webkit-datetime-edit-fields-wrapper,
body[data-theme="light"] .filter-grid input[type="date"]::-webkit-datetime-edit-text,
body[data-theme="light"] .filter-grid input[type="date"]::-webkit-datetime-edit-month-field,
body[data-theme="light"] .filter-grid input[type="date"]::-webkit-datetime-edit-day-field,
body[data-theme="light"] .filter-grid input[type="date"]::-webkit-datetime-edit-year-field{
  color:#211c2a!important;
  -webkit-text-fill-color:#211c2a;
}
body[data-theme="light"] .filter-grid input[type="date"]::-webkit-calendar-picker-indicator{
  filter:none;
  opacity:.72;
}


/* ===== External Dashboard v1.3 live hotfix =====
   Force Chrome/Edge native date controls to follow the selected dashboard theme. */
html{color-scheme:dark}
body[data-theme="light"]{color-scheme:light}
body:not([data-theme="light"]) .filter-grid input[type="date"]{
  color-scheme:dark!important;
  background-color:#11101a!important;
  color:#f7f4ff!important;
  -webkit-text-fill-color:#f7f4ff!important;
  border-color:#322a43!important;
}
body:not([data-theme="light"]) .filter-grid input[type="date"]::-webkit-calendar-picker-indicator{
  filter:invert(1) brightness(2)!important;
  opacity:1!important;
  cursor:pointer;
}
body[data-theme="light"] .filter-grid input[type="date"]{
  color-scheme:light!important;
  background-color:#ffffff!important;
  color:#211c2a!important;
  -webkit-text-fill-color:#211c2a!important;
}
body[data-theme="light"] .filter-grid input[type="date"]::-webkit-calendar-picker-indicator{
  filter:none!important;
  opacity:.9!important;
}


/* ===== External Dashboard v1.5: reliable theme-aware DATE PICKER BUTTON =====
   Chrome/Edge can render the native date glyph differently across Windows versions.
   We keep the native date input for validation/value handling, then place a real,
   clickable calendar button over its right edge. The button calls showPicker(). */
.date-input-wrap{
  position:relative;
  width:100%;
  min-width:0;
}
.date-input-wrap > input[type="date"]{
  width:100%;
  background-image:none!important;
  /* No extra right padding: this keeps the browser's native glyph at the far right,
     directly underneath our opaque functional button rather than shifting it left. */
  padding-right:10px!important;
}
.date-picker-btn{
  position:absolute;
  z-index:5;
  top:1px;
  right:1px;
  bottom:1px;
  width:38px;
  display:grid;
  place-items:center;
  margin:0;
  padding:0;
  border:0;
  border-radius:0 9px 9px 0;
  background:#11101a;
  color:#f7f4ff;
  cursor:pointer;
  outline:none;
}
.date-picker-btn svg{
  width:17px;
  height:17px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
  pointer-events:none;
}
.date-picker-btn:hover{background:#191626}
.date-picker-btn:focus-visible{box-shadow:inset 0 0 0 2px #9a6cff}
body[data-theme="light"] .date-picker-btn{
  background:#ffffff;
  color:#211c2a;
}
body[data-theme="light"] .date-picker-btn:hover{background:#f1f2f7}

/* The native calendar indicator remains underneath the opaque button. This rule
   prevents it from creating a second visible icon if the browser exposes it. */
.date-input-wrap input[type="date"]::-webkit-calendar-picker-indicator{
  margin:0!important;
}
