/* Vertox v1.2 - Boutique & Parlour: rose / plum palette. (The variable names still say "blue" because every page
   uses them; the VALUES are the boutique colours. Settings -> Theme "Classic Blue" restores the old look.) */
:root{
  --blue-900:#4A1230;
  --blue-800:#661A42;
  --blue-700:#8A2257;
  --blue-600:#B02D6E;
  --blue-500:#D14187;
  --blue-100:#FBE6F0;
  --blue-50:#FFF6FA;
  --white:#FFFFFF;
  --ink:#2A1623;
  --ink-soft:#6E5565;
  --ink-faint:#A58C9B;
  --line:#F0DCE6;
  --danger:#D64545;
  --success:#1C9C6E;
  --warn:#DB9A1F;
  --radius:12px;
  --shadow:0 1px 2px rgba(74,18,48,.06), 0 8px 24px -12px rgba(74,18,48,.20);
  --font:'Inter','Segoe UI','Noto Nastaliq Urdu','Noto Sans Arabic',Tahoma,Arial,sans-serif;
  --sidebar-w:236px;
}
*{box-sizing:border-box;margin:0;padding:0;}
body{
  font-family:var(--font);
  background:var(--blue-50);
  color:var(--ink);
  font-size:14px;
  line-height:1.5;
}
a{color:inherit;text-decoration:none;}
button{font-family:inherit;cursor:pointer;}
input,select,textarea{font-family:inherit;font-size:14px;}
/* Scrollbar: visible track (not just a thumb) so there's always a clear
   line to grab/click on, and it works with mouse drag as well as the wheel.
   Firefox uses scrollbar-color/width; WebKit browsers use the pseudo-elements. */
