/* ==========================================================
   Organiza Meu Dia — Admin Panel
   Dark mode, Stripe-like professional, indigo/violet accent
   ========================================================== */

:root {
  /* Base — deep slate dark */
  --bg-0: #0a0a0f;            /* page bg */
  --bg-1: #0f1018;            /* surface */
  --bg-2: #14151f;            /* elevated surface */
  --bg-3: #1a1c28;            /* hover / input */
  --bg-4: #232636;            /* elevated hover */

  --line-1: #1f2233;          /* subtle borders */
  --line-2: #2a2e45;          /* stronger border */
  --line-3: #3a3f5c;          /* focus ring base */

  /* Text */
  --t-1: #f4f4f7;             /* primary */
  --t-2: #b8bccc;             /* secondary */
  --t-3: #7d8299;             /* tertiary */
  --t-4: #555a72;             /* quaternary */
  --t-5: #3a3f56;             /* disabled */

  /* Accent — indigo / violet */
  --a-50:  #ede9fe;
  --a-100: #ddd6fe;
  --a-200: #c4b5fd;
  --a-300: #a78bfa;
  --a-400: #8b5cf6;
  --a-500: #7c3aed;           /* primary accent */
  --a-600: #6d28d9;
  --a-700: #5b21b6;
  --a-glow: rgba(124, 58, 237, 0.45);
  --a-faint: rgba(124, 58, 237, 0.10);
  --a-faint-2: rgba(124, 58, 237, 0.16);

  /* Status */
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.12);

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --sidebar-w: 240px;
  --topbar-h: 56px;

  /* Type */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --shadow-pop: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px var(--line-2);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--t-1);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* Subtle dotted radial backdrop */
body {
  background-image:
    radial-gradient(circle at 0% 0%, rgba(124, 58, 237, 0.08), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.04), transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 10px;
  border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: var(--line-3); }

/* ---------- App layout ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.app--collapsed { grid-template-columns: 64px 1fr; }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.content {
  flex: 1;
  padding: 28px 32px 64px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--line-1);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line-1);
}
.sidebar__logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--a-400), var(--a-600));
  display: grid; place-items: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--a-glow), inset 0 1px 0 rgba(255,255,255,0.2);
}
.sidebar__brand-text {
  display: flex; flex-direction: column;
  line-height: 1.15;
  overflow: hidden;
}
.sidebar__brand-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--t-1);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.sidebar__brand-sub {
  font-size: 11px;
  color: var(--t-3);
  white-space: nowrap;
}

.sidebar__org {
  margin: 12px 12px 6px;
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.12s;
}
.sidebar__org:hover { background: var(--bg-3); }
.sidebar__org-avatar {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1f2937, #374151);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--t-1);
  flex-shrink: 0;
}
.sidebar__org-text {
  display: flex; flex-direction: column;
  flex: 1;
  min-width: 0;
}
.sidebar__org-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--t-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar__org-role {
  font-size: 10.5px;
  color: var(--t-3);
}
.sidebar__org-chev {
  color: var(--t-3);
  flex-shrink: 0;
}

.sidebar__section {
  padding: 14px 12px 6px;
}
.sidebar__section-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--t-4);
  padding: 0 10px 6px;
}

.sidebar__nav {
  list-style: none;
  margin: 0;
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--t-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.sidebar__item:hover {
  background: var(--bg-3);
  color: var(--t-1);
}
.sidebar__item--active {
  background: var(--a-faint-2);
  color: var(--a-200);
}
.sidebar__item--active:hover {
  background: var(--a-faint-2);
  color: var(--a-100);
}
.sidebar__item svg {
  flex-shrink: 0;
  opacity: 0.85;
}
.sidebar__badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--bg-4);
  color: var(--t-2);
}
.sidebar__item--active .sidebar__badge {
  background: var(--a-500);
  color: white;
}

.sidebar__footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--line-1);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.12s;
}
.sidebar__user:hover { background: var(--bg-3); }
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--a-400), var(--a-700));
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.avatar--lg { width: 56px; height: 56px; font-size: 20px; }
.avatar--md { width: 40px; height: 40px; font-size: 14px; }
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  background: rgba(15, 16, 24, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-1);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar__crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.topbar__crumb {
  color: var(--t-3);
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar__crumb--current { color: var(--t-1); font-weight: 500; }
.topbar__sep { color: var(--t-4); }

.topbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search input {
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-md);
  padding: 7px 12px 7px 32px;
  font-size: 12.5px;
  color: var(--t-1);
  width: 260px;
  outline: none;
  transition: border 0.12s, background 0.12s;
}
.search input::placeholder { color: var(--t-4); }
.search input:focus { border-color: var(--a-500); background: var(--bg-3); }
.search__icon {
  position: absolute;
  left: 10px;
  color: var(--t-3);
  pointer-events: none;
}
.search__kbd {
  position: absolute;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--t-4);
  background: var(--bg-3);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
}

.icon-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--t-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border 0.12s;
  position: relative;
}
.icon-btn:hover { background: var(--bg-3); color: var(--t-1); border-color: var(--line-1); }
.icon-btn__dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--a-400);
  box-shadow: 0 0 0 2px var(--bg-1);
}

/* ---------- Page header ---------- */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--t-1);
  margin: 0 0 4px;
}
.page-sub {
  font-size: 13.5px;
  color: var(--t-3);
  margin: 0;
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s, border 0.12s, color 0.12s, transform 0.06s;
  white-space: nowrap;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: linear-gradient(180deg, var(--a-400), var(--a-500));
  color: white;
  border-color: var(--a-600);
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 1px 2px rgba(0,0,0,0.3);
}
.btn--primary:hover { background: linear-gradient(180deg, var(--a-300), var(--a-400)); }

