:root{
  --bg:#12061f;
  --bg-soft:#180d33;
  --bg-soft-2:#1d1244;
  --panel:#16122f;
  --panel-2:#1a163f;
  --card:#15162f;
  --card-2:#1d1f45;
  --line:rgba(255,255,255,.08);
  --line-strong:rgba(255,255,255,.16);
  --muted:rgba(255,255,255,.68);
  --text:rgba(255,255,255,.95);
  --text-soft:rgba(255,255,255,.78);

  --blue-900:#2d0844;
  --blue-800:#4b0b69;
  --blue-700:#67108c;
  --blue-600:#8116ab;
  --blue-500:#9e22c7;
  --blue-400:#bd63df;
  --blue-300:#ddb0f1;

  --slate-900:#120c18;
  --slate-800:#1b1324;
  --slate-700:#2a1c37;
  --slate-600:#433154;
  --slate-500:#736186;
  --slate-400:#aa9bb9;
  --slate-300:#dbd0e6;

  --brand:var(--blue-500);
  --brand2:var(--blue-400);
  --brand-ink:#06111d;
  --brand-soft:rgba(47,125,207,.18);
  --brand-soft-2:rgba(47,125,207,.28);
  --surface-overlay:rgba(255,255,255,.03);

  --ok:#54d6ff;
  --warn:#facc15;
  --bad:#ef4444;
  --info:#38bdf8;
  --focus:rgba(189,99,223,.26);

  --shadow-sm:0 10px 24px rgba(0,0,0,.25);
  --shadow:0 18px 40px rgba(0,0,0,.42);
  --shadow-lg:0 26px 60px rgba(0,0,0,.5);
  --radius-sm:12px;
  --radius:16px;
  --radius-lg:30px;

  --space-1:4px;
  --space-2:8px;
  --space-3:12px;
  --space-4:16px;
  --space-5:20px;
  --space-6:24px;
  --space-7:32px;
  --space-8:40px;
  --gap-xs:var(--space-2);
  --gap-sm:var(--space-3);
  --gap:var(--space-4);
  --gap-lg:22px;
  --pad-sm:14px;
  --pad:20px;
  --pad-lg:28px;

  --font-sans:"Inter","Segoe UI Variable","Bahnschrift","Segoe UI",Tahoma,system-ui,sans-serif;
  --font-body:14px;
  --font-caption:12px;
  --font-h2:clamp(24px, 2vw, 32px);
  --font-h3:18px;
  --line-height-body:1.5;

  --sidebar-w:280px;
  --control-h:44px;
  --shell-max:1400px;
  --dock-h:72px;
}

*{box-sizing:border-box}
html,body{height:100%}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:var(--font-sans);
  background:
    radial-gradient(1200px 780px at 14% -6%, rgba(158,34,199,.30), transparent 51%),
    radial-gradient(900px 540px at 88% 4%, rgba(189,99,223,.18), transparent 56%),
    linear-gradient(180deg, #210b34 0%, #13061f 42%, #0b0412 100%);
  color:var(--text);
  font-size:var(--font-body);
  line-height:var(--line-height-body);
}

a{
  color:inherit;
}

img{
  max-width:100%;
  display:block;
}

button,
input,
select,
textarea{
  font:inherit;
}

button{
  cursor:pointer;
}

/* =========================
   Layout
========================= */
.container{
  display:flex;
  min-height:100vh;
  width:100%;
  align-items:stretch;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0) 160px),
    linear-gradient(180deg, rgba(40,16,58,.88), rgba(8,10,24,.82));
  position:relative;
}

.container::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size:100% 38px, 38px 100%;
  mask-image:linear-gradient(180deg, rgba(0,0,0,.24), rgba(0,0,0,.08) 35%, transparent 80%);
  opacity:.32;
}

.main{
  flex:1;
  min-width:0;
  padding:22px 24px 30px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0) 120px),
    linear-gradient(180deg, rgba(24,10,44,.55), rgba(8,10,24,.24) 220px, rgba(8,10,24,0));
}

.page-shell{
  width:min(100%, var(--shell-max));
  margin:0 auto;
  padding:8px 0 0;
  position:relative;
}

