/* ============================================================================
   RATIM Admin Control Panel — Design System
   Premium enterprise UI · Dark/Light themes · Fully responsive
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------- */
:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Bengali', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Menlo, monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --transition: 160ms cubic-bezier(.4, 0, .2, 1);

  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 64px;
}

/* Dark theme (default) */
[data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-elev: #0f1526;
  --surface: #121a30;
  --surface-2: #182238;
  --surface-3: #1f2b47;
  --border: rgba(148, 163, 184, .14);
  --border-strong: rgba(148, 163, 184, .28);
  --text: #e6eaf4;
  --text-2: #9aa7c1;
  --text-3: #64708c;
  --primary: #7c6cf6;
  --primary-strong: #9d8eff;
  --primary-soft: rgba(124, 108, 246, .14);
  --accent: #22d3ee;
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, .12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, .12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, .12);
  --muted: #55617d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, .45), 0 24px 64px rgba(0, 0, 0, .5);
  --glow: 0 0 0 1px rgba(124, 108, 246, .35), 0 8px 32px rgba(124, 108, 246, .25);
  --grad: linear-gradient(135deg, #7c6cf6 0%, #5b8cff 55%, #22d3ee 100%);
  --sidebar-bg: #0c1222;
  --topbar-bg: rgba(10, 14, 26, .72);
  --code-bg: #0d1428;
}

/* Light theme */
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #eef1f8;
  --border: rgba(15, 23, 42, .1);
  --border-strong: rgba(15, 23, 42, .2);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --primary: #6c5ce7;
  --primary-strong: #5a49d6;
  --primary-soft: rgba(108, 92, 231, .1);
  --accent: #0891b2;
  --success: #059669;
  --success-soft: rgba(5, 150, 105, .1);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, .1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .1);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, .1);
  --muted: #cbd5e1;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-lg: 0 4px 12px rgba(15, 23, 42, .1), 0 24px 64px rgba(15, 23, 42, .14);
  --glow: 0 0 0 1px rgba(108, 92, 231, .3), 0 8px 32px rgba(108, 92, 231, .18);
  --grad: linear-gradient(135deg, #6c5ce7 0%, #3b82f6 55%, #06b6d4 100%);
  --sidebar-bg: #ffffff;
  --topbar-bg: rgba(255, 255, 255, .78);
  --code-bg: #0f172a;
}

/* ---- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); }
h1, h2, h3, h4 { margin: 0 0 .4em; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
::selection { background: var(--primary-soft); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---- App shell ------------------------------------------------------------ */
.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  transition: width var(--transition), transform var(--transition);
}
.app.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 11px;
  background: var(--grad);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: var(--glow);
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; }
.brand-name span { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand-sub { font-size: 10.5px; color: var(--text-3); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.app.collapsed .brand-name, .app.collapsed .brand-sub { display: none; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.nav-group { margin-bottom: 18px; }
.nav-group-title {
  font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3); padding: 0 10px; margin-bottom: 6px;
  white-space: nowrap;
}
.app.collapsed .nav-group-title { opacity: 0; height: 12px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; font-size: 13.5px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap; position: relative;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: var(--primary-soft); color: var(--text); }
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--grad);
}
.app.collapsed .nav-item { justify-content: center; padding: 10px; }
.app.collapsed .nav-item .nav-label { display: none; }
.nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  background: var(--danger-soft); color: var(--danger);
  padding: 1px 7px; border-radius: 20px;
}
.app.collapsed .nav-badge { display: none; }

.sidebar-footer { padding: 14px 16px; border-top: 1px solid var(--border); }
.sidebar-footer .admin-chip { display: flex; align-items: center; gap: 10px; }
.chip-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.chip-meta { min-width: 0; }
.chip-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-role { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.app.collapsed .chip-meta { display: none; }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Topbar */
.topbar {
  height: var(--topbar-h);
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid transparent;
  color: var(--text-2); cursor: pointer;
  transition: background var(--transition), color var(--transition), border var(--transition);
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%; border: 2px solid var(--topbar-bg);
}
.topbar-search {
  flex: 1; max-width: 420px; position: relative;
}
.topbar-search input {
  width: 100%; height: 40px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 11px; padding: 0 14px 0 40px;
  color: var(--text); font-size: 13.5px; font-family: var(--font);
  outline: none; transition: border var(--transition), box-shadow var(--transition);
}
.topbar-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.topbar-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.theme-switch { position: relative; width: 44px; height: 24px; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--border); cursor: pointer; }
.theme-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--grad); transition: transform var(--transition);
}
[data-theme="light"] .theme-switch::after { transform: translateX(20px); }

