/* ==========================================================================
   MegSWIC Enterprise Dashboard — Shared Design System
   Bootstrap 5 + this file is the ONLY styling layer. No build step needed.
   ========================================================================== */

:root{
  --indigo:#4F46E5; --indigo-2:#6366F1; --cyan:#06B6D4; --teal:#0D9488;
  --sky:#0EA5E9; --purple:#8B5CF6; --emerald:#10B981; --amber:#F59E0B; --rose:#F43F5E;

  --bg:#EEF2FA; --surface:#FFFFFF; --surface-2:#F7F9FD; --border:#E4E9F5;
  --text:#0F1729; --text-muted:#64748B; --text-soft:#94A3B8;

  --radius-lg:20px; --radius-md:14px; --radius-sm:10px;
  --shadow-sm:0 1px 2px rgba(15,23,42,.04),0 1px 3px rgba(15,23,42,.06);
  --shadow-md:0 4px 14px rgba(15,23,42,.06),0 1px 3px rgba(15,23,42,.04);
  --shadow-lg:0 20px 40px -12px rgba(30,41,89,.18);
  --sidebar-w:272px; --sidebar-w-collapsed:82px; --topbar-h:72px;
}
[data-theme="dark"]{
  --bg:#0B1120; --surface:#131B2E; --surface-2:#0F1626; --border:#232E48;
  --text:#EAF0FF; --text-muted:#9AA9C7; --text-soft:#67759A;
  --shadow-lg:0 20px 45px -12px rgba(0,0,0,.55);
}
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{margin:0;background:var(--bg);color:var(--text);font-family:'Inter',system-ui,sans-serif;font-size:14.5px;-webkit-font-smoothing:antialiased;transition:background .3s ease,color .3s ease;}
h1,h2,h3,h4,.display-num,.brand-word{font-family:'Poppins',sans-serif;}
a{text-decoration:none;color:inherit;}
button{font-family:inherit;}
@media (prefers-reduced-motion: reduce){*{animation-duration:.001ms !important;transition-duration:.001ms !important;}}

/* ---------------- SHELL ---------------- */
.app-shell{display:flex;min-height:100vh;}
.sidebar-logo{
    width:165px;
    height:52px;
    object-fit:contain;
    transition:all .25s ease;
}

.sidebar.collapsed .sidebar-logo{
    width:42px;
    height:42px;
}