.btn--ghost {
  background: var(--bg-2);
  color: var(--t-1);
  border-color: var(--line-1);
}
.btn--ghost:hover { background: var(--bg-3); border-color: var(--line-2); }

.btn--bare {
  background: transparent;
  color: var(--t-2);
}
.btn--bare:hover { background: var(--bg-3); color: var(--t-1); }

.btn--danger {
  background: var(--danger-bg);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn--danger:hover { background: rgba(239, 68, 68, 0.2); }

.btn--sm { padding: 4px 8px; font-size: 12px; }
.btn--lg { padding: 10px 18px; font-size: 14px; }
.btn--block { width: 100%; }

/* ---------- Card ---------- */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card__title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--t-1);
  margin: 0;
  letter-spacing: -0.005em;
}
.card__sub {
  font-size: 12px;
  color: var(--t-3);
  margin: 2px 0 0;
}
.card__body { padding: 18px; }

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: border 0.15s;
}
.stat:hover { border-color: var(--line-2); }
.stat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat__label {
  font-size: 12.5px;
  color: var(--t-3);
  font-weight: 500;
}
.stat__icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--a-faint);
  color: var(--a-300);
  display: grid; place-items: center;
}
.stat__value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--t-1);
  font-feature-settings: 'tnum';
}
.stat__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
}
.stat__delta--up { color: var(--success); }
.stat__delta--down { color: var(--danger); }
.stat__delta-sub { color: var(--t-3); margin-left: 4px; font-weight: 400; }
.stat__spark {
  position: absolute;
  bottom: 0; right: 0;
  opacity: 0.4;
  pointer-events: none;
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 12px;
  line-height: 1.4;
  border: 1px solid transparent;
}
.badge--dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge--success { background: var(--success-bg); color: #86efac; border-color: rgba(34,197,94,0.2); }
.badge--warning { background: var(--warning-bg); color: #fcd34d; border-color: rgba(245,158,11,0.2); }
.badge--danger  { background: var(--danger-bg);  color: #fca5a5; border-color: rgba(239,68,68,0.2); }
.badge--info    { background: var(--info-bg);    color: #93c5fd; border-color: rgba(59,130,246,0.2); }
.badge--neutral { background: var(--bg-3); color: var(--t-2); border-color: var(--line-2); }
.badge--accent  { background: var(--a-faint); color: var(--a-200); border-color: rgba(124,58,237,0.3); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--t-3);
  padding: 10px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-1);
  white-space: nowrap;
}
.table th.th--sortable { cursor: pointer; user-select: none; }
.table th.th--sortable:hover { color: var(--t-1); }
.table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-1);
  color: var(--t-2);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr.tr--clickable { cursor: pointer; transition: background 0.1s; }
.table tr.tr--clickable:hover td { background: var(--bg-2); }

.table .user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.table .user-cell__name {
  color: var(--t-1);
  font-weight: 500;
  line-height: 1.3;
}
.table .user-cell__email {
  color: var(--t-3);
  font-size: 12px;
}

.tbl-toolbar {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line-1);
  flex-wrap: wrap;
}
.tbl-toolbar__count {
  font-size: 12.5px;
  color: var(--t-3);
}
.tbl-toolbar__count strong { color: var(--t-1); font-weight: 600; }
.tbl-toolbar .search input { width: 220px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: 14px;
  font-size: 12px;
  color: var(--t-2);
  cursor: pointer;
  transition: border 0.12s, background 0.12s, color 0.12s;
  font-weight: 500;
}
.chip:hover { border-color: var(--line-2); color: var(--t-1); }
.chip--active {
  background: var(--a-faint);
  color: var(--a-200);
  border-color: rgba(124,58,237,0.3);
}