/* Content */
.content { padding: 26px 28px 60px; max-width: 1560px; width: 100%; margin: 0 auto; }

/* Breadcrumb */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--primary); }
.crumbs .sep { opacity: .5; }
.crumbs .current { color: var(--text-2); font-weight: 500; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.page-desc { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 600; font-family: var(--font);
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.btn:hover { border-color: var(--primary); color: var(--primary-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--grad); border: none; color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { color: #fff; filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { color: #fff; filter: brightness(1.08); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { color: #fff; filter: brightness(1.06); }
.btn-sm { height: 31px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---- Cards ---------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 18px; height: 18px; color: var(--primary); }
.card-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1200px) { .grid-6 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; } }

/* Stat cards */
.stat-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), border var(--transition);
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.stat-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--grad); opacity: 0; transition: opacity var(--transition);
}
.stat-card:hover::before { opacity: 1; }
.stat-label { font-size: 12px; color: var(--text-2); font-weight: 550; display: flex; align-items: center; gap: 8px; }
.stat-label svg { width: 15px; height: 15px; color: var(--primary); }
.stat-value { font-size: 27px; font-weight: 750; letter-spacing: -.03em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 15px; font-weight: 600; color: var(--text-3); }
.stat-delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.delta-up { color: var(--success); }
.delta-down { color: var(--danger); }
.stat-foot { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

/* ---- Badges --------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .02em;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--surface-3); color: var(--text-3); }
.badge-primary { background: var(--primary-soft); color: var(--primary-strong); }

/* ---- Tables --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.table .num { font-variant-numeric: tabular-nums; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.cell-user { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-user .avatar {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary-strong);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.cell-user .u-name { font-weight: 600; white-space: nowrap; }
.cell-user .u-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* ---- Forms ---------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field label .req { color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; height: 40px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 0 13px;
  color: var(--text); font-size: 13.5px; font-family: var(--font);
  outline: none; transition: border var(--transition), box-shadow var(--transition);
}
textarea.input { height: auto; min-height: 92px; padding: 10px 13px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input::placeholder { color: var(--text-3); }
.input[readonly] { opacity: .65; }
.hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.form-error {
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid rgba(248, 113, 113, .3);
  padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px;
  display: flex; gap: 8px; align-items: center;
}
.form-ok {
  background: var(--success-soft); color: var(--success);
  border: 1px solid rgba(52, 211, 153, .3);
  padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px;
}

/* Switch */
.switch { position: relative; display: inline-block; width: 42px; height: 23px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 20px;
  background: var(--surface-3); border: 1px solid var(--border-strong);
  cursor: pointer; transition: all var(--transition);
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--text-3); transition: all var(--transition);
}
.switch input:checked + .track { background: var(--grad); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(19px); background: #fff; }
.switch input:disabled + .track { opacity: .5; cursor: not-allowed; }

/* ---- Modal ---------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 7, 16, .6);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; animation: fadeIn .18s ease; }
.modal {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 440px; padding: 24px;
  animation: popIn .2s cubic-bezier(.34, 1.56, .64, 1);
}
.modal-lg { max-width: 640px; }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.modal-desc { color: var(--text-2); font-size: 13px; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-warn { background: var(--warning-soft); color: var(--warning); border: 1px solid rgba(251,191,36,.25); padding: 10px 13px; border-radius: 10px; font-size: 12.5px; margin-bottom: 14px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- Toast ---------------------------------------------------------------- */
#toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 280px; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--primary);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 13px 16px; font-size: 13px;
  display: flex; gap: 10px; align-items: flex-start;
  animation: slideIn .25s cubic-bezier(.34, 1.56, .64, 1);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast .t-icon { font-size: 15px; line-height: 1.2; }
.toast.out { animation: slideOut .25s ease forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(30px); } }

