@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font:   'DM Sans', system-ui, sans-serif;
  --mono:   'DM Mono', monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 224px;
  --topbar-h:  56px;
  --trans: 160ms ease;

  /* Light palette */
  --bg:         #f5f4f1;
  --surface:    #ffffff;
  --surface-2:  #f9f8f6;
  --border:     rgba(0,0,0,0.08);
  --border-md:  rgba(0,0,0,0.14);
  --text-1:     #1a1918;
  --text-2:     #6b6964;
  --text-3:     #a8a5a0;

  --teal:       #1D9E75;
  --teal-bg:    #e1f5ee;
  --teal-text:  #0f6e56;

  --amber-bg:   #faeeda;
  --amber-text: #854f0b;
  --amber-border:#f0c97a;

  --red-bg:     #fcebeb;
  --red-text:   #a32d2d;
  --red-border: #f7c1c1;

  --blue-bg:    #e6f1fb;
  --blue-text:  #185fa5;
  --blue-border:#b5d4f4;

  --green-bg:   #eaf3de;
  --green-text: #3b6d11;
  --green-border:#c0dd97;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg:         #141413;
    --surface:    #1e1d1c;
    --surface-2:  #252422;
    --border:     rgba(255,255,255,0.08);
    --border-md:  rgba(255,255,255,0.14);
    --text-1:     #f0ede8;
    --text-2:     #9a9590;
    --text-3:     #5c5955;

    --teal-bg:    #0a2e22;
    --teal-text:  #5dcaa5;

    --amber-bg:   #2a1e08;
    --amber-text: #f0c97a;
    --amber-border:#5c3a0a;

    --red-bg:     #2a0f0f;
    --red-text:   #f09595;
    --red-border: #5c1f1f;

    --blue-bg:    #0c1e35;
    --blue-text:  #85b7eb;
    --blue-border:#1a3a5c;

    --green-bg:   #0f200a;
    --green-text: #97c459;
    --green-border:#264010;
  }
}

html[data-theme="dark"] {
  --bg:         #141413;
  --surface:    #1e1d1c;
  --surface-2:  #252422;
  --border:     rgba(255,255,255,0.08);
  --border-md:  rgba(255,255,255,0.14);
  --text-1:     #f0ede8;
  --text-2:     #9a9590;
  --text-3:     #5c5955;

  --teal-bg:    #0a2e22;
  --teal-text:  #5dcaa5;

  --amber-bg:   #2a1e08;
  --amber-text: #f0c97a;
  --amber-border:#5c3a0a;

  --red-bg:     #2a0f0f;
  --red-text:   #f09595;
  --red-border: #5c1f1f;

  --blue-bg:    #0c1e35;
  --blue-text:  #85b7eb;
  --blue-border:#1a3a5c;

  --green-bg:   #0f200a;
  --green-text: #97c459;
  --green-border:#264010;
}

html[data-theme="light"] {
  --bg:         #f5f4f1;
  --surface:    #ffffff;
  --surface-2:  #f9f8f6;
  --border:     rgba(0,0,0,0.08);
  --border-md:  rgba(0,0,0,0.14);
  --text-1:     #1a1918;
  --text-2:     #6b6964;
  --text-3:     #a8a5a0;

  --teal-bg:    #e1f5ee;
  --teal-text:  #0f6e56;

  --amber-bg:   #faeeda;
  --amber-text: #854f0b;
  --amber-border:#f0c97a;

  --red-bg:     #fcebeb;
  --red-text:   #a32d2d;
  --red-border: #f7c1c1;

  --blue-bg:    #e6f1fb;
  --blue-text:  #185fa5;
  --blue-border:#b5d4f4;

  --green-bg:   #eaf3de;
  --green-text: #3b6d11;
  --green-border:#c0dd97;
}

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
}

/* ── UTILS ── */
.hidden { display: none !important; }

/* ── SCREENS ── */
#screen-login  { display: none; }
#screen-otp    { display: none; }
#screen-app    { display: none; }
body.is-login  #screen-login { display: flex; }
body.is-otp    #screen-otp   { display: flex; }
body.is-app    #screen-app   { display: flex; }

#screen-otp {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