.page-shell::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:30px;
  pointer-events:none;
  background:
    radial-gradient(900px 240px at 0% 0%, rgba(255,255,255,.03), transparent 60%),
    radial-gradient(520px 180px at 100% 0%, rgba(189,99,223,.16), transparent 62%);
  opacity:.92;
}

/* =========================
   Sidebar
========================= */
.sidebar{
  width:var(--sidebar-w);
  height:100vh;
  position:sticky;
  top:0;
  display:flex;
  flex-direction:column;
  padding:20px 16px;
  border-right:1px solid rgba(255,255,255,.07);
  background:
    linear-gradient(180deg, rgba(185,44,208,.18), rgba(44,10,78,.24)),
    linear-gradient(180deg, rgba(10,6,20,.98), rgba(5,7,18,.995));
  backdrop-filter:blur(16px);
  box-shadow:inset -1px 0 0 rgba(255,255,255,.02);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-radius:14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.01)),
    radial-gradient(circle at 10% 30%, rgba(158,34,199,.16), transparent 40%);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 18px 30px rgba(44,6,96,.14);
}

.brand h1{
  margin:0;
  font-size:16px;
  letter-spacing:.5px;
}

.brand small{
  display:block;
  margin-top:2px;
  color:var(--muted);
  font-size:12px;
}

.logoDot{
  width:14px;
  height:14px;
  flex:0 0 14px;
  border-radius:50%;
  background:radial-gradient(circle at 30% 30%, var(--brand2), var(--brand));
  box-shadow:0 0 0 4px rgba(158,34,199,.18);
}

.nav{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:16px;
  flex:1;
  overflow:auto;
  padding-right:2px;
}

.nav-group + .nav-group{
  margin-top:8px;
}

.nav-section{
  margin:10px 0 6px;
  padding:0 4px;
  color:rgba(255,255,255,.55);
  font-size:11px;
  font-weight:900;
  letter-spacing:.8px;
  text-transform:uppercase;
}

.nav a{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:46px;
  padding:12px 14px;
  text-decoration:none;
  border-radius:14px;
  border:1px solid transparent;
  color:rgba(255,255,255,.86);
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  transition:background .18s ease,border-color .18s ease,transform .18s ease,color .18s ease;
}

.nav a:hover{
  color:#fff;
  transform:translateY(-1px);
  border-color:rgba(158,34,199,.35);
  background:rgba(158,34,199,.14);
}

.nav a.active{
  color:#fff;
  border-color:rgba(158,34,199,.55);
  background:
    linear-gradient(180deg, rgba(158,34,199,.32), rgba(158,34,199,.16)),
    linear-gradient(90deg, rgba(255,255,255,.02), rgba(255,255,255,0));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05), 0 8px 24px rgba(0,0,0,.22);
}