*{scrollbar-width:thin;scrollbar-color:#B9C6DC var(--blue-50);}
::-webkit-scrollbar{width:10px;height:10px;}
::-webkit-scrollbar-track{background:var(--blue-50);border-radius:8px;}
::-webkit-scrollbar-thumb{background:#B9C6DC;border-radius:8px;border:2px solid var(--blue-50);}
::-webkit-scrollbar-thumb:hover{background:#93A6C8;}
.sidebar ::-webkit-scrollbar-track{background:transparent;}
.sidebar{scrollbar-color:rgba(234,241,255,.35) transparent;}

/* ---- Layout ---- */
.app{display:flex;min-height:100vh;}
.sidebar{
  width:var(--sidebar-w);position:fixed;top:0;left:0;bottom:0;
  background:linear-gradient(180deg,var(--blue-900),var(--blue-800));
  color:#EAF1FF;display:flex;flex-direction:column;z-index:40;
  overflow:hidden;
}
.sidebar::before{
  content:'';position:absolute;top:-40px;right:-60px;width:180px;height:180px;
  background:radial-gradient(circle,rgba(94,161,255,.35),rgba(94,161,255,0) 70%);
  border-radius:50%;pointer-events:none;
}
.brand{position:relative;display:flex;align-items:center;gap:10px;padding:22px 20px 18px;}
.brand::after{
  content:'';position:absolute;left:20px;right:20px;bottom:0;height:3px;border-radius:3px;
  background:linear-gradient(90deg,var(--blue-600),#5EA1FF);
  box-shadow:0 0 10px 1px rgba(94,161,255,.55);
}
.brand > div:last-child{min-width:0;flex:1;}
.brand-mark{flex-shrink:0;overflow:hidden;width:34px;height:34px;border-radius:9px;background:linear-gradient(135deg,var(--blue-600),#5EA1FF);display:flex;align-items:center;justify-content:center;font-weight:800;color:#fff;font-size:15px;box-shadow:0 6px 14px -4px rgba(0,0,0,.35);}
.brand-name{font-size:17px;font-weight:700;letter-spacing:.1px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.brand-sub{font-size:9.5px;color:#9CB6E0;letter-spacing:.5px;text-transform:uppercase;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.brand-mark.has-logo,.auth-logo.has-logo{background:#fff;padding:3px;}
.brand-mark img,.auth-logo img{width:100%;height:100%;object-fit:contain;display:block;}

.nav-scroll{flex:1;overflow-y:auto;padding:14px 12px;}
.nav-label{font-size:10px;text-transform:uppercase;letter-spacing:1px;color:#7C97C4;margin:14px 10px 6px;font-weight:700;}
.nav-item{display:flex;align-items:center;gap:11px;padding:9px 12px;border-radius:9px;color:#CBDBFB;font-size:13px;font-weight:500;line-height:1.3;margin-bottom:2px;transition:.15s;min-width:0;overflow-wrap:anywhere;}
.nav-item:hover{background:rgba(234,241,255,.09);color:#fff;}
.nav-item.active{background:rgba(46,122,230,.25);color:#fff;}
.nav-item .ic{flex-shrink:0;width:16px;text-align:center;display:inline-flex;align-items:center;justify-content:center;opacity:.9;}
.nav-item .ic svg{width:16px;height:16px;}
.nav-item.active .ic{opacity:1;}
.btn-icon{display:inline-flex;align-items:center;justify-content:center;}
.btn-icon svg{width:16px;height:16px;}

/* ---- Module category accordion (sidebar tree view) ---- */
.nav-cat{margin-bottom:2px;}
.nav-cat-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 10px 9px 12px;border-radius:9px;cursor:pointer;color:#CBDBFB;font-size:12.5px;font-weight:700;letter-spacing:.3px;transition:.15s;user-select:none;}
.nav-cat-head:hover{background:rgba(234,241,255,.09);color:#fff;}
.nav-cat-head .chev{flex-shrink:0;width:14px;height:14px;display:inline-flex;transition:transform .18s ease;opacity:.75;flex-shrink:0;}
.nav-cat.open .nav-cat-head .chev{transform:rotate(90deg);}
.nav-cat-head .cat-label{flex:1;min-width:0;display:flex;align-items:center;gap:9px;line-height:1.3;}
.nav-cat-head .cat-count{font-size:10px;font-weight:600;color:#7C97C4;background:rgba(255,255,255,.06);padding:1px 6px;border-radius:20px;}
.nav-cat-body{max-height:0;overflow:hidden;transition:max-height .2s ease;padding-left:8px;}
.nav-cat.open .nav-cat-body{max-height:1000px;}
.nav-cat-body .nav-item{padding-left:20px;font-size:13px;}
body.theme-white .nav-cat-head,
html.theme-white .nav-cat-head{color:var(--ink-soft);}
body.theme-white .nav-cat-head:hover,
html.theme-white .nav-cat-head:hover{background:var(--blue-50);color:var(--blue-700);}
body.theme-white .nav-cat-head .cat-count,
html.theme-white .nav-cat-head .cat-count{background:var(--blue-50);color:var(--ink-faint);}

.user-mini{display:flex;align-items:center;gap:10px;padding:14px 14px;border-top:1px solid rgba(234,241,255,.1);}
.avatar{flex-shrink:0;width:32px;height:32px;border-radius:50%;background:var(--blue-500);display:flex;align-items:center;justify-content:center;font-weight:700;color:#fff;font-size:13px;}
.user-mini > div{min-width:0;}
.user-mini .name{font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.user-mini .role{font-size:11px;color:#9CB6E0;}

.main{margin-left:var(--sidebar-w);flex:1;display:flex;flex-direction:column;min-height:100vh;}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:16px 28px;background:var(--white);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20;}
.page-title{font-size:20px;font-weight:700;}
.page-sub{font-size:12.5px;color:var(--ink-soft);margin-top:2px;}
.content{padding:26px 28px;flex:1;}

/* ---- Cards / buttons ---- */
.card{background:var(--white);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);}
.card-pad{padding:20px;}
.btn{display:inline-flex;align-items:center;gap:7px;padding:9px 16px;border-radius:9px;border:1px solid transparent;font-size:13.5px;font-weight:600;transition:.15s;}
.btn-primary{background:var(--blue-600);color:#fff;}
.btn-primary:hover{background:var(--blue-700);}
.btn-outline{background:#fff;border-color:var(--line);color:var(--ink);}
.btn-outline:hover{border-color:var(--blue-500);color:var(--blue-600);}
.btn-danger{background:#FDEDED;color:var(--danger);}
.btn-danger:hover{background:#FBDCDC;}
.btn-sm{padding:6px 11px;font-size:12.5px;}
.btn-icon{padding:8px;border-radius:8px;background:#fff;border:1px solid var(--line);}

.input,.select,.textarea{
  width:100%;padding:9px 12px;border:1px solid var(--line);border-radius:9px;
  background:#fff;color:var(--ink);outline:none;transition:.15s;
}
.input:focus,.select:focus,.textarea:focus{border-color:var(--blue-500);box-shadow:0 0 0 3px var(--blue-100);}
.input-error,.select.input-error,.textarea.input-error{border-color:var(--danger) !important;box-shadow:0 0 0 3px #FBDCDC !important;}
.field-error{color:var(--danger);font-size:11.5px;margin-top:5px;}
.label{font-size:12.5px;font-weight:600;color:var(--ink-soft);margin-bottom:6px;display:block;}
.field{margin-bottom:16px;}

table{width:100%;border-collapse:collapse;}
th{text-align:left;font-size:11.5px;text-transform:uppercase;letter-spacing:.4px;color:var(--ink-soft);padding:11px 14px;border-bottom:1px solid var(--line);background:var(--blue-50);}
td{padding:12px 14px;border-bottom:1px solid var(--line);font-size:13.5px;}
tr:last-child td{border-bottom:none;}
tr:hover td{background:var(--blue-50);}

.badge{display:inline-block;padding:3px 10px;border-radius:20px;font-size:11.5px;font-weight:600;}
.badge-blue{background:var(--blue-100);color:var(--blue-700);}
.badge-green{background:#E4F7EE;color:var(--success);}
.badge-red{background:#FDEDED;color:var(--danger);}
.badge-gray{background:#EEF1F6;color:var(--ink-soft);}
.badge-amber{background:#FFF4DF;color:#9A6200;}

.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:16px;margin-bottom:24px;}
.stat-card{background:var(--white);border:1px solid var(--line);border-left:4px solid var(--blue-300,#5EA1FF);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow);display:flex;align-items:center;gap:14px;transition:transform .12s ease, box-shadow .12s ease;}
.stat-card:hover{transform:translateY(-1px);box-shadow:0 10px 22px -12px rgba(11,46,89,.28);}
.stat-icon{width:40px;height:40px;min-width:40px;border-radius:10px;display:flex;align-items:center;justify-content:center;background:var(--blue-50);color:var(--blue-700);}
.stat-icon svg{width:20px;height:20px;}
.stat-body{display:flex;flex-direction:column;}
.stat-num{font-size:26px;font-weight:800;color:var(--blue-800);line-height:1.1;}
.stat-label{font-size:12.5px;color:var(--ink-soft);margin-top:4px;}
/* ---- Colourful KPI cards: every card gets its own colour (cycled), red/amber/green keep their meaning ---- */
.stat-card{--c:#2E7AE6;--c2:#E3EEFD;background:linear-gradient(135deg,var(--c2) 0%,#fff 75%);border-color:var(--c2);border-left-color:var(--c);}
.stat-card .stat-icon{background:var(--c);color:#fff;box-shadow:0 6px 14px -6px var(--c);}
.stat-card .stat-num{color:var(--c);white-space:nowrap;}
.stat-card .stat-body{min-width:0;}
.stat-card .stat-num.long{font-size:19px;}
.stat-card:nth-child(6n+1){--c:#2E7AE6;--c2:#E3EEFD;}
.stat-card:nth-child(6n+2){--c:#1C9C6E;--c2:#DDF5EA;}
.stat-card:nth-child(6n+3){--c:#E08A1E;--c2:#FDF0DA;}
.stat-card:nth-child(6n+4){--c:#8A4FD6;--c2:#EEE5FB;}
.stat-card:nth-child(6n+5){--c:#D6336C;--c2:#FDE4EE;}
.stat-card:nth-child(6n+6){--c:#0E8C99;--c2:#D9F3F5;}
.stat-card.accent-green{--c:#1C9C6E;--c2:#DDF5EA;}
.stat-card.accent-amber{--c:#E08A1E;--c2:#FDF0DA;}
.stat-card.accent-red{--c:#D64545;--c2:#FDE6E6;}
.stat-card:not(:has(.stat-icon)){padding-left:16px;}
.stat-section{font-size:13px;font-weight:700;color:var(--ink-soft);text-transform:uppercase;letter-spacing:.6px;margin:22px 0 10px;}

.modal-overlay{position:fixed;inset:0;background:rgba(11,46,89,.4);display:flex;align-items:center;justify-content:center;z-index:100;}
.modal{background:#fff;border-radius:14px;width:460px;max-width:92vw;max-height:88vh;overflow-y:auto;box-shadow:0 20px 60px rgba(11,46,89,.3);}
.modal-wide{width:680px;}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--line);}
.modal-title{font-size:16px;font-weight:700;}
.modal-body{padding:20px 22px;}
.modal-foot{padding:16px 22px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:10px;}
.close-x{background:none;border:none;font-size:20px;color:var(--ink-soft);}

.toast-wrap{position:fixed;top:18px;right:18px;z-index:200;display:flex;flex-direction:column;gap:8px;}
.toast{background:#fff;border:1px solid var(--line);border-left:4px solid var(--blue-500);padding:12px 16px;border-radius:8px;box-shadow:var(--shadow);font-size:13px;min-width:240px;}
.toast.error{border-left-color:var(--danger);}
.toast.success{border-left-color:var(--success);}

.toolbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;gap:12px;flex-wrap:wrap;}
.search-box{position:relative;max-width:280px;flex:1;}

.empty{text-align:center;padding:50px 20px;color:var(--ink-faint);}

.field-row{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid var(--line);border-radius:10px;margin-bottom:8px;background:#fff;}
.field-row .grow{flex:1;}
.tag{font-size:10.5px;padding:2px 8px;border-radius:6px;background:var(--blue-100);color:var(--blue-700);font-weight:700;text-transform:uppercase;}

.checkbox-row{display:flex;align-items:center;gap:8px;}
.hidden{display:none !important;}

/* ---- Toggle switch (used instead of tick-checkboxes in Roles &
   Permissions — same underlying <input type=checkbox>, just styled and
   driven as a button so it reads as an on/off switch, not a form tick). --- */
.toggle-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 4px;}
.toggle-row .toggle-label{font-size:13px;color:var(--ink,#1a2233);flex:1;}
.switch{position:relative;display:inline-block;width:38px;height:22px;flex:none;cursor:pointer;}
.switch input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer;}
.switch .track{position:absolute;inset:0;background:#d7dce3;border-radius:22px;transition:.15s;}
.switch .thumb{position:absolute;top:2px;left:2px;width:18px;height:18px;background:#fff;border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:.15s;}
.switch input:checked + .track{background:var(--blue-600,#B02D6E);}
.switch input:checked + .track .thumb{transform:translateX(16px);}
.switch input:focus-visible + .track{outline:2px solid var(--blue-300,#93c5fd);outline-offset:2px;}

/* ---- Pill buttons (date-range presets etc.) ---- */
.pill-group{display:flex;gap:6px;flex-wrap:wrap;}
.pill-btn{padding:7px 13px;border-radius:20px;border:1px solid var(--line);background:#fff;color:var(--ink-soft);font-size:12.5px;font-weight:600;transition:.15s;}
.pill-btn:hover{border-color:var(--blue-500);color:var(--blue-600);}
.pill-btn.active{background:var(--blue-600);border-color:var(--blue-600);color:#fff;}

/* ---- Simple tabs (Ledger: Entries / Currencies, etc.) ---- */
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:18px;}
.tab-btn{padding:10px 16px;border:none;background:none;color:var(--ink-soft);font-size:13.5px;font-weight:600;border-bottom:2px solid transparent;margin-bottom:-1px;}
.tab-btn:hover{color:var(--blue-600);}
.tab-btn.active{color:var(--blue-600);border-bottom-color:var(--blue-600);}

.chart-click-hint{font-size:11px;color:var(--ink-faint);font-weight:500;}

/* ---- White / Minimal theme (applied via body.theme-white, set from Settings) ---- */
body.theme-white .sidebar,
/* ---- White / Minimal theme (applied via html.theme-white,
set from Settings) ---- */
html.theme-white .sidebar{
  background:var(--white);
  color:var(--ink);
  border-right:1px solid var(--line);
}
body.theme-white .brand,
html.theme-white .brand{border-bottom-color:var(--line);}
body.theme-white .brand-sub,
html.theme-white .brand-sub{color:var(--ink-faint);}
body.theme-white .nav-item,
html.theme-white .nav-item{color:var(--ink-soft);}
body.theme-white .nav-item:hover,
html.theme-white .nav-item:hover{background:var(--blue-50);color:var(--blue-700);}
body.theme-white .nav-item.active,
html.theme-white .nav-item.active{background:var(--blue-100);color:var(--blue-700);}
body.theme-white .nav-label,
html.theme-white .nav-label{color:var(--ink-faint);}
body.theme-white .user-mini,
html.theme-white .user-mini{border-top-color:var(--line);}
body.theme-white .user-mini .role,
html.theme-white .user-mini .role{color:var(--ink-faint);}

.page-footer{
  text-align:center;padding:16px 16px 18px;font-size:12px;color:var(--ink-faint);
  border-top:1px solid var(--line);background:transparent;margin-top:auto;
}
.page-footer strong{font-weight:600;color:var(--ink-soft);}
.main > .content{flex:1;}

@media(max-width:900px){
  .sidebar{transform:translateX(-100%);transition:transform .2s ease;}
  .sidebar.open{transform:translateX(0);}
  .main{margin-left:0;}
  #mobileToggle{display:inline-flex !important;}
  .topbar{padding:14px 16px;}
  .content{padding:18px 16px;}
  .stat-grid{grid-template-columns:1fr 1fr;}
  .filter-bar{flex-direction:column;align-items:stretch;}
  .filter-bar .export-bar{margin-left:0;justify-content:flex-end;flex-wrap:wrap;}
}

@media(max-width:480px){
  .stat-grid{grid-template-columns:1fr;}
  .modal{width:94vw;}
}

/* ===== Global Search + Notifications bell (topbar) ===== */
.topbar-tools{position:relative;display:flex;gap:8px;align-items:center;}
.gs-wrap{position:relative;}
.gs-input{width:230px;padding:8px 12px 8px 34px;border:1px solid var(--line);border-radius:8px;font-size:13px;font-family:var(--font);background:var(--blue-50);color:var(--ink);}
.gs-input:focus{outline:none;border-color:var(--blue-500);background:var(--white);}
.gs-icon{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--ink-faint);pointer-events:none;}
.gs-dropdown{position:absolute;top:calc(100% + 6px);left:0;width:340px;max-height:380px;overflow-y:auto;background:var(--white);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);z-index:60;}
.gs-item{display:flex;flex-direction:column;gap:2px;padding:10px 14px;border-bottom:1px solid var(--line);cursor:pointer;}
.gs-item:last-child{border-bottom:none;}
.gs-item:hover{background:var(--blue-50);}
.gs-item-title{font-weight:600;font-size:13px;color:var(--ink);}
.gs-item-meta{font-size:11.5px;color:var(--ink-faint);}
.gs-empty{padding:16px;text-align:center;color:var(--ink-faint);font-size:13px;}

.bell-wrap{position:relative;}

/* Agent status (Ready / Not Ready / Break) topbar widget */
.agent-status-wrap{position:relative;}
.agent-status-btn{display:flex;align-items:center;gap:7px;background:var(--white);border:1px solid var(--line);border-radius:20px;padding:6px 12px;font-size:12.5px;font-weight:600;color:var(--ink);cursor:pointer;font-family:var(--font);}
.agent-status-btn:hover{border-color:var(--blue-300,#93c5fd);}
.agent-status-dot{width:8px;height:8px;border-radius:50%;background:#c8ced9;display:inline-block;flex-shrink:0;}
.agent-status-dot.dot-ready{background:var(--success,#16a34a);}
.agent-status-dot.dot-not_ready{background:var(--danger,#dc2626);}
.agent-status-dot.dot-break{background:#e8a23d;}
.agent-status-timer{font-variant-numeric:tabular-nums;color:var(--ink-faint);font-weight:500;}
.agent-status-menu{position:absolute;top:calc(100% + 6px);left:0;width:160px;background:var(--white);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);z-index:60;overflow:hidden;}
.agent-status-menu button{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:9px 12px;background:none;border:none;font-size:13px;font-family:var(--font);color:var(--ink);cursor:pointer;}
.agent-status-menu button:hover{background:var(--blue-50,#eff6ff);}
.bell-dot{position:absolute;top:4px;right:4px;min-width:16px;height:16px;padding:0 4px;background:var(--danger);color:#fff;border-radius:20px;font-size:10px;font-weight:700;display:flex;align-items:center;justify-content:center;}
.bell-dropdown{position:absolute;top:calc(100% + 6px);right:0;width:320px;max-height:400px;overflow-y:auto;background:var(--white);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);z-index:60;}
.bell-head{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--line);}
.bell-head strong{font-size:13px;}
.bell-head button{background:none;border:none;color:var(--blue-600);font-size:12px;cursor:pointer;font-family:var(--font);}
.bell-item{display:block;padding:10px 14px;border-bottom:1px solid var(--line);cursor:pointer;}
.bell-item:last-child{border-bottom:none;}
.bell-item:hover{background:var(--blue-50);}
.bell-item.unread{background:var(--blue-50);}
.bell-item-title{font-weight:600;font-size:12.5px;color:var(--ink);}
.bell-item-msg{font-size:11.5px;color:var(--ink-soft);margin-top:2px;}
.bell-item-time{font-size:10.5px;color:var(--ink-faint);margin-top:3px;}
.bell-empty{padding:20px;text-align:center;color:var(--ink-faint);font-size:13px;}

@media(max-width:900px){
  .gs-input{width:150px;}
}

/* ---- KPI Picker dropdown (dashboard) — additive, does not alter existing rules ---- */
.kpi-picker-wrap{position:relative;}
.kpi-picker-btn{display:flex;align-items:center;gap:7px;padding:8px 14px;border-radius:20px;border:1px solid var(--line);background:#fff;color:var(--ink-soft);font-size:12.5px;font-weight:600;cursor:pointer;font-family:var(--font);transition:.15s;}
.kpi-picker-btn:hover{border-color:var(--blue-500);color:var(--blue-600);}
.kpi-picker-btn.has-filter{border-color:var(--blue-600);color:var(--blue-600);background:var(--blue-50);}
.kpi-picker-count{background:var(--blue-600);color:#fff;border-radius:20px;font-size:10.5px;font-weight:700;padding:1px 6px;min-width:16px;text-align:center;}
.kpi-dropdown{position:absolute;top:calc(100% + 6px);left:0;width:320px;max-height:420px;overflow-y:auto;background:var(--white);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);z-index:70;}
.kpi-dropdown-head{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--white);}
.kpi-dropdown-head strong{font-size:12.5px;}
.kpi-dropdown-head .kpi-actions{display:flex;gap:10px;}
.kpi-dropdown-head button{background:none;border:none;color:var(--blue-600);font-size:11.5px;font-weight:600;cursor:pointer;font-family:var(--font);padding:0;}
.kpi-section-label{padding:8px 14px 4px;font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ink-faint);}
.kpi-check-row{display:flex;align-items:center;gap:9px;padding:6px 14px;cursor:pointer;font-size:12.5px;color:var(--ink);}
.kpi-check-row:hover{background:var(--blue-50);}
.kpi-check-row input{width:15px;height:15px;accent-color:var(--blue-600);cursor:pointer;}
.kpi-live-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--success,#3ED598);margin-right:5px;animation:kpiPulse 1.6s infinite;}
@keyframes kpiPulse{0%{opacity:1;}50%{opacity:.35;}100%{opacity:1;}}
.kpi-live-label{font-size:11.5px;color:var(--ink-faint);display:flex;align-items:center;}
@media(max-width:900px){
  .kpi-dropdown{width:260px;right:0;left:auto;}
}

/* ---- Classic Blue theme (the original look, optional via Settings) ---- */
body.theme-blue,
html.theme-blue{
  --blue-900:#0B2E59;--blue-800:#0F3D74;--blue-700:#14509A;--blue-600:#1B63C4;--blue-500:#2E7AE6;--blue-100:#E8F0FE;--blue-50:#F4F8FF;
  --line:#E1E8F3;--ink:#16233A;--ink-soft:#5B6B85;--ink-faint:#94A1B8;
}
/* ---- system banner (wrong database / version) ---- */
.sys-banner{background:#FDEDED;color:#8a1f1f;border-bottom:2px solid #D64545;padding:10px 18px;font-size:13.5px;line-height:1.5;}
.sys-banner b{color:#b02020;}
.ver-badge{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:10px;background:rgba(255,255,255,.18);font-size:10.5px;font-weight:600;letter-spacing:.3px;}

/* ---- More colour themes (Settings -> Branding & Theme). 'rose' is the default in :root. ---- */
body.theme-emerald,
html.theme-emerald{--blue-900:#073B2A;--blue-800:#0A5039;--blue-700:#0B6B4B;--blue-600:#0E8A5F;--blue-500:#19AE7B;--blue-100:#DDF5EA;--blue-50:#F3FBF7;--line:#D8EBE1;--ink:#122A21;--ink-soft:#4F675C;--ink-faint:#86A093;}
body.theme-purple,
html.theme-purple{--blue-900:#2A1259;--blue-800:#3B1A7C;--blue-700:#502399;--blue-600:#6D3FC4;--blue-500:#8A63DB;--blue-100:#EDE5FB;--blue-50:#F8F5FE;--line:#E4DAF5;--ink:#1E1433;--ink-soft:#5E5276;--ink-faint:#9A8FB0;}
body.theme-teal,
html.theme-teal{--blue-900:#06383E;--blue-800:#0A4F58;--blue-700:#0C6A76;--blue-600:#0E8C99;--blue-500:#1FB0BF;--blue-100:#DAF3F5;--blue-50:#F2FBFC;--line:#D5E9EC;--ink:#10282B;--ink-soft:#4B6569;--ink-faint:#85A0A4;}
body.theme-orange,
html.theme-orange{--blue-900:#5A2108;--blue-800:#7C2F0C;--blue-700:#A33F10;--blue-600:#D9631E;--blue-500:#F08440;--blue-100:#FDE9DA;--blue-50:#FFF7F1;--line:#F3E0D2;--ink:#2B1A10;--ink-soft:#6E5748;--ink-faint:#A89080;}
body.theme-charcoal,
html.theme-charcoal{--blue-900:#1B2130;--blue-800:#252D40;--blue-700:#313B52;--blue-600:#3B4558;--blue-500:#5A6782;--blue-100:#E6E9EF;--blue-50:#F5F6F9;--line:#E0E4EB;--ink:#161B26;--ink-soft:#586075;--ink-faint:#8F97AA;}

/* ---- Logout button (sidebar user card) ---- */
.btn-logout{margin-left:auto;flex-shrink:0;display:inline-flex;align-items:center;gap:4px;padding:6px 8px;border-radius:9px;border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.10);color:#fff;font-size:11.5px;font-weight:600;cursor:pointer;transition:.15s;}
.btn-logout svg{width:14px;height:14px;}
.btn-logout:hover{background:#D64545;border-color:#D64545;}
body.theme-white .btn-logout,
html.theme-white .btn-logout{background:#FDEDED;border-color:#F3C6C6;color:#B03030;}
body.theme-white .btn-logout:hover,
html.theme-white .btn-logout:hover{background:#D64545;border-color:#D64545;color:#fff;}

/* ---- collapsible sidebar groups ---- */
.nav-label-toggle{display:flex;align-items:center;justify-content:space-between;cursor:pointer;user-select:none;border-radius:6px;transition:background .15s;}
.nav-label-toggle:hover{background:rgba(255,255,255,.06);}
.nav-label-toggle .chev{display:inline-flex;transition:transform .2s;opacity:.8;}
.nav-group.open > .nav-label-toggle .chev{transform:rotate(90deg);}
.nav-group:not(.open) > .nav-group-body{display:none;}

/* ---- progress bar (imports / long jobs) and button busy state ---- */
.vx-prog{margin:4px 0 12px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--blue-50)}
.vx-prog-top{display:flex;justify-content:space-between;font-size:13px;color:var(--blue-900);margin-bottom:6px}
.vx-prog-bar{height:8px;border-radius:6px;background:var(--blue-100);overflow:hidden}
.vx-prog-bar i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--blue-600),var(--blue-500));border-radius:6px;transition:width .25s ease}
.vx-prog-line{font-size:12px;color:var(--ink-soft);margin-top:6px}
.vx-busy{position:relative;pointer-events:none;opacity:.75}
.vx-busy::after{content:'';display:inline-block;width:11px;height:11px;margin-left:8px;vertical-align:-1px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:vxspin .7s linear infinite}
@keyframes vxspin{to{transform:rotate(360deg)}}
.vx-pressed{transform:scale(.97);transition:transform .08s}

/* ---- personal display options (Settings -> Display options) ---- */
html.pref-text-s{font-size:14px}html.pref-text-l{font-size:17px}html.pref-text-xl{font-size:18.5px}
html.pref-text-s body{font-size:13px}html.pref-text-l body{font-size:15px}html.pref-text-xl body{font-size:16.5px}
html.pref-compact .card-pad{padding:12px 14px}html.pref-compact table th,html.pref-compact table td{padding-top:6px;padding-bottom:6px}html.pref-compact .btn{padding-top:6px;padding-bottom:6px}html.pref-compact .nav-item{padding-top:6px;padding-bottom:6px}
html.pref-roomy .card-pad{padding:26px 28px}html.pref-roomy table th,html.pref-roomy table td{padding-top:15px;padding-bottom:15px}
html.pref-sharp{--radius:4px}html.pref-sharp .btn,html.pref-sharp .input,html.pref-sharp .select,html.pref-sharp .card{border-radius:4px}
html.pref-round{--radius:20px}html.pref-round .btn,html.pref-round .input,html.pref-round .select{border-radius:999px}html.pref-round .card{border-radius:20px}
html.pref-zebra table tbody tr:nth-child(even){background:var(--blue-50)}
html.pref-nomotion *,html.pref-nomotion *::before,html.pref-nomotion *::after{animation:none!important;transition:none!important}
html.pref-noclickfx .vx-pressed{transform:none}