/* ── LOGIN ── */
#screen-login {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-wrap {
  width: 360px;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2.5rem;
}
.login-logo-mark {
  width: 36px; height: 36px;
  background: var(--text-1);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.login-logo-mark svg { color: var(--surface); }
.login-logo-name {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.3px;
  color: var(--text-1);
}
.login-card {
  background: var(--surface);
  border: .5px solid var(--border-md);
  border-radius: var(--radius);
  padding: 2rem;
}
.login-card h1 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: .25rem;
}
.login-card p {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 1.5rem;
}
.form-field { margin-bottom: 1rem; }
.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-2);
  margin-bottom: 5px;
}
.form-field input {
  width: 100%;
  padding: 9px 11px;
  border: .5px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--trans);
}
.form-field input:focus { border-color: var(--teal); }
.form-field select {
  width: 100%;
  padding: 9px 11px;
  border: .5px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--trans);
  cursor: pointer;
}
.form-field select:focus { border-color: var(--teal); }
.btn-full {
  width: 100%;
  padding: 10px;
  background: var(--text-1);
  color: var(--surface);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: .5rem;
  transition: opacity var(--trans);
}
.btn-full:hover { opacity: .82; }
.btn-full:disabled { opacity: .4; cursor: not-allowed; }
.pw-wrap {
  position: relative;
}
.pw-wrap input {
  padding-right: 38px;
}
.pw-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-3);
  line-height: 1;
  display: flex;
  align-items: center;
}
.pw-eye:hover { color: var(--text-1); }
.login-error {
  font-size: 12px;
  color: var(--red-text);
  margin-top: .75rem;
  text-align: center;
  min-height: 16px;
}

/* ── APP SHELL ── */
#screen-app {
  flex-direction: column;
  min-height: 100vh;
}

/* TOPBAR */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: .5px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 10px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.2px;
  text-decoration: none;
  color: var(--text-1);
}
.topbar-brand-mark {
  width: 26px; height: 26px;
  background: var(--text-1);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.topbar-brand-mark svg { color: var(--surface); }
.topbar-sep {
  width: .5px; height: 18px;
  background: var(--border-md);
  margin: 0 4px;
}
.topbar-tenant {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}
.topbar-tenant-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lang-switcher {
  display: flex;
  background: var(--surface-2);
  border: .5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.lang-switcher button {
  padding: 4px 10px;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--trans);
}
.lang-switcher button.active {
  background: var(--text-1);
  color: var(--surface);
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue-text);
  font-size: 11px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  cursor: default;
  border: none;
}
.btn-ghost {
  padding: 5px 10px;
  border: .5px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--trans);
}
.btn-ghost:hover { border-color: var(--border-md); color: var(--text-1); }

/* BODY */
.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: .5px solid var(--border);
  padding: 1rem 0;
  flex-shrink: 0;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}
.nav-group { padding: 0 .75rem; margin-bottom: 1.25rem; }
.nav-group-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  padding: 0 .5rem;
  margin-bottom: 3px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-2);
  transition: all var(--trans);
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}
.nav-item:hover { background: var(--surface-2); color: var(--text-1); }
.nav-item.active { background: var(--surface-2); color: var(--text-1); font-weight: 500; }
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .65; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--red-bg);
  color: var(--red-text);
}

/* MAIN */
.main {
  flex: 1;
  padding: 1.75rem;
  overflow-y: auto;
  min-width: 0;
}

/* PAGE */
.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-title { font-size: 18px; font-weight: 500; letter-spacing: -.3px; }
.page-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ── COMPONENTS ── */

/* Metric cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
  margin-bottom: 1.5rem;
}
.metric {
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.metric-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-2);
  margin-bottom: 6px;
}
.metric-value {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.5px;
  line-height: 1;
}
.metric-delta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 5px;
}
.metric-delta.up { color: var(--teal); }
.metric-delta.dn { color: var(--red-text); }

/* Panels */
.panel {
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  border-bottom: .5px solid var(--border);
}
.panel-title { font-size: 13px; font-weight: 500; }