.sidebar-user{
  margin-top:16px;
  padding:12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  background:
    radial-gradient(260px 90px at 0% 0%, rgba(158,34,199,.14), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
}

.sidebar-footer{
  margin-top:auto;
  padding-top:16px;
  border-top:1px solid rgba(255,255,255,.08);
}

.logout-link{
  display:inline-flex;
  width:100%;
  justify-content:center;
  align-items:center;
  min-height:44px;
  padding:12px 16px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  color:var(--text-soft);
  font-weight:800;
  text-decoration:none;
  transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease;
}

.logout-link:hover,
.logout-link.active{
  color:#fff;
  border-color:rgba(158,34,199,.45);
  background:linear-gradient(180deg, rgba(158,34,199,.26), rgba(158,34,199,.14));
  transform:translateY(-1px);
}

.sidebar-notify-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.sidebar-user-label{
  color:rgba(255,255,255,.75);
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
}

.sidebar-user-name{
  margin-top:6px;
  font-weight:800;
}

.sidebar-user-role{
  margin-top:2px;
  color:rgba(255,255,255,.65);
  font-size:12px;
}

.mobile-shell{
  display:none;
}

.mobile-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.mobile-header-actions{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.mobile-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.mobile-title{
  font-size:14px;
  font-weight:900;
  letter-spacing:.4px;
}

.mobile-subtitle{
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.mobile-user-chip{
  max-width:42vw;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.mobile-nav{
  display:flex;
  gap:8px;
  overflow:auto;
  padding-bottom:4px;
  margin-top:12px;
  scrollbar-width:none;
}

.mobile-nav::-webkit-scrollbar{
  display:none;
}

.mobile-nav-link{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  text-decoration:none;
  color:var(--text-soft);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.mobile-nav-link.active{
  color:#fff;
  border-color:rgba(158,34,199,.45);
  background:linear-gradient(180deg, rgba(158,34,199,.26), rgba(158,34,199,.15));
}

.mobile-dock{
  display:none;
}

.notify-bell{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  color:#fff;
  box-shadow:var(--shadow-sm);
}

.notify-bell-icon{
  font-size:14px;
  line-height:1;
  color:rgba(255,255,255,.82);
}

.notify-bell-count{
  position:absolute;
  top:-5px;
  right:-5px;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg, #d269ee, #9e22c7);
  border:1px solid rgba(255,255,255,.16);
  color:#fff;
  font-size:11px;
  font-weight:900;
  box-shadow:0 10px 20px rgba(95,16,122,.32);
}

.notify-bell.has-alert{
  border-color:rgba(221,176,241,.34);
  box-shadow:0 0 0 3px rgba(158,34,199,.12), var(--shadow-sm);
}

.notify-bell-mobile{
  flex:0 0 auto;
}

/* =========================
   Common structure
========================= */
.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:16px;
  padding:18px 20px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:30px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)),
    radial-gradient(700px 220px at 0% 0%, rgba(158,34,199,.22), transparent 66%),
    radial-gradient(420px 160px at 100% 0%, rgba(189,99,223,.16), transparent 58%),
    rgba(25,8,48,.78);
  box-shadow:0 20px 40px rgba(15,8,45,.22);
  position:relative;
  overflow:hidden;
}

.topbar::after{
  content:"";
  position:absolute;
  left:22px;
  right:22px;
  top:0;
  height:1px;
  background:linear-gradient(90deg, rgba(255,255,255,.14), rgba(255,255,255,0));
}

.title{
  min-width:0;
}

.title h2{
  margin:0;
  font-size:var(--font-h2);
  line-height:1.15;
  letter-spacing:-.02em;
  text-shadow:0 1px 0 rgba(255,255,255,.02);
}

.title p{
  margin:8px 0 0;
  font-size:13px;
  color:var(--muted);
  max-width:70ch;
}

h1,
h2,
h3,
h4{
  font-family:var(--font-sans);
  font-weight:800;
}

.eyebrow{
  display:inline-block;
  margin-bottom:var(--space-2);
  color:var(--blue-300);
  font-size:11px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.section{
  display:block;
}

.grid{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:14px;
  min-width:0;
}

.row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:var(--gap-sm);
  min-width:0;
}

.stack{
  display:flex;
  flex-direction:column;
  gap:var(--gap-sm);
}

.inline{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.actions,
.btn-row,
.toolbar{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.topbar > div:last-child,
.topbar form:last-child{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.panel-head,
.panelHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.panel-title,
.panelTitle{
  margin:0;
  font-size:15px;
  font-weight:900;
}

.mini,
.help,
.hint{
  font-size:12px;
  color:var(--muted);
}

hr{
  border:0;
  border-top:1px solid rgba(255,255,255,.08);
  margin:16px 0;
}

/* =========================
   Surface components
========================= */
.card,
.panel{
  min-width:0;
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

.card{
  grid-column:span 3;
  position:relative;
  overflow:hidden;
  min-height:138px;
  padding:18px;
  border-radius:var(--radius-lg);
  background:
    radial-gradient(520px 220px at 18% 0%, rgba(158,34,199,.23), transparent 58%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)),
    linear-gradient(180deg, rgba(24,8,52,.96), rgba(14,6,30,.98));
}

.card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  border-radius:inherit;
  background:linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0));
}

.card::after{
  content:"";
  position:absolute;
  left:18px;
  right:18px;
  bottom:0;
  height:1px;
  background:linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,0));
}

.card h3{
  margin:0;
  font-size:12px;
  color:var(--muted);
  font-weight:800;
  letter-spacing:.7px;
  text-transform:uppercase;
}