.logo-link{
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.logo-link:hover{
    color: inherit;
}

.sidebar{width:var(--sidebar-w);flex-shrink:0;background:var(--surface);border-right:1px solid var(--border);position:fixed;top:0;left:0;bottom:0;display:flex;flex-direction:column;z-index:1030;transition:width .28s cubic-bezier(.4,0,.2,1),transform .28s ease;}
.sidebar.collapsed{width:var(--sidebar-w-collapsed);}
.sidebar-head{height:var(--topbar-h);display:flex;align-items:center;gap:.65rem;padding:0 1.35rem;border-bottom:1px solid var(--border);flex-shrink:0;}
.brand-mark{width:38px;height:38px;border-radius:11px;flex-shrink:0;background:linear-gradient(135deg,var(--indigo) 0%,var(--cyan) 100%);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:16px;font-family:'Poppins',sans-serif;box-shadow:0 6px 16px -4px rgba(79,70,229,.55);}
.brand-text{overflow:hidden;white-space:nowrap;transition:opacity .2s ease,width .2s ease;}
.brand-word{font-weight:700;font-size:16.5px;line-height:1.1;letter-spacing:-.2px;}
.brand-sub{font-size:10.5px;color:var(--text-soft);font-weight:600;letter-spacing:.4px;text-transform:uppercase;}
.sidebar.collapsed .brand-text{opacity:0;width:0;}
.sidebar-scroll{flex:1;overflow-y:auto;padding:14px 12px 20px;}
.sidebar-scroll::-webkit-scrollbar{width:5px;}
.sidebar-scroll::-webkit-scrollbar-thumb{background:var(--border);border-radius:10px;}
.nav-group{margin-bottom:2px;}
.nav-link-item{display:flex;align-items:center;gap:.8rem;padding:.62rem .75rem;border-radius:var(--radius-sm);color:var(--text-muted);font-weight:600;font-size:13.6px;cursor:pointer;position:relative;transition:background .16s ease,color .16s ease;white-space:nowrap;}
.nav-link-item:hover{background:var(--surface-2);color:var(--text);}
.nav-link-item.active{background:linear-gradient(90deg,rgba(79,70,229,.12),rgba(6,182,212,.06));color:var(--indigo);}
.nav-link-item.active .nav-ic{color:var(--indigo);}
.nav-ic{width:19px;text-align:center;flex-shrink:0;font-size:16px;color:var(--text-soft);}
.nav-label{flex:1;overflow:hidden;text-overflow:ellipsis;}
.nav-caret{font-size:11px;transition:transform .2s ease;color:var(--text-soft);}
.nav-group.open>.nav-link-item .nav-caret{transform:rotate(90deg);}
.sidebar.collapsed .nav-label,.sidebar.collapsed .nav-caret{display:none;}
.sidebar.collapsed .nav-link-item{justify-content:center;}
.sub-nav{max-height:0;overflow:hidden;transition:max-height .28s ease;padding-left:2.55rem;border-left:1px dashed var(--border);margin-left:1.55rem;}
.nav-group.open>.sub-nav{max-height:600px;}
.sub-nav a{display:block;padding:.44rem .5rem;font-size:12.9px;font-weight:500;color:var(--text-muted);border-radius:8px;}
.sub-nav a:hover{color:var(--indigo);background:var(--surface-2);}
.sub-nav a.active{color:var(--indigo);font-weight:700;background:var(--surface-2);}
.sub-nav .sub-head{font-size:11px;text-transform:uppercase;letter-spacing:.5px;font-weight:700;color:var(--text-soft);margin:6px 0 2px;}
.sidebar.collapsed .sub-nav{display:none;}
.sidebar-foot{padding:14px;border-top:1px solid var(--border);flex-shrink:0;}
.upgrade-card{border-radius:var(--radius-md);padding:14px;background:linear-gradient(135deg,var(--indigo),var(--purple) 120%);color:#fff;position:relative;overflow:hidden;}
.upgrade-card::after{content:"";position:absolute;width:90px;height:90px;border-radius:50%;background:rgba(255,255,255,.15);top:-30px;right:-30px;}
.sidebar.collapsed .upgrade-card{display:none;}

.main-col{flex:1;margin-left:var(--sidebar-w);transition:margin-left .28s cubic-bezier(.4,0,.2,1);min-width:0;}
.main-col.collapsed{margin-left:var(--sidebar-w-collapsed);}
.topbar{height:var(--topbar-h);position:sticky;top:0;z-index:1020;background:color-mix(in srgb,var(--surface) 88%,transparent);backdrop-filter:blur(14px);border-bottom:1px solid var(--border);display:flex;align-items:center;gap:14px;padding:0 22px;}
.icon-btn{width:40px;height:40px;border-radius:12px;border:1px solid var(--border);background:var(--surface);color:var(--text-muted);display:flex;align-items:center;justify-content:center;font-size:16px;cursor:pointer;transition:all .15s ease;flex-shrink:0;}
.icon-btn:hover{background:var(--surface-2);color:var(--indigo);border-color:var(--indigo);}
.icon-btn:active{transform:scale(.92);}
.search-trigger{flex:1;max-width:420px;height:42px;border-radius:12px;border:1px solid var(--border);background:var(--surface-2);color:var(--text-soft);display:flex;align-items:center;gap:10px;padding:0 14px;cursor:pointer;font-size:13.4px;font-weight:500;}
.search-trigger:hover{border-color:var(--indigo);}
.kbd{margin-left:auto;font-size:10.5px;font-weight:700;color:var(--text-soft);border:1px solid var(--border);border-radius:6px;padding:2px 6px;background:var(--surface);}
.topbar-right{margin-left:auto;display:flex;align-items:center;gap:10px;}
.badge-dot{position:absolute;top:6px;right:6px;width:8px;height:8px;border-radius:50%;background:var(--rose);border:2px solid var(--surface);}
.profile-chip{display:flex;align-items:center;gap:10px;padding:6px 12px 6px 6px;border-radius:14px;border:1px solid var(--border);background:var(--surface);cursor:pointer;}
.avatar{width:32px;height:32px;border-radius:9px;background:linear-gradient(135deg,var(--cyan),var(--indigo));display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:12.5px;}

.page{padding:24px 26px 90px;}
.breadcrumb-row{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:20px;}
.crumb{font-size:12.8px;color:var(--text-soft);font-weight:600;}
.crumb b{color:var(--text);}
.page-title{font-size:23px;font-weight:700;letter-spacing:-.3px;margin:2px 0 0;}

.btn-grad{border:none;color:#fff;font-weight:600;font-size:13.2px;padding:10px 18px;border-radius:11px;background:linear-gradient(135deg,var(--indigo),var(--indigo-2));box-shadow:0 8px 18px -6px rgba(79,70,229,.55);display:inline-flex;align-items:center;gap:8px;transition:transform .15s ease,box-shadow .15s ease;}
.btn-grad:hover{transform:translateY(-1px);box-shadow:0 10px 22px -6px rgba(79,70,229,.65);color:#fff;}
.btn-grad.green{background:linear-gradient(135deg,var(--emerald),var(--teal));box-shadow:0 8px 18px -6px rgba(16,185,129,.5);}
.btn-grad.rose{background:linear-gradient(135deg,var(--rose),#be123c);box-shadow:0 8px 18px -6px rgba(244,63,94,.5);}
.btn-ghost{border:1px solid var(--border);background:var(--surface);color:var(--text-muted);font-weight:600;font-size:13.2px;padding:10px 16px;border-radius:11px;display:inline-flex;align-items:center;gap:8px;cursor:pointer;}
.btn-ghost:hover{border-color:var(--indigo);color:var(--indigo);}
.btn-sm-ic{width:32px;height:32px;border-radius:9px;border:1px solid var(--border);background:var(--surface);display:inline-flex;align-items:center;justify-content:center;color:var(--text-muted);cursor:pointer;}
.btn-sm-ic:hover{color:var(--indigo);border-color:var(--indigo);}

.filter-bar{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);padding:14px 16px;display:flex;align-items:center;gap:14px;flex-wrap:wrap;box-shadow:var(--shadow-sm);margin-bottom:22px;position:sticky;top:calc(var(--topbar-h) + 14px);z-index:5;}
.field-float{position:relative;min-width:200px;flex:1;}
.field-float select,.field-float input{width:100%;height:46px;border-radius:11px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);padding:14px 12px 0;font-size:13.6px;font-weight:600;appearance:none;}
.field-float textarea{width:100%;border-radius:11px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);padding:18px 12px 8px;font-size:13.6px;font-weight:500;}
.field-float label{position:absolute;left:12px;top:6px;font-size:10.3px;font-weight:700;color:var(--text-soft);text-transform:uppercase;letter-spacing:.4px;}
.field-float i.chev{position:absolute;right:14px;top:16px;color:var(--text-soft);pointer-events:none;}
.field-float .pw-toggle{position:absolute;right:12px;top:14px;color:var(--text-soft);cursor:pointer;}

.kpi-row{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:22px;}
.kpi-card{position:relative;overflow:hidden;border-radius:var(--radius-lg);padding:20px 20px 16px;color:#fff;min-height:150px;box-shadow:var(--shadow-md);transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s ease;}
.kpi-card:hover{transform:translateY(-5px);box-shadow:var(--shadow-lg);}
.kpi-card.c1{background:linear-gradient(135deg,#4F46E5 0%,#4338CA 55%,#312E81 100%);}
.kpi-card.c2{background:linear-gradient(135deg,#0D9488 0%,#0891B2 60%,#0369A1 100%);}
.kpi-card.c3{background:linear-gradient(135deg,#7C3AED 0%,#6D28D9 55%,#4C1D95 100%);}
.kpi-card.c4{background:linear-gradient(135deg,#F59E0B 0%,#EA580C 60%,#C2410C 100%);}
.kpi-card::before{content:"";position:absolute;width:170px;height:170px;border-radius:50%;background:rgba(255,255,255,.09);top:-70px;right:-50px;}
.kpi-top{display:flex;align-items:flex-start;justify-content:space-between;}
.kpi-icon{width:42px;height:42px;border-radius:12px;background:rgba(255,255,255,.18);display:flex;align-items:center;justify-content:center;font-size:19px;backdrop-filter:blur(6px);}
.kpi-trend{font-size:11.3px;font-weight:700;padding:4px 9px;border-radius:20px;background:rgba(255,255,255,.18);display:flex;align-items:center;gap:4px;}
.kpi-num{font-size:34px;font-weight:800;letter-spacing:-1px;margin-top:14px;line-height:1;}
.kpi-label{font-size:12.3px;font-weight:600;opacity:.88;margin-top:5px;text-transform:uppercase;letter-spacing:.3px;}
.kpi-spark{position:absolute;bottom:0;left:0;right:0;height:38px;opacity:.85;}
.pulse-dot{width:7px;height:7px;border-radius:50%;background:#4ADE80;display:inline-block;animation:pulse 2s infinite;}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(74,222,128,.55);}70%{box-shadow:0 0 0 8px rgba(74,222,128,0);}100%{box-shadow:0 0 0 0 rgba(74,222,128,0);}}

.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:20px;}
.panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;flex-wrap:wrap;gap:10px;}
.panel-title{font-size:15px;font-weight:700;display:flex;align-items:center;gap:8px;}
.panel-title .sw{width:8px;height:8px;border-radius:2px;background:var(--indigo);}
.panel-sub{font-size:11.8px;color:var(--text-soft);font-weight:500;}
.chip-tab{font-size:11.6px;font-weight:600;padding:5px 11px;border-radius:8px;color:var(--text-muted);cursor:pointer;}
.chip-tab.active{background:var(--surface-2);color:var(--indigo);}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px;}

.tile-row{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;}
.tile{border:1px solid var(--border);border-radius:var(--radius-md);padding:14px 15px;background:var(--surface-2);display:flex;align-items:center;gap:12px;transition:transform .18s ease,border-color .18s ease;}
.tile:hover{transform:translateY(-3px);border-color:var(--indigo);}
.tile-ic{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0;color:#fff;}
.tile-num{font-size:19px;font-weight:800;line-height:1;}
.tile-lbl{font-size:10.8px;color:var(--text-soft);font-weight:700;text-transform:uppercase;letter-spacing:.3px;margin-top:3px;}
.section-label{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.6px;color:var(--text-soft);margin:26px 0 12px;display:flex;align-items:center;gap:10px;}
.section-label::after{content:"";flex:1;height:1px;background:var(--border);}

.prog-item{margin-bottom:14px;}
.prog-top{display:flex;justify-content:space-between;font-size:12.6px;font-weight:600;margin-bottom:6px;}
.prog-track{height:8px;border-radius:20px;background:var(--surface-2);overflow:hidden;}
.prog-fill{height:100%;border-radius:20px;background:linear-gradient(90deg,var(--indigo),var(--cyan));}

.alert-item{display:flex;gap:12px;padding:11px 0;border-bottom:1px solid var(--border);}
.alert-item:last-child{border-bottom:none;}
.alert-ic{width:34px;height:34px;border-radius:10px;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:15px;}
.alert-txt strong{font-size:12.9px;font-weight:700;display:block;}
.alert-txt span{font-size:11.6px;color:var(--text-soft);}
.alert-time{margin-left:auto;font-size:10.8px;color:var(--text-soft);white-space:nowrap;}

.map-box{height:290px;border-radius:var(--radius-md);position:relative;overflow:hidden;background:radial-gradient(circle at 20% 30%,rgba(79,70,229,.18),transparent 45%),radial-gradient(circle at 80% 70%,rgba(6,182,212,.18),transparent 45%),var(--surface-2);border:1px dashed var(--border);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;}
.map-pin{position:absolute;width:11px;height:11px;border-radius:50%;box-shadow:0 0 0 5px rgba(255,255,255,.5);}

/* ---------------- TABS (page-level section switcher) ---------------- */
.tab-pills{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px;}
.tab-pill{padding:9px 16px;border-radius:11px;border:1px solid var(--border);background:var(--surface);font-size:12.8px;font-weight:700;color:var(--text-muted);cursor:pointer;transition:all .15s ease;}
.tab-pill:hover{border-color:var(--indigo);color:var(--indigo);}
.tab-pill.active{background:linear-gradient(135deg,var(--indigo),var(--indigo-2));color:#fff;border-color:transparent;box-shadow:0 8px 16px -6px rgba(79,70,229,.5);}
.tab-pane{display:none;}
.tab-pane.active{display:block;animation:fadeUp .35s ease;}
@keyframes fadeUp{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:translateY(0);}}
.subtab-row{display:flex;gap:6px;background:var(--surface-2);padding:5px;border-radius:12px;width:max-content;margin-bottom:18px;}
.subtab{padding:7px 14px;border-radius:9px;font-size:12.3px;font-weight:700;color:var(--text-muted);cursor:pointer;}
.subtab.active{background:var(--surface);color:var(--indigo);box-shadow:var(--shadow-sm);}

/* ---------------- PREMIUM TABLE ---------------- */
.ptable-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);overflow:hidden;}
.ptable-head{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--border);gap:12px;flex-wrap:wrap;}
.ptable-search{position:relative;min-width:240px;flex:1;max-width:320px;}
.ptable-search input{width:100%;height:40px;border-radius:10px;border:1px solid var(--border);background:var(--surface-2);padding:0 14px 0 36px;font-size:13px;color:var(--text);}
.ptable-search i{position:absolute;left:12px;top:11px;color:var(--text-soft);font-size:14px;}
.ptable-scroll{overflow-x:auto;}
table.ptable{width:100%;border-collapse:collapse;font-size:13px;min-width:720px;}
table.ptable thead th{position:sticky;top:0;background:var(--surface-2);color:var(--text-muted);font-weight:700;font-size:11px;text-transform:uppercase;letter-spacing:.4px;padding:12px 14px;text-align:left;white-space:nowrap;cursor:pointer;user-select:none;border-bottom:1px solid var(--border);}
table.ptable thead th i{margin-left:5px;font-size:10px;color:var(--text-soft);}
table.ptable thead th.sticky-col, table.ptable tbody td.sticky-col{position:sticky;left:0;background:var(--surface);z-index:2;}
table.ptable tbody td{padding:11px 14px;border-bottom:1px solid var(--border);white-space:nowrap;color:var(--text);}
table.ptable tbody tr{transition:background .12s ease;}
table.ptable tbody tr:hover{background:var(--surface-2);}
table.ptable tbody tr:last-child td{border-bottom:none;}
.ptable-foot{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;flex-wrap:wrap;gap:10px;border-top:1px solid var(--border);}
.ptable-info{font-size:12px;color:var(--text-soft);font-weight:600;}
.pager{display:flex;gap:6px;}
.pager button{width:32px;height:32px;border-radius:9px;border:1px solid var(--border);background:var(--surface);color:var(--text-muted);font-size:12.5px;font-weight:700;cursor:pointer;}
.pager button.active{background:var(--indigo);color:#fff;border-color:var(--indigo);}
.pager button:disabled{opacity:.4;cursor:not-allowed;}
.skeleton-row td{padding:14px;}
.skeleton-bar{height:12px;border-radius:6px;background:linear-gradient(90deg,var(--surface-2) 25%,var(--border) 50%,var(--surface-2) 75%);background-size:200% 100%;animation:shimmer 1.4s infinite;}
@keyframes shimmer{0%{background-position:200% 0;}100%{background-position:-200% 0;}}
.empty-state{padding:60px 20px;text-align:center;color:var(--text-soft);}
.empty-state i{font-size:34px;display:block;margin-bottom:10px;}

/* ---------------- BADGES ---------------- */
.badge-pill{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:700;padding:4px 10px;border-radius:20px;}
.badge-green{background:rgba(16,185,129,.12);color:#059669;}
.badge-amber{background:rgba(245,158,11,.14);color:#B45309;}
.badge-orange{background:rgba(234,88,12,.14);color:#C2410C;}
.badge-red{background:rgba(244,63,94,.13);color:#BE123C;}
.badge-blue{background:rgba(14,165,233,.13);color:#0369A1;}
.badge-purple{background:rgba(139,92,246,.14);color:#6D28D9;}
.badge-gray{background:rgba(100,116,139,.12);color:#475569;}

/* ---------------- FORMS ---------------- */
.form-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:26px;}
.upload-drop{border:2px dashed var(--border);border-radius:var(--radius-md);padding:28px;text-align:center;color:var(--text-soft);cursor:pointer;transition:border-color .15s ease;}
.upload-drop:hover,.upload-drop.dragover{border-color:var(--indigo);color:var(--indigo);background:var(--surface-2);}
.helper-text{font-size:11.3px;color:var(--text-soft);margin-top:5px;}
.invalid-msg{font-size:11.3px;color:var(--rose);margin-top:5px;display:none;font-weight:600;}
.field-float.is-invalid input,.field-float.is-invalid select{border-color:var(--rose);}
.field-float.is-invalid .invalid-msg{display:block;}
.field-float.is-valid input{border-color:var(--emerald);}

/* ---------------- GAUGE / QUALITY ---------------- */
.gauge-wrap{position:relative;width:150px;height:150px;margin:0 auto;}
.gauge-num{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;}
.gauge-num b{font-size:26px;font-weight:800;}
.gauge-num span{font-size:10.5px;color:var(--text-soft);font-weight:700;text-transform:uppercase;}

/* ---------------- MISC ---------------- */
.avatar-card{width:44px;height:44px;border-radius:12px;background:linear-gradient(135deg,var(--purple),var(--indigo));display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:14px;flex-shrink:0;}
.user-card{display:flex;gap:14px;padding:16px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-2);align-items:center;}
.timeline{position:relative;padding-left:26px;}
.timeline::before{content:"";position:absolute;left:8px;top:4px;bottom:4px;width:2px;background:var(--border);}
.timeline-item{position:relative;padding-bottom:20px;}
.timeline-item::before{content:"";position:absolute;left:-26px;top:2px;width:14px;height:14px;border-radius:50%;background:var(--surface);border:3px solid var(--indigo);}
.timeline-item .t-time{font-size:10.7px;color:var(--text-soft);font-weight:700;text-transform:uppercase;}
.timeline-item .t-title{font-size:13px;font-weight:700;margin-top:2px;}
.timeline-item .t-desc{font-size:12px;color:var(--text-muted);margin-top:2px;}

.cmdk-backdrop{position:fixed;inset:0;background:rgba(10,14,30,.55);backdrop-filter:blur(3px);z-index:2000;display:none;align-items:flex-start;justify-content:center;padding-top:12vh;}
.cmdk-backdrop.show{display:flex;}
.cmdk-box{width:100%;max-width:560px;background:var(--surface);border-radius:16px;border:1px solid var(--border);box-shadow:var(--shadow-lg);overflow:hidden;}
.cmdk-input{width:100%;border:none;padding:18px 20px;font-size:15px;background:transparent;color:var(--text);border-bottom:1px solid var(--border);outline:none;}
.cmdk-list{max-height:340px;overflow-y:auto;padding:8px;}
.cmdk-row{display:flex;align-items:center;gap:12px;padding:11px 12px;border-radius:10px;cursor:pointer;font-size:13.4px;font-weight:600;}
.cmdk-row:hover,.cmdk-row.kb-active{background:var(--surface-2);}
.cmdk-row i{color:var(--indigo);width:18px;}
.cmdk-row small{margin-left:auto;color:var(--text-soft);font-weight:500;}

.fab{position:fixed;bottom:26px;right:26px;z-index:1010;width:56px;height:56px;border-radius:50%;border:none;background:linear-gradient(135deg,var(--indigo),var(--purple));color:#fff;font-size:22px;box-shadow:0 12px 28px -8px rgba(79,70,229,.6);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform .2s ease;}
.fab:hover{transform:scale(1.08) rotate(90deg);}
.fab-menu{position:fixed;bottom:92px;right:26px;z-index:1010;display:flex;flex-direction:column;gap:10px;align-items:flex-end;opacity:0;pointer-events:none;transform:translateY(10px);transition:all .2s ease;}
.fab-menu.show{opacity:1;pointer-events:auto;transform:translateY(0);}
.fab-item{display:flex;align-items:center;gap:10px;background:var(--surface);border:1px solid var(--border);padding:8px 14px 8px 8px;border-radius:30px;box-shadow:var(--shadow-md);font-size:12.4px;font-weight:700;cursor:pointer;}
.fab-item i{width:30px;height:30px;border-radius:50%;background:var(--surface-2);display:flex;align-items:center;justify-content:center;color:var(--indigo);}

.toast-wrap{position:fixed;top:90px;right:24px;z-index:2100;display:flex;flex-direction:column;gap:10px;}
.mini-toast{background:var(--surface);border:1px solid var(--border);border-left:4px solid var(--emerald);border-radius:12px;padding:12px 16px;box-shadow:var(--shadow-lg);font-size:13px;font-weight:600;display:flex;align-items:center;gap:10px;min-width:270px;animation:slideIn .3s ease;}
@keyframes slideIn{from{transform:translateX(30px);opacity:0;}to{transform:translateX(0);opacity:1;}}

.modal-content{border-radius:18px;border:1px solid var(--border);background:var(--surface);color:var(--text);}
.modal-header{border-bottom:1px solid var(--border);}
.modal-footer{border-top:1px solid var(--border);}
[data-theme="dark"] .btn-close{filter:invert(1);}

@media (max-width:1180px){.kpi-row{grid-template-columns:repeat(2,1fr);}.grid-2{grid-template-columns:1fr;}.tile-row{grid-template-columns:repeat(2,1fr);}}
@media (max-width:860px){.sidebar{transform:translateX(-100%);}.sidebar.mobile-open{transform:translateX(0);width:var(--sidebar-w);}.main-col,.main-col.collapsed{margin-left:0;}.kpi-row{grid-template-columns:1fr;}.tile-row{grid-template-columns:repeat(2,1fr);}.search-trigger{display:none;}}

/* ============================================================
   ROUND 2 — Notification & Profile dropdowns, breadcrumb,
   compact donut layout, accessibility, misc polish
   ============================================================ */

/* ---- Skip link (accessibility) ---- */
.skip-link{position:absolute;left:-999px;top:0;background:var(--indigo);color:#fff;padding:10px 16px;border-radius:0 0 10px 0;z-index:5000;font-weight:700;font-size:13px;}
.skip-link:focus{left:0;}

/* ---- Focus visibility (accessibility) ---- */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible{
  outline:2.5px solid var(--indigo); outline-offset:2px; border-radius:6px;
}

/* ---- Breadcrumb trail ---- */
.crumb{font-size:12.6px;color:var(--text-soft);font-weight:600;display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.crumb a{color:var(--text-soft);}
.crumb a:hover{color:var(--indigo);}
.crumb b{color:var(--text);font-weight:700;}
.crumb i{font-size:9px;}

/* ---- Refresh spin ---- */
@keyframes spinOnce{ to{ transform:rotate(360deg); } }
.spin-anim{ animation:spinOnce .6s linear; display:inline-block; }

/* ---- Notification dropdown ---- */
.notif-menu{width:320px;border-radius:16px;border:1px solid var(--border);padding:0;overflow:hidden;box-shadow:var(--shadow-lg);}
.notif-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;font-weight:700;font-size:13px;border-bottom:1px solid var(--border);}
.notif-head .notif-mark-read{font-size:11px;font-weight:600;color:var(--indigo);}
.notif-item{display:flex;align-items:flex-start;gap:11px;padding:12px 16px;border-bottom:1px solid var(--border);transition:background .12s ease;}
.notif-item:hover{background:var(--surface-2);}
.notif-item:last-of-type{border-bottom:none;}
.notif-ic{width:32px;height:32px;border-radius:9px;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:14px;}
.notif-ic-red{background:rgba(244,63,94,.12);color:var(--rose);}
.notif-ic-amber{background:rgba(245,158,11,.14);color:var(--amber);}
.notif-ic-purple{background:rgba(139,92,246,.14);color:var(--purple);}
.notif-ic-cyan{background:rgba(6,182,212,.13);color:var(--cyan);}
.notif-body{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0;}
.notif-body b{font-size:12.4px;font-weight:700;color:var(--text);}
.notif-body small{font-size:11px;color:var(--text-soft);font-weight:500;}
.notif-unread{width:7px;height:7px;border-radius:50%;background:var(--indigo);flex-shrink:0;margin-top:5px;}
.notif-foot{padding:11px 16px;text-align:center;font-size:12px;font-weight:700;}
.notif-foot a{color:var(--indigo);}

/* ---- Profile dropdown ---- */
.profile-menu{width:280px;border-radius:16px;border:1px solid var(--border);padding:8px;box-shadow:var(--shadow-lg);}
.profile-menu-head{display:flex;align-items:center;gap:12px;padding:10px 8px 14px;border-bottom:1px solid var(--border);margin-bottom:6px;}
.profile-menu-item{display:flex;align-items:center;gap:11px;padding:9px 10px;border-radius:11px;font-size:13px;font-weight:600;color:var(--text-muted);transition:background .13s ease,color .13s ease,transform .13s ease;}
.profile-menu-item i{width:18px;text-align:center;font-size:15px;color:var(--text-soft);}
.profile-menu-item:hover{background:var(--surface-2);color:var(--indigo);transform:translateX(2px);}
.profile-menu-item:hover i{color:var(--indigo);}
.profile-menu-item.danger{color:var(--rose);}
.profile-menu-item.danger i{color:var(--rose);}
.profile-menu-item.danger:hover{background:rgba(244,63,94,.08);}
.profile-menu-divider{height:1px;background:var(--border);margin:6px 4px;}
.form-check.form-switch .form-check-input{width:2.4em;height:1.3em;cursor:pointer;}


.sensor-table-wrap{
    flex:1;
    margin-left:18px;
}

.sensor-table{
    width:100%;
    border-collapse:collapse;
}

.sensor-table thead th{
    padding:8px 10px;
    border-bottom:1px solid var(--border);
    font-size:11px;
    color:var(--text-soft);
    text-transform:uppercase;
}

.sensor-table thead th:first-child{
    text-align:left;
}

.sensor-table thead th:nth-child(2),
.sensor-table thead th:nth-child(3){
    text-align:center;
}
.sensor-table tbody td{
    padding:10px;
    border-bottom:1px solid var(--border);
    font-size:13px;
}

.sensor-table tbody tr:last-child td{
    border-bottom:none;
}

.sensor-table td:nth-child(2),
.sensor-table td:nth-child(3){
    text-align:right;
    font-weight:700;
}

.sensor-dot{
    width:10px;
    height:10px;
    border-radius:50%;
    display:inline-block;
    margin-right:8px;
    vertical-align:middle;
}

.sensor-name{
    display:flex;
    align-items:center;
}

.sensor-table tbody tr:hover{
    background:var(--surface-2);
}



.sensor-table th:nth-child(2),
.sensor-table th:nth-child(3),
.sensor-table td:nth-child(2),
.sensor-table td:nth-child(3){
    text-align:center;
    font-weight:700;
    width:90px;
}


/* ---- Shortcuts modal ---- */
.shortcut-row{display:flex;align-items:center;justify-content:space-between;padding:9px 0;border-bottom:1px solid var(--border);font-size:13px;font-weight:600;color:var(--text-muted);}
.shortcut-row:last-child{border-bottom:none;}

/* ---- Compact donut chart layout (fixes oversized charts) ---- */
.donut-compact{display:flex;align-items:center;gap:22px;}
.donut-compact-canvas-wrap{position:relative;width:118px;height:118px;flex-shrink:0;}
.donut-compact-canvas-wrap canvas{width:118px !important;height:118px !important;}
.donut-center-label{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none;}
.donut-center-label b{font-size:18px;font-weight:800;line-height:1;}
.donut-center-label span{font-size:9px;color:var(--text-soft);font-weight:700;text-transform:uppercase;letter-spacing:.3px;margin-top:2px;}
.donut-legend{flex:1;display:flex;flex-direction:column;gap:9px;min-width:0;}
.donut-legend-row{display:flex;align-items:center;gap:9px;font-size:12.4px;font-weight:600;}
.donut-legend-dot{width:9px;height:9px;border-radius:3px;flex-shrink:0;}
.donut-legend-name{flex:1;color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.donut-legend-val{font-weight:800;color:var(--text);}
@media (max-width:520px){ .donut-compact{flex-direction:column;align-items:flex-start;} }