.tbl-pagination {
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line-1);
  font-size: 12.5px;
  color: var(--t-3);
}
.tbl-pagination__pages {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-btn {
  min-width: 28px; height: 28px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--t-2);
  font-size: 12px;
  cursor: pointer;
  display: grid; place-items: center;
}
.page-btn:hover { background: var(--bg-3); color: var(--t-1); }
.page-btn--active { background: var(--a-faint); color: var(--a-200); border-color: rgba(124,58,237,0.3); }

/* ---------- Form ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field__label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--t-2);
}
.field__hint {
  font-size: 11.5px;
  color: var(--t-4);
}
.field__error {
  font-size: 11.5px;
  color: #fca5a5;
  display: flex;
  align-items: center;
  gap: 4px;
}
.input, .textarea, .select {
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--t-1);
  outline: none;
  transition: border 0.12s, background 0.12s, box-shadow 0.12s;
  width: 100%;
}
.input::placeholder, .textarea::placeholder { color: var(--t-4); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--a-500);
  background: var(--bg-3);
  box-shadow: 0 0 0 3px var(--a-faint);
}
.input--lg { padding: 10px 14px; font-size: 14px; }
.textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.select { cursor: pointer; appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d8299' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.input-group {
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-md);
  transition: border 0.12s, background 0.12s, box-shadow 0.12s;
}
.input-group:focus-within {
  border-color: var(--a-500);
  background: var(--bg-3);
  box-shadow: 0 0 0 3px var(--a-faint);
}
.input-group input {
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 12px;
  flex: 1;
  font-size: 13px;
  color: var(--t-1);
}
.input-group__icon {
  padding: 0 0 0 12px;
  color: var(--t-3);
  display: grid; place-items: center;
}
.input-group__suffix {
  padding: 0 12px;
  color: var(--t-4);
  font-size: 12px;
  font-family: var(--font-mono);
}

/* Toggle */
.toggle {
  width: 36px;
  height: 20px;
  background: var(--bg-3);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.18s;
  border: 1px solid var(--line-2);
  flex-shrink: 0;
}
.toggle__thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: var(--t-2);
  border-radius: 50%;
  transition: transform 0.18s, background 0.18s;
}
.toggle--on { background: var(--a-500); border-color: var(--a-400); }
.toggle--on .toggle__thumb { transform: translateX(16px); background: white; }

/* Checkbox */
.checkbox {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--line-3);
  background: var(--bg-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.12s, border 0.12s;
  flex-shrink: 0;
}
.checkbox:hover { border-color: var(--t-3); }
.checkbox--checked {
  background: var(--a-500);
  border-color: var(--a-500);
  color: white;
}
.checkbox--indeterminate {
  background: var(--a-500);
  border-color: var(--a-500);
}

/* ---------- Modal / Drawer ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 12, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  animation: fadeIn 0.18s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

.modal {
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal__head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line-1);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.modal__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--t-1);
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.modal__sub {
  font-size: 12.5px;
  color: var(--t-3);
  margin: 0;
}
.modal__body { padding: 20px 22px; }
.modal__foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line-1);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-2);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 12, 0.55);
  backdrop-filter: blur(3px);
  z-index: 100;
  animation: fadeIn 0.18s ease-out;
}
.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: min(540px, 90vw);
  background: var(--bg-1);
  border-left: 1px solid var(--line-2);
  z-index: 101;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
  animation: slideRight 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--line-1);
  margin-bottom: 18px;
  overflow-x: auto;
}
.tab {
  background: transparent;
  border: none;
  color: var(--t-3);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border 0.12s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--t-1); }
.tab--active {
  color: var(--a-200);
  border-bottom-color: var(--a-400);
}

/* ---------- Charts ---------- */
.chart-grid line {
  stroke: var(--line-1);
  stroke-dasharray: 2 4;
}
.chart-axis text {
  font-size: 10.5px;
  fill: var(--t-4);
}

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-page__hero {
  background: linear-gradient(135deg, #1a0a3e 0%, #0a0a0f 60%);
  padding: 48px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.login-page__hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--a-glow), transparent 60%);
  pointer-events: none;
}
.login-page__hero::after {
  content: '';
  position: absolute;
  bottom: -150px; left: -100px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 60%);
  pointer-events: none;
}
.login-page__form {
  background: var(--bg-0);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.login-card {
  width: 100%;
  max-width: 380px;
}

/* ---------- Misc ---------- */
.kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--t-2);
}
.divider {
  height: 1px;
  background: var(--line-1);
  margin: 16px 0;
}
.row { display: flex; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--t-3); }
.mono { font-family: var(--font-mono); font-size: 12px; }