.card .num{
  margin-top:10px;
  font-size:clamp(28px, 3vw, 38px);
  line-height:1;
  font-weight:800;
}

.card .tag{
  margin-top:8px;
  font-size:12px;
  color:var(--muted);
}

.panel{
  grid-column:span 12;
  padding:18px;
  border-radius:var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)),
    radial-gradient(560px 220px at 0% 0%, rgba(158,34,199,.18), transparent 62%),
    rgba(21,8,47,.72);
  position:relative;
  overflow:hidden;
}

.panel::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  border-radius:inherit;
  background:linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0) 26%);
}

.panel::after{
  content:"";
  position:absolute;
  left:20px;
  right:20px;
  top:0;
  height:1px;
  background:linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,0));
}

.panel.soft{
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.012)),
    rgba(255,255,255,.015);
}

.panel.flat{
  box-shadow:none;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:40px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(158,34,199,.25);
  background:linear-gradient(180deg, rgba(158,34,199,.12), rgba(19,6,46,.88));
  color:rgba(255,255,255,.86);
  font-weight:800;
  font-size:12px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}

/* =========================
   Table
========================= */
.table{
  width:100%;
  border-collapse:collapse;
  border-radius:14px;
  overflow:hidden;
  table-layout:auto;
  background:rgba(24,8,52,.65);
}

.table th,
.table td{
  padding:13px 12px;
  text-align:left;
  vertical-align:top;
  border-bottom:1px solid rgba(255,255,255,.06);
  font-size:13px;
}

.table th{
  color:rgba(255,255,255,.78);
  background:
    linear-gradient(180deg, rgba(158,34,199,.15), rgba(102,36,153,.08)),
    rgba(18,6,45,.88);
  font-weight:800;
  backdrop-filter:blur(8px);
}

.table td:last-child,
.table th:last-child{
  text-align:left;
}

.table tbody tr{
  transition:background .18s ease, transform .18s ease;
}

.table tbody tr:nth-child(even) td{
  background:rgba(158,34,199,.04);
}

.table tbody tr:hover td,
.table tr:hover td{
  background:rgba(158,34,199,.10);
}

.tableCompact th,
.tableCompact td{
  padding:9px 8px;
  font-size:12px;
}

.tableWrap{
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  border-radius:30px;
  border:1px solid rgba(255,255,255,.06);
  background:
    linear-gradient(180deg, rgba(158,34,199,.08), rgba(10,4,34,0)),
    rgba(20,8,52,.24);
}

/* =========================
   Status
========================= */
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  font-size:12px;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}

.badge.ok{
  color:#fff;
  border-color:rgba(158,34,199,.45);
  background:rgba(158,34,199,.18);
}

.badge.warn{
  color:#fff;
  border-color:rgba(250,204,21,.35);
  background:rgba(250,204,21,.12);
}

.badge.bad{
  color:#fff;
  border-color:rgba(239,68,68,.35);
  background:rgba(239,68,68,.12);
}

.badge.neutral{
  color:#fff;
  border-color:rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
}

/* =========================
   Buttons
========================= */
.btn,
button.btn,
a.btn,
input.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:var(--control-h);
  padding:10px 15px;
  border:1px solid transparent;
  border-radius:14px;
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
  color:#fff;
  text-decoration:none;
  font-weight:800;
  font-size:13px;
  line-height:1.1;
  white-space:nowrap;
  transition:transform .18s ease,border-color .18s ease,background .18s ease,box-shadow .18s ease,opacity .18s ease;
}

.btn:hover,
button.btn:hover,
a.btn:hover,
input.btn:hover{
  transform:translateY(-1px);
  border-color:rgba(158,34,199,.35);
  background:rgba(158,34,199,.18);
  box-shadow:var(--shadow-sm);
}

.btn:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible{
  outline:none;
  box-shadow:0 0 0 4px var(--focus);
}