/* ---- Empty & loading states ------------------------------------------------ */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--text-3);
}
.empty-state .e-icon {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px;
  background: var(--surface-3); display: grid; place-items: center;
}
.empty-state .e-icon svg { width: 30px; height: 30px; color: var(--text-3); }
.empty-state .e-title { font-weight: 650; color: var(--text-2); font-size: 14px; margin-bottom: 4px; }
.empty-state .e-desc { font-size: 12.5px; max-width: 360px; margin: 0 auto; }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--border-strong); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Pagination ------------------------------------------------------------ */
.pagination { display: flex; gap: 6px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 34px; height: 34px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid var(--border);
  font-size: 13px; color: var(--text-2); font-weight: 550;
  transition: all var(--transition);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary-strong); }
.pagination .active { background: var(--grad); color: #fff; border-color: transparent; }
.pagination .disabled { opacity: .4; pointer-events: none; }
.pagination .info { border: none; color: var(--text-3); min-width: auto; }

/* ---- Filters bar ----------------------------------------------------------- */
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.filters .input { width: auto; min-width: 160px; }
.filters .input.search { flex: 1; min-width: 220px; max-width: 340px; }

/* ---- Chart containers ------------------------------------------------------- */
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }
.chart-box canvas { width: 100% !important; }

/* ---- Login ------------------------------------------------------------------ */
.guest-body {
  min-height: 100vh; display: grid; place-items: center;
  background: var(--bg); position: relative; overflow: hidden;
  padding: 24px;
}
.guest-body::before {
  content: ''; position: absolute; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, var(--primary-soft), transparent 65%);
  top: -180px; right: -160px; pointer-events: none;
}
.guest-body::after {
  content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, var(--info-soft), transparent 65%);
  bottom: -200px; left: -140px; pointer-events: none;
}
.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 38px 36px 32px;
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-logo .brand-logo { width: 44px; height: 44px; font-size: 20px; border-radius: 13px; }
.login-title { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.login-sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.login-foot { text-align: center; margin-top: 22px; font-size: 12px; color: var(--text-3); }

/* ---- TOTP setup ------------------------------------------------------------- */
.otp-display {
  font-family: var(--mono); font-size: 13px; letter-spacing: .14em;
  background: var(--code-bg); color: #9fe8a4;
  border-radius: 10px; padding: 12px 14px;
  user-select: all; word-break: break-all;
  border: 1px solid var(--border);
}
.qr-box { text-align: center; padding: 12px; background: #fff; border-radius: 14px; display: inline-block; margin: 4px 0 12px; }
.recovery-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.recovery-list .code {
  font-family: var(--mono); font-size: 12px; text-align: center;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: 8px; padding: 7px 4px;
}

/* ---- Misc ------------------------------------------------------------------- */
.sep { height: 1px; background: var(--border); margin: 20px 0; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 30px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); }
.text-danger { color: var(--danger); } .text-success { color: var(--success); } .text-warning { color: var(--warning); }
.text-sm { font-size: 12px; } .text-xs { font-size: 11px; }
.flex { display: flex; align-items: center; gap: 10px; } .flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-1 { flex: 1; } .wrap { flex-wrap: wrap; }
.mono { font-family: var(--mono); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muted-box { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 12px; padding: 14px 16px; font-size: 12.5px; color: var(--text-2); }

/* Progress bar */
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 6px; background: var(--grad); transition: width .5s ease; }
.progress.warn > i { background: var(--warning); }
.progress.danger > i { background: var(--danger); }

/* Health dot pulse */
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--success); position: relative; display: inline-block; }
.dot-live::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--success); opacity: .5; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }

/* Responsive */
.mobile-burger { display: none; }
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .app.mobile-open .sidebar { transform: translateX(0); }
  .mobile-burger { display: grid; }
  .content { padding: 20px 16px 50px; }
  .page-title { font-size: 19px; }
  .topbar-search { display: none; }
}