.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--t-3);
}
.empty__icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--bg-2);
  display: grid; place-items: center;
  margin: 0 auto 12px;
  color: var(--t-3);
}

.section-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--t-3);
  margin: 24px 0 12px;
}

/* Two col layout for detail page */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

/* Notification toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  font-size: 13px;
  color: var(--t-1);
  animation: slideUp 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: 360px;
}
.toast__icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.toast--success .toast__icon { background: var(--success-bg); color: var(--success); }
.toast--error .toast__icon { background: var(--danger-bg); color: var(--danger); }

/* Loading skeleton */
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.skeleton {
  background: var(--bg-3);
  border-radius: 4px;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-page__hero { display: none; }
}

/* Density variants (tweakable) */
.density--compact { --sidebar-w: 220px; }
.density--compact .stat { padding: 12px 14px; }
.density--compact .stat__value { font-size: 22px; }
.density--compact .table td { padding: 8px 14px; }
.density--compact .table th { padding: 8px 14px; }
.density--compact .card__head { padding: 12px 14px; }
.density--compact .card__body { padding: 14px; }

.density--spacious .stat { padding: 22px 24px; }
.density--spacious .stat__value { font-size: 30px; }
.density--spacious .table td { padding: 16px 20px; }
.density--spacious .table th { padding: 12px 20px; }
.density--spacious .card__head { padding: 18px 22px; }
.density--spacious .card__body { padding: 22px; }
.density--spacious .content { padding: 36px 40px 80px; }

/* Accent override (tweakable) */
.accent--blue {
  --a-200: #93c5fd; --a-300: #60a5fa; --a-400: #3b82f6;
  --a-500: #2563eb; --a-600: #1d4ed8; --a-700: #1e40af;
  --a-glow: rgba(37, 99, 235, 0.45);
  --a-faint: rgba(37, 99, 235, 0.10);
  --a-faint-2: rgba(37, 99, 235, 0.16);
}
.accent--green {
  --a-200: #86efac; --a-300: #4ade80; --a-400: #22c55e;
  --a-500: #16a34a; --a-600: #15803d; --a-700: #166534;
  --a-glow: rgba(22, 163, 74, 0.45);
  --a-faint: rgba(22, 163, 74, 0.10);
  --a-faint-2: rgba(22, 163, 74, 0.16);
}
.accent--orange {
  --a-200: #fdba74; --a-300: #fb923c; --a-400: #f97316;
  --a-500: #ea580c; --a-600: #c2410c; --a-700: #9a3412;
  --a-glow: rgba(234, 88, 12, 0.45);
  --a-faint: rgba(234, 88, 12, 0.10);
  --a-faint-2: rgba(234, 88, 12, 0.16);
}
.accent--pink {
  --a-200: #f9a8d4; --a-300: #f472b6; --a-400: #ec4899;
  --a-500: #db2777; --a-600: #be185d; --a-700: #9d174d;
  --a-glow: rgba(219, 39, 119, 0.45);
  --a-faint: rgba(219, 39, 119, 0.10);
  --a-faint-2: rgba(219, 39, 119, 0.16);
}

/* Light mode (tweakable) */
.theme--light {
  --bg-0: #f7f7fb;
  --bg-1: #ffffff;
  --bg-2: #f5f5fa;
  --bg-3: #ebecf2;
  --bg-4: #dfe1eb;
  --line-1: #e7e8ee;
  --line-2: #d4d6df;
  --line-3: #b9bcc9;
  --t-1: #0e1019;
  --t-2: #4a4e63;
  --t-3: #71758a;
  --t-4: #9499a8;
  --t-5: #c1c4cf;
}
.theme--light body, .theme--light .topbar {
  background: var(--bg-0);
}