.btn.primary{
  color:#fff7ff;
  border-color:rgba(221,176,241,.42);
  background:linear-gradient(180deg, #c24ee3, #8e20bb);
  box-shadow:0 14px 28px rgba(95,16,122,.34);
}

.btn.primary:hover{
  background:linear-gradient(180deg, #cb5bed, #9a2ac8);
}

.btn.danger{
  color:#fff;
  border-color:rgba(239,68,68,.35);
  background:rgba(239,68,68,.14);
}

.btn.danger:hover{
  background:rgba(239,68,68,.22);
  border-color:rgba(239,68,68,.48);
}

.btn.success{
  color:#fff;
  border-color:rgba(158,34,199,.42);
  background:rgba(158,34,199,.18);
}

.btn.success:hover{
  background:rgba(158,34,199,.26);
  border-color:rgba(158,34,199,.55);
}

.btn.ghost{
  background:transparent;
  border-color:var(--line);
}

.btn.sm{
  min-height:36px;
  padding:8px 10px;
  border-radius:12px;
  font-size:12px;
}

.btn.lg{
  min-height:48px;
  padding:12px 18px;
}

.btn.icon-only{
  width:44px;
  min-width:44px;
  padding:0;
}

.btn[disabled],
.btn.disabled,
button.btn:disabled,
input.btn:disabled{
  opacity:.45;
  cursor:not-allowed;
  pointer-events:none;
  transform:none;
  box-shadow:none;
}

/* =========================
   Forms
========================= */
.input,
select,
textarea,
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]){
  width:100%;
  min-height:var(--control-h);
  padding:11px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:
    linear-gradient(180deg, rgba(158,34,199,.10), rgba(33,12,59,.94)),
    rgba(16,8,42,.92);
  color:rgba(255,255,255,.94);
  outline:none;
  transition:border-color .18s ease,box-shadow .18s ease,background .18s ease,transform .18s ease;
}

textarea{
  min-height:120px;
  resize:vertical;
}

select:focus,
textarea:focus,
input:not([type="checkbox"]):not([type="radio"]):focus{
  border-color:rgba(221,176,241,.48);
  box-shadow:0 0 0 4px var(--focus);
  background:linear-gradient(180deg, rgba(158,34,199,.16), rgba(7,20,26,.80));
  transform:translateY(-1px);
}

select{
  color:rgba(255,255,255,.92);
  background-color:rgba(26,10,57,.88);
}

select option{
  color:#0b1220;
  background:#ffffff;
}

select option:checked{
  color:#0b1220;
  background:#dceafb;
}

select option[disabled]{
  color:#475569;
}

input[type="date"],
input[type="month"]{
  color-scheme:dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator{
  filter:invert(1);
  opacity:.75;
}

input[type="checkbox"],
input[type="radio"]{
  accent-color:var(--brand);
}

/* Normalize browser autofill (remove yellow/green fill) */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill{
  -webkit-box-shadow:0 0 0 1000px rgba(16,8,42,.92) inset !important;
  box-shadow:0 0 0 1000px rgba(16,8,42,.92) inset !important;
  -webkit-text-fill-color:rgba(255,255,255,.92) !important;
  transition:background-color 5000s ease-in-out 0s !important;
}

/* Firefox autofill */
input:-moz-autofill,
textarea:-moz-autofill,
select:-moz-autofill{
  box-shadow:0 0 0 1000px rgba(7,20,26,.88) inset !important;
  -moz-text-fill-color:rgba(255,255,255,.92) !important;
}

.input[disabled],
select[disabled],
textarea[disabled],
input[disabled]{
  opacity:.6;
  cursor:not-allowed;
  background:rgba(255,255,255,.04);
}

.input.input-error,
select.input-error,
textarea.input-error,
input.input-error{
  border-color:rgba(239,68,68,.52);
  box-shadow:0 0 0 4px rgba(239,68,68,.14);
}

.field-error{
  margin-top:6px;
  color:#ffb4b4;
  font-size:12px;
  font-weight:700;
}

label{
  display:block;
  margin:10px 0 6px;
  color:rgba(255,255,255,.75);
  font-size:12px;
  font-weight:800;
  letter-spacing:.4px;
  text-transform:uppercase;
}

.field,
.form-field{
  min-width:0;
}

.form-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
}

.form-grid .full{
  grid-column:1 / -1;
}

