:root {
  --bg: #070d0c;
  --panel: rgba(12, 23, 21, 0.88);
  --panel-2: rgba(16, 30, 27, 0.82);
  --border: rgba(94, 234, 212, 0.16);
  --border-soft: rgba(148, 196, 188, 0.12);
  --text: #eefaf7;
  --muted: #7ea39c;
  --mint: #5eead4;
  --mint-2: #14b8a6;
  --gold: #fbbf24;
  --rose: #fb7185;
  --sky: #38bdf8;
  --violet: #a78bfa;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background:
    radial-gradient(600px 340px at 10% 0%, rgba(94, 234, 212, 0.08), transparent 65%),
    radial-gradient(520px 320px at 95% 100%, rgba(56, 189, 248, 0.07), transparent 65%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 163, 156, 0.28) transparent;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(126, 163, 156, 0.28); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(94, 234, 212, 0.55); }
[hidden] { display: none !important; }
a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 12.5px;
  cursor: pointer; border: 1px solid transparent; transition: all 0.16s ease; text-decoration: none !important;
}
.btn-primary {
  background: linear-gradient(135deg, var(--mint), var(--mint-2));
  color: #05201c; box-shadow: 0 8px 22px rgba(20, 184, 166, 0.28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(94, 234, 212, 0.4); }
.btn-secondary {
  background: rgba(20, 38, 34, 0.85); color: #cde6e0; border-color: rgba(94, 234, 212, 0.24);
}
.btn-secondary:hover { border-color: var(--mint); color: #fff; background: rgba(24, 48, 43, 0.95); }
.btn-danger {
  background: rgba(244, 63, 94, 0.14); color: #fda4af; border-color: rgba(244, 63, 94, 0.35);
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.25); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 11.5px; }

/* Auth Gate */
.gate-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.gate-card {
  width: min(420px, 100%); padding: 30px 28px; border-radius: 24px;
  border: 1px solid rgba(94, 234, 212, 0.24);
  background: linear-gradient(165deg, rgba(12, 26, 23, 0.96), rgba(7, 15, 14, 0.99));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
  display: flex; flex-direction: column; gap: 14px; text-align: center;
}
.gate-brand {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Unbounded', sans-serif; font-size: 12px; letter-spacing: 0.06em; color: var(--mint);
}
.gate-logo-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.8);
}
.gate-card h1 { margin: 2px 0 0; font-family: 'Unbounded', sans-serif; font-size: 21px; }
.gate-sub { margin: 0; color: var(--muted); font-size: 13px; }
.gate-sso-btn { width: 100%; padding: 12px 16px; font-size: 13px; }
.gate-divider {
  display: flex; align-items: center; gap: 10px; color: #5f7f79; font-size: 11px;
}
.gate-divider::before, .gate-divider::after { content: ''; flex: 1; height: 1px; background: rgba(148, 196, 188, 0.14); }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate-form input, .field-input, .field-select, .field-textarea {
  width: 100%; padding: 10px 13px; border-radius: 12px;
  border: 1px solid rgba(148, 196, 188, 0.2); background: rgba(7, 15, 13, 0.9);
  color: var(--text); font: inherit; outline: none;
}
.gate-form input:focus, .field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--mint); box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12);
}
.gate-err { margin: 0; color: #fda4af; font-size: 12.5px; background: rgba(244, 63, 94, 0.12); padding: 9px 12px; border-radius: 10px; }
.gate-back { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Main Shell */
.dash-shell { display: grid; grid-template-columns: 254px minmax(0, 1fr); min-height: 100vh; }
.dash-sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 20px 14px 16px; border-right: 1px solid var(--border-soft);
  background: rgba(8, 16, 15, 0.92); backdrop-filter: blur(18px);
}
.dash-brand { padding: 4px 10px 18px; display: flex; flex-direction: column; gap: 6px; }
.dash-brand-top {
  display: flex; align-items: center; gap: 9px; color: var(--mint);
  font-family: 'Unbounded', sans-serif; font-size: 15px;
}
.dash-brand-top strong span { color: var(--gold); }
.dash-env-pill {
  align-self: flex-start; font-size: 9.5px; font-weight: 800; letter-spacing: 0.12em;
  color: var(--gold); padding: 3px 8px; border-radius: 999px;
  background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.34);
}
.dash-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.dash-nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px;
  border-radius: 12px; border: 1px solid transparent; background: transparent;
  color: #9cbab4; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; text-align: left;
  transition: all 0.15s ease;
}
.dash-nav-item:hover { background: rgba(94, 234, 212, 0.07); color: #eefaf7; }
.dash-nav-item.is-active {
  background: rgba(20, 44, 39, 0.9); color: var(--mint);
  border-color: rgba(94, 234, 212, 0.36);
}
.dash-sidebar-foot { padding-top: 12px; border-top: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 10px; }
.dash-admin-card {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px;
  background: rgba(15, 29, 26, 0.9); border: 1px solid var(--border-soft);
}
.dash-av {
  width: 34px; height: 34px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: #14302b; color: var(--mint); display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.dash-av img { width: 100%; height: 100%; object-fit: cover; }
.dash-admin-meta { min-width: 0; flex: 1; }
.dash-admin-meta strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-admin-meta small { display: block; font-size: 11px; color: var(--gold); font-weight: 700; }
.dash-foot-links { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; font-size: 12px; }
.dash-foot-links button { background: none; border: 0; color: var(--rose); font: inherit; font-weight: 600; cursor: pointer; }

/* Main Content */
.dash-main { padding: 24px 30px 44px; min-width: 0; }
.dash-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.dash-topbar h1 { margin: 0; font-family: 'Unbounded', sans-serif; font-size: 22px; letter-spacing: -0.02em; }
.dash-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* Bento Cards & Grids */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card {
  position: relative; padding: 16px 18px; border-radius: 18px;
  border: 1px solid var(--border-soft); background: var(--panel);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(180px 90px at 0% 0%, color-mix(in srgb, var(--acc, #5eead4) 14%, transparent), transparent 72%);
}
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.kpi-val { font-family: 'Unbounded', sans-serif; font-size: 24px; font-weight: 800; margin: 8px 0 4px; color: #f4fffd; }
.kpi-sub { font-size: 11.5px; color: var(--acc, var(--mint)); font-weight: 600; }

.two-col { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; margin-bottom: 18px; }
.panel {
  padding: 18px 20px; border-radius: 20px; border: 1px solid var(--border-soft);
  background: var(--panel); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 14.5px; font-weight: 800; }

/* Sparkline bars */
.chart-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 130px; padding-top: 12px; }
.chart-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.chart-bar { width: 12px; border-radius: 6px 6px 2px 2px; min-height: 4px; transition: height 0.25s ease; }
.chart-bar.is-u { background: linear-gradient(180deg, #5eead4, #0f766e); }
.chart-bar.is-p { background: linear-gradient(180deg, #38bdf8, #0369a1); }
.chart-bar.is-d { background: linear-gradient(180deg, #fbbf24, #b45309); }
.chart-day { font-size: 10.5px; color: var(--muted); }
.chart-legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }

/* Storage list */
.storage-list { display: flex; flex-direction: column; gap: 10px; }
.storage-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 12px; background: rgba(8, 17, 15, 0.7); border: 1px solid var(--border-soft); }
.storage-row strong { font-size: 12.5px; }
.storage-row span { font-size: 12px; color: var(--mint); font-weight: 700; }

/* Filters & Tables */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .field-input { max-width: 300px; }
.pill-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(9, 18, 16, 0.9); border: 1px solid var(--border-soft); }
.pill-tab {
  padding: 6px 12px; border-radius: 999px; border: 0; background: transparent;
  color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.pill-tab.is-active { background: rgba(94, 234, 212, 0.16); color: var(--mint); }

.table-wrap { overflow-x: auto; }
table.dash-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dash-table th {
  text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); border-bottom: 1px solid var(--border-soft);
}
.dash-table td { padding: 11px 12px; border-bottom: 1px solid rgba(148, 196, 188, 0.07); vertical-align: middle; }
.dash-table tr:hover td { background: rgba(94, 234, 212, 0.035); }
.u-cell { display: flex; align-items: center; gap: 10px; }
.u-cell-meta strong { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.u-cell-meta small { display: block; font-size: 11.5px; color: var(--muted); }

/* Badges */
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
}
.tag-gold { color: #fde68a; background: rgba(245, 158, 11, 0.18); border: 1px solid rgba(251, 191, 36, 0.42); }
.tag-mint { color: #99f6e4; background: rgba(20, 184, 166, 0.18); border: 1px solid rgba(94, 234, 212, 0.36); }
.tag-rose { color: #fecdd3; background: rgba(244, 63, 94, 0.18); border: 1px solid rgba(244, 63, 94, 0.4); }
.tag-sky { color: #bae6fd; background: rgba(56, 189, 248, 0.16); border: 1px solid rgba(56, 189, 248, 0.36); }
.tag-muted { color: #9ab8b2; background: rgba(148, 196, 188, 0.1); border: 1px solid rgba(148, 196, 188, 0.18); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; display: inline-block; }

/* Feed items (Community / Wall / Audit) */
.feed-list { display: flex; flex-direction: column; gap: 10px; }
.feed-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  padding: 13px 15px; border-radius: 14px; background: rgba(9, 18, 16, 0.72);
  border: 1px solid var(--border-soft);
}
.feed-item-main { min-width: 0; flex: 1; }
.feed-item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.feed-item-title { font-weight: 750; color: var(--text); font-size: 13.5px; margin: 2px 0 4px; }
.feed-item-body { margin: 0; color: #b7d2cc; font-size: 12.5px; word-break: break-word; }
.feed-gif { max-width: 140px; max-height: 90px; border-radius: 10px; margin-top: 6px; border: 1px solid var(--border-soft); }

/* Drawer */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(2, 8, 7, 0.72); backdrop-filter: blur(6px);
  z-index: 200; display: flex; justify-content: flex-end;
}
.drawer-panel {
  width: min(460px, 100vw); height: 100vh; overflow-y: auto; padding: 22px 24px 36px;
  background: linear-gradient(170deg, #0c1917, #07100e);
  border-left: 1px solid rgba(94, 234, 212, 0.24);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.65);
  display: flex; flex-direction: column; gap: 16px;
}
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer-close { background: rgba(148, 196, 188, 0.12); border: 0; color: var(--text); width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-size: 16px; }
.drawer-section { padding: 14px; border-radius: 14px; background: rgba(13, 27, 24, 0.72); border: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 10px; }
.drawer-section h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mint); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-label { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.quick-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Broadcast preview */
.bc-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; }
.notif-preview {
  padding: 16px; border-radius: 16px; background: rgba(10, 22, 20, 0.9);
  border: 1px solid rgba(94, 234, 212, 0.24); display: flex; gap: 12px; align-items: flex-start;
}
.notif-preview-av { width: 38px; height: 38px; border-radius: 12px; background: rgba(94, 234, 212, 0.16); color: var(--mint); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }

/* Toast */
.dash-toast {
  position: fixed; bottom: 22px; right: 24px; z-index: 300;
  padding: 11px 18px; border-radius: 14px; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, rgba(16, 44, 39, 0.96), rgba(10, 26, 23, 0.98));
  border: 1px solid rgba(94, 234, 212, 0.42); color: #f0fdfb;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}

@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .bc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .dash-shell { grid-template-columns: 1fr; }
  .dash-sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .dash-main { padding: 18px 16px 32px; }
}