/* Two-column row */
.row-2 {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: .03em;
  white-space: nowrap;
}
.badge-block  { background: var(--red-bg);   color: var(--red-text);   border: .5px solid var(--red-border); }
.badge-flag   { background: var(--amber-bg); color: var(--amber-text); border: .5px solid var(--amber-border); }
.badge-review { background: var(--blue-bg);  color: var(--blue-text);  border: .5px solid var(--blue-border); }
.badge-allow  { background: var(--green-bg); color: var(--green-text); border: .5px solid var(--green-border); }
.badge-open   { background: var(--surface-2); color: var(--text-2); border: .5px solid var(--border); }
.badge-confirmed { background: var(--red-bg); color: var(--red-text); border: .5px solid var(--red-border); }
.badge-dismissed { background: var(--green-bg); color: var(--green-text); border: .5px solid var(--green-border); }
.badge-blocked   { background: var(--red-bg); color: var(--red-text); border: .5px solid var(--red-border); }
.badge-admin      { background: var(--blue-bg); color: var(--blue-text); border: .5px solid var(--blue-border); }
.badge-superadmin { background: #f3e8ff; color: #7c3aed; border: .5px solid #d8b4fe; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .badge-superadmin { background: #2e1065; color: #c4b5fd; border-color: #5b21b6; }
}
html[data-theme="dark"] .badge-superadmin { background: #2e1065; color: #c4b5fd; border-color: #5b21b6; }

/* Confidence bar */
.conf-bar { display: flex; align-items: center; gap: 6px; }
.conf-track {
  flex: 1; height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  min-width: 50px;
}
.conf-fill { height: 100%; border-radius: 2px; }
.conf-num  { font-size: 11px; font-family: var(--mono); color: var(--text-2); min-width: 30px; text-align: right; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  padding: 8px 1.1rem;
  border-bottom: .5px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 1.1rem;
  font-size: 12.5px;
  border-bottom: .5px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr { cursor: pointer; transition: background var(--trans); }
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.alert-row-abuse td:first-child { border-left: 3px solid var(--amber-border); }
.alert-row-abuse:hover td { background: var(--amber-bg); }
.td-name-main { font-weight: 500; }
.td-name-sub  { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.td-mono      { font-family: var(--mono); font-size: 11px; color: var(--text-3); }

/* Filter pills */
.filter-row {
  display: flex;
  gap: 6px;
  padding: .75rem 1.1rem;
  border-bottom: .5px solid var(--border);
  flex-wrap: wrap;
}
.filter-pill {
  padding: 4px 11px;
  border: .5px solid var(--border);
  border-radius: 12px;
  background: transparent;
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--trans);
}
.filter-pill.active { background: var(--text-1); color: var(--surface); border-color: transparent; }
.filter-pill:hover:not(.active) { border-color: var(--border-md); color: var(--text-1); }

/* Search */
.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: .75rem 1.1rem;
  border-bottom: .5px solid var(--border);
}
.search-icon { color: var(--text-3); flex-shrink: 0; }
.search-input {
  flex: 1; border: none; background: transparent;
  color: var(--text-1); font-family: var(--font); font-size: 13px; outline: none;
}
.search-input::placeholder { color: var(--text-3); }

/* Buttons */
.btn {
  padding: 7px 13px;
  border: .5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--trans);
}
.btn:hover { border-color: var(--border-md); color: var(--text-1); }
.btn-primary { background: var(--text-1); color: var(--surface); border-color: transparent; }
.btn-primary:hover { opacity: .82; color: var(--surface); }
.btn-danger  { background: var(--red-bg); color: var(--red-text); border-color: var(--red-border); }
.btn-danger:hover { opacity: .8; }
.btn-success { background: var(--green-bg); color: var(--green-text); border-color: var(--green-border); }
.btn-success:hover { opacity: .8; }

/* Mini bar chart */
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 80px; padding: 1rem 1.1rem .75rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-fill { width: 100%; border-radius: 3px 3px 0 0; transition: opacity var(--trans); min-height: 3px; }
.bar-fill:hover { opacity: .65; }
.bar-lbl { font-size: 9px; color: var(--text-3); }

/* Donut */
.donut-section { padding: 1.25rem 1.1rem 1rem; }
.donut-legend-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; padding: 5px 0;
  border-bottom: .5px solid var(--border);
}
.donut-legend-row:last-child { border-bottom: none; }
.donut-legend-lbl { display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.donut-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-val { font-family: var(--mono); font-weight: 500; }

/* Avatar initials */
.player-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue-bg); color: var(--blue-text);
  font-size: 10px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 50;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border: .5px solid var(--border-md);
  border-radius: var(--radius);
  width: 500px; max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: .5px solid var(--border);
  position: sticky; top: 0;
  background: var(--surface);
}
.modal-title { font-size: 14px; font-weight: 500; }
.modal-sub   { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: 20px; line-height: 1; padding: 2px 4px;
}
.modal-close:hover { color: var(--text-1); }
.modal-body { padding: 1.25rem; }
.modal-foot {
  display: flex; gap: 8px;
  padding: .9rem 1.25rem;
  border-top: .5px solid var(--border);
}
.signal-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0;
  border-bottom: .5px solid var(--border);
  font-size: 12px;
}
.signal-row:last-child { border-bottom: none; }
.signal-name { font-family: var(--mono); font-size: 11px; color: var(--text-2); min-width: 115px; }
.signal-detail { flex: 1; color: var(--text-2); font-size: 11px; }