/* =========================
   Auth
========================= */
.center{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.authBox{
  width:400px;
  max-width:100%;
  padding:20px;
  border-radius:30px;
  border:1px solid var(--line);
  background:
    radial-gradient(520px 220px at 15% 0%, rgba(158,34,199,.18), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018)),
    rgba(7,20,26,.74);
  box-shadow:var(--shadow-lg);
}

/* =========================
   Helpers
========================= */
.text-muted{color:var(--muted)}
.text-soft{color:var(--text-soft)}
.text-right{text-align:right}
.text-center{text-align:center}
.w-full{width:100%}
.mt-0{margin-top:0}
.mt-1{margin-top:8px}
.mt-2{margin-top:12px}
.mt-3{margin-top:16px}
.mt-4{margin-top:22px}
.mb-0{margin-bottom:0}
.mb-1{margin-bottom:8px}
.mb-2{margin-bottom:12px}
.mb-3{margin-bottom:16px}
.hidden{display:none !important}

.status-empty,
.empty-state{
  padding:18px;
  border:1px dashed rgba(255,255,255,.12);
  border-radius:18px;
  background:rgba(255,255,255,.02);
  color:var(--muted);
  text-align:center;
}

.toast-wrap{
  position:fixed;
  top:18px;
  right:18px;
  z-index:9999;
  display:flex;
  flex-direction:column;
  gap:10px;
  pointer-events:none;
}

.toast{
  pointer-events:auto;
  width:min(420px, calc(100vw - 36px));
  border-radius:18px;
  padding:14px;
  border:1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)),
    rgba(12,24,36,.96);
  box-shadow:0 18px 42px rgba(0,0,0,.42);
  display:flex;
  gap:10px;
  align-items:flex-start;
  transform:translateY(-6px);
  opacity:0;
  transition:all .22s ease;
}

.toast.show{transform:translateY(0);opacity:1}

.toast .ico{
  width:36px;
  height:36px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(158,34,199,.18);
  border:1px solid rgba(221,176,241,.20);
  flex:0 0 36px;
}

.toast .t1{font-weight:900}
.toast .t2{font-size:12px;opacity:.85;margin-top:2px;line-height:1.35}
.toast .row{display:flex;gap:8px;align-items:center;margin-top:8px;flex-wrap:wrap}
.toast a.btn{padding:8px 10px}
.toast-body{flex:1;min-width:0}

.sound-pill{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.sound-pill .btn{
  padding:8px 10px;
}

.skeleton{
  position:relative;
  overflow:hidden;
  background:rgba(255,255,255,.06);
}

.skeleton::after{
  content:"";
  position:absolute;
  inset:0;
  transform:translateX(-100%);
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
  animation:skeleton-shimmer 1.4s infinite;
}

.skeleton-line{
  height:12px;
  border-radius:999px;
}

.skeleton-line + .skeleton-line{
  margin-top:8px;
}

.skeleton-card{
  min-height:120px;
  border-radius:18px;
}

@keyframes skeleton-shimmer{
  100%{transform:translateX(100%)}
}

.dashboard-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
  flex-wrap:wrap;
}

.dashboard-section-copy{
  min-width:0;
}

.dashboard-section-title{
  margin:0;
  font-size:15px;
  font-weight:900;
}

.dashboard-section-subtitle{
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
}

.dashboard-highlight{
  margin-top:8px;
  color:rgba(255,255,255,.85);
  font-size:12px;
}

.dashboard-filter-form{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.dashboard-filter-form .input-month{
  min-width:190px;
}

.chart-shell{
  position:relative;
  min-height:360px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.chart-shell canvas{
  max-width:980px;
  width:100%;
}

.chart-loading{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  transition:opacity .18s ease, visibility .18s ease;
}

.chart-loading.is-hidden{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

.chart-loading-card{
  width:min(100%, 860px);
  padding:18px;
  border-radius:20px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.02);
}

.chart-loading-bars{
  display:grid;
  grid-template-columns:repeat(6, minmax(0, 1fr));
  gap:10px;
  align-items:end;
  margin-top:18px;
}

.chart-loading-bar{
  border-radius:12px 12px 6px 6px;
}

.skeleton-title{
  width:180px;
}

.skeleton-subtitle{
  width:280px;
}

.bar-h-1{height:72px}
.bar-h-2{height:138px}
.bar-h-3{height:188px}
.bar-h-4{height:118px}
.bar-h-5{height:214px}
.bar-h-6{height:158px}

.chart-empty{
  color:rgba(255,255,255,.7);
  font-size:13px;
}

.site-footer{
  margin-top:28px;
  padding:14px 18px;
  text-align:center;
  font-size:12px;
  color:rgba(255,255,255,.55);
  border-top:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(255,255,255,.012), rgba(255,255,255,0));
}

.footer-muted{
  opacity:.85;
}

/* =========================
   KM filters fix
========================= */
.filtersGrid > *,
.field{
  min-width:0;
}

.kmFilters input,
.kmFilters select{
  max-width:100%;
  min-width:0;
}

.kmFilters input[type="date"]{
  width:100%;
  min-width:0;
  max-width:100%;
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  -webkit-appearance:none;
  appearance:none;
  font-size:16px;
}

.kmFilters input[type="date"]::-webkit-calendar-picker-indicator{
  margin:0;
  padding:0;
  cursor:pointer;
}

/* =========================
   Responsive
========================= */
@media (max-width: 1100px){
  .card{grid-column:span 4}
  .page-shell{width:100%}
  .main{padding:20px 18px 28px}
}

@media (max-width: 980px){
  .sidebar{display:none}
  .main{padding:16px 14px 88px}
  .mobile-shell{
    display:block;
    position:sticky;
    top:0;
    z-index:30;
    margin:-4px 0 14px;
    padding:8px 0 2px;
    background:linear-gradient(180deg, rgba(5,11,16,.98), rgba(5,11,16,.90), rgba(5,11,16,0));
    backdrop-filter:blur(8px);
  }
  .mobile-dock{
    position:fixed;
    left:12px;
    right:12px;
    bottom:calc(env(safe-area-inset-bottom, 0px) + 10px);
    z-index:50;
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:8px;
    padding:10px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:22px;
    background:
      linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015)),
      rgba(7,20,26,.94);
    backdrop-filter:blur(14px);
    box-shadow:0 18px 40px rgba(0,0,0,.35);
  }
  .mobile-dock-link{
    min-height:44px;
    display:flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
    color:var(--text-soft);
    font-size:11px;
    font-weight:800;
    text-align:center;
    line-height:1.2;
    border-radius:16px;
    border:1px solid transparent;
    background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
    padding:8px 6px;
  }
  .mobile-dock-link.active{
    color:#fff;
    border-color:rgba(158,34,199,.45);
    background:linear-gradient(180deg, rgba(158,34,199,.26), rgba(158,34,199,.14));
  }
  .card{grid-column:span 6}
  .row,
  .form-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width: 720px){
  .main{padding:14px 12px 24px}
  .topbar{align-items:flex-start}
  .topbar{
    padding:16px;
    border-radius:20px;
  }
  .topbar > div:last-child,
  .topbar form:last-child{
    width:100%;
    justify-content:stretch;
  }
  .topbar > div:last-child .btn,
  .topbar form:last-child .btn,
  .topbar form:last-child input[type="month"],
  .topbar form:last-child input[type="date"],
  .topbar form:last-child select{
    flex:1 1 180px;
  }
  .panel{padding:12px}
  .card{
    min-height:auto;
    padding:16px;
  }
  .table{
    display:block;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
  .table th,
  .table td{
    white-space:nowrap;
  }
}

@media (max-width: 520px){
  .card{grid-column:span 12}
  .title h2{font-size:22px}
  .title p{font-size:12px}
  .mobile-user-chip{display:none}
  .btn,
  button.btn,
  a.btn,
  input.btn{
    min-height:42px;
    padding:10px 12px;
    font-size:12px;
  }
  .panel,
  .card{
    border-radius:18px;
  }
  .mobile-dock{
    left:10px;
    right:10px;
    bottom:calc(env(safe-area-inset-bottom, 0px) + 8px);
    gap:6px;
    padding:8px;
  }
  .mobile-dock-link{
    min-height:42px;
    font-size:10px;
  }
}