/* Settings */
.settings-card {
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  max-width: 560px;
}
.settings-section-title {
  font-size: 13px; font-weight: 500;
  margin-bottom: .9rem;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 0;
  border-bottom: .5px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-lbl { font-size: 13px; }
.settings-row-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.toggle {
  width: 34px; height: 18px;
  border-radius: 9px;
  background: var(--border-md);
  position: relative; cursor: pointer;
  transition: background var(--trans);
  border: none; flex-shrink: 0;
}
.toggle.on { background: var(--teal); }
.toggle::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: white;
  top: 3px; left: 3px;
  transition: left var(--trans);
}
.toggle.on::after { left: 19px; }
.secret-display {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface-2);
  border: .5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  word-break: break-all;
}

/* Loading spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-3);
  font-size: 13px;
}

@media (max-width: 700px) {
  .metrics-grid { grid-template-columns: repeat(2,1fr); }
  .row-2 { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 1rem; }
}

/* Font size presets */
html[data-font="sm"] body { font-size: 15px; }
html[data-font="sm"] .data-table td { font-size: 14px; }
html[data-font="sm"] .data-table th { font-size: 12px; }
html[data-font="sm"] .nav-item { font-size: 14px; }
html[data-font="sm"] .page-title { font-size: 18px; }
html[data-font="sm"] .metric-value { font-size: 28px; }
html[data-font="sm"] .panel-title { font-size: 13px; }
html[data-font="sm"] .btn { font-size: 13px; }

html[data-font="md"] body { font-size: 17px; }
html[data-font="md"] .data-table td { font-size: 15.5px; }
html[data-font="md"] .data-table th { font-size: 13px; }
html[data-font="md"] .nav-item { font-size: 15.5px; }
html[data-font="md"] .page-title { font-size: 21px; }
html[data-font="md"] .metric-value { font-size: 32px; }
html[data-font="md"] .panel-title { font-size: 14.5px; }
html[data-font="md"] .btn { font-size: 14.5px; }

html[data-font="lg"] body { font-size: 20px; }
html[data-font="lg"] .data-table td { font-size: 18px; }
html[data-font="lg"] .data-table th { font-size: 15px; }
html[data-font="lg"] .nav-item { font-size: 18px; }
html[data-font="lg"] .page-title { font-size: 25px; }
html[data-font="lg"] .metric-value { font-size: 38px; }
html[data-font="lg"] .panel-title { font-size: 17px; }
html[data-font="lg"] .btn { font-size: 16px; }

/* Theme toggle & font switcher */
.btn-icon {
  width: 30px; height: 30px;
  border: .5px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--trans);
  flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--border-md); color: var(--text-1); }

.font-switcher {
  display: flex;
  background: var(--surface-2);
  border: .5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.font-switcher button {
  padding: 4px 9px;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--trans);
}
.font-switcher button.active {
  background: var(--text-1);
  color: var(--surface);
}

/* Pagination */
.pager {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: .65rem 1.1rem;
  border-top: .5px solid var(--border);
  flex-wrap: wrap;
}
.pager-btn {
  min-width: 28px; height: 28px;
  padding: 0 7px;
  border: .5px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--trans);
  display: flex; align-items: center; justify-content: center;
}
.pager-btn:hover:not(:disabled) { border-color: var(--border-md); color: var(--text-1); }
.pager-btn.active { background: var(--text-1); color: var(--surface); border-color: transparent; }
.pager-btn:disabled { opacity: .35; cursor: not-allowed; }
.pager-info {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}
.pager-size {
  font-size: 11px;
  padding: 3px 6px;
  border: .5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  outline: none;
  font-family: var(--font);
}

/* Filter bar */
.filter-bar {
  padding: .65rem 1.1rem;
  border-bottom: .5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.filter-bar-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  background: var(--surface-2);
  border: .5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}
.filter-search svg { color: var(--text-3); flex-shrink: 0; }
.filter-search input {
  border: none; background: transparent;
  color: var(--text-1); font-family: var(--font); font-size: 12px; outline: none; width: 100%;
}
.filter-search input::placeholder { color: var(--text-3); }
.filter-select {
  font-size: 11px;
  padding: 4px 8px;
  border: .5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  outline: none;
  font-family: var(--font);
}
