:root {
  --gold: #f0a500;
  --gold-dim: rgba(240, 165, 0, 0.1);
  --gold-border: rgba(240, 165, 0, 0.25);
  --red: #e63946;
  --red-dim: rgba(230, 57, 70, 0.1);
  --red-border: rgba(230, 57, 70, 0.25);
  --green: #16a34a;
  --green-dim: rgba(22, 163, 74, 0.1);
  --green-border: rgba(22, 163, 74, 0.25);
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.1);
  --blue-border: rgba(59, 130, 246, 0.25);
  --amber: #d97706;
  --amber-dim: rgba(217, 119, 6, 0.1);
  --amber-border: rgba(217, 119, 6, 0.25);
  --purple: #7c3aed;
  --purple-dim: rgba(124, 58, 237, 0.1);
  --teal: #0d9488;
  --teal-dim: rgba(13, 148, 136, 0.1);
  --sidebar-w: 290px;
  --sidebar-w-collapsed: 80px;
  --topbar-h: 72px;
  --content-max: 1440px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Sora', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;
}

html:not(.dark) {
  color-scheme: light;
  --page-bg: #e8ecf4;
  --surface: #ffffff;
  --panel-bg: #ffffff;
  --surface-2: #f7f9ff;
  --surface-3: #eef1f9;
  --border: #e4e8f4;
  --border-hi: #cdd3ec;
  --gold-banner-bg: #fffbf0;
  --amber-banner-bg: #fff7ed;
  --t1: #0e1222;
  --t2: #5b6696;
  --t3: #9aa3c4;
  --t4: #c5ccdf;
  --shadow-sm: 0 1px 3px rgba(14, 18, 34, 0.06), 0 1px 2px rgba(14, 18, 34, 0.04);
  --shadow-md: 0 4px 16px rgba(14, 18, 34, 0.08), 0 1px 4px rgba(14, 18, 34, 0.04);
  --shadow-card: 0 1px 2px rgba(14, 18, 34, 0.05), 0 4px 16px rgba(14, 18, 34, 0.08);
}

html.dark {
  color-scheme: dark;
  --page-bg: #07080f;
  --surface: #121528;
  --panel-bg: #181c32;
  --surface-2: #1f2440;
  --surface-3: #262b4a;
  --border: #2a3054;
  --border-hi: #353c66;
  --gold-banner-bg: #221c0d;
  --amber-banner-bg: #241808;
  --green: #2ecc71;
  --green-dim: rgba(46, 204, 113, 0.12);
  --green-border: rgba(46, 204, 113, 0.25);
  --blue: #4a9eff;
  --blue-dim: rgba(74, 158, 255, 0.12);
  --blue-border: rgba(74, 158, 255, 0.25);
  --amber: #ff9f43;
  --amber-dim: rgba(255, 159, 67, 0.12);
  --amber-border: rgba(255, 159, 67, 0.25);
  --gold-dim: rgba(240, 165, 0, 0.14);
  --gold-border: rgba(240, 165, 0, 0.35);
  --purple: #a78bfa;
  --purple-dim: rgba(167, 139, 250, 0.12);
  --teal: #2dd4bf;
  --teal-dim: rgba(45, 212, 191, 0.12);
  --t1: #f0f2ff;
  --t2: #8b94c4;
  --t3: #4a5080;
  --t4: #2a2f55;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.35), 0 8px 32px rgba(0, 0, 0, 0.25);
}

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

html,
body,
#root {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--page-bg);
  color: var(--t1);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 9px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.15s;
  line-height: 1;
  white-space: nowrap;
  color: var(--t1);
}

.btn-primary {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

.btn-primary:hover {
  background: #d99400;
  border-color: #d99400;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--t2);
}

.btn-outline:hover {
  border-color: var(--border-hi);
  color: var(--t1);
  background: var(--surface-2);
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

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

.btn-ghost:hover {
  color: var(--t1);
  background: var(--surface-2);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  white-space: nowrap;
}

.b-green {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.b-red {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.b-amber {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.b-blue {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}

.b-gold {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.b-muted {
  background: var(--surface-2);
  color: var(--t2);
  border: 1px solid var(--border);
}

/* Cards */
.card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Space between stacked page sections (table → next panel, etc.) —
   skip cards that sit side-by-side in a grid (that caused Live Activity gap). */
.card + .card {
  margin-top: 24px;
}
.grid-2 > .card + .card,
.grid-3 > .card + .card,
.stats-grid > .card + .card {
  margin-top: 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
}

.card-body {
  padding: 18px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-inline-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.form-inline-row .input,
.form-inline-row .select {
  flex: 1 1 220px;
  max-width: 420px;
  min-height: 44px;
}

.form-inline-row .btn {
  flex-shrink: 0;
  height: 44px;
  padding-top: 0;
  padding-bottom: 0;
}

.card-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stats-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.stat-card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--t1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon .zgs-hi-icon {
  width: 24px;
  height: 24px;
}

.si-gold { background: var(--gold-dim); color: var(--gold); }
.si-green { background: var(--green-dim); color: var(--green); }
.si-red { background: var(--red-dim); color: var(--red); }
.si-amber { background: var(--amber-dim); color: var(--amber); }

.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}

.sv-gold { color: var(--gold); }
.sv-green { color: var(--green); }
.sv-red { color: var(--red); }
.sv-amber { color: var(--amber); }

.stat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--t3);
}

.trend-up {
  background: var(--green-dim);
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
}

.trend-down {
  background: var(--red-dim);
  color: var(--red);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
}

/* Tables */
.tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead th {
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.data-table tbody tr:hover {
  background: var(--surface-2);
}

.data-table tbody td {
  padding: 13px 16px;
  color: var(--t1);
  vertical-align: middle;
}

.data-table td.td-actions {
  vertical-align: middle;
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.data-table .td-actions-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.data-table td.td-vcenter {
  vertical-align: middle;
}

.td-mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--gold);
}

.td-fwd {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}

.td-blk {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
}

/* Feed */
.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.feed-item:last-child {
  border-bottom: none;
}

.feed-body {
  flex: 1;
  min-width: 0;
}

.feed-sender {
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-subject {
  font-size: 12px;
  color: var(--t3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

.feed-time {
  font-size: 11px;
  color: var(--t4);
  flex-shrink: 0;
}

/* Layout helpers */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--t1);
  margin: 0;
}

.page-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--t3);
  margin: 4px 0 0;
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
  align-items: start;
}

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

.greeting-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.greeting-banner > div:first-child {
  flex: 1;
  min-width: 0;
}

.greeting-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.greeting-sub {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.45;
  margin: 6px 0 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-dim);
  border: 1px solid var(--green-border);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.alert-banner {
  padding: 14px 16px;
  border-radius: 9px;
  border: 1px solid;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 16px;
}
.alert-banner-amber {
  background: var(--amber-banner-bg);
  border-color: var(--amber-border);
  color: var(--amber);
}
.alert-banner-gold {
  background: var(--gold-banner-bg);
  border-color: var(--gold-border);
  color: var(--t2);
}
html.dark .alert-banner-gold {
  color: var(--t1);
}
.alert-banner-success {
  background: var(--green-dim);
  border-color: var(--green-border);
  color: var(--green);
}
.alert-banner-error {
  background: var(--red-dim);
  border-color: var(--red-border);
  color: var(--red);
}
.alert-banner-dismissible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.alert-banner-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  line-height: 1.45;
}
.alert-banner-text {
  flex: 1;
  min-width: 0;
}
.btn-banner-copy {
  background: var(--surface);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  box-shadow: 0 1px 2px rgba(14, 18, 34, 0.08);
  flex-shrink: 0;
}
.btn-banner-copy:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--t1);
}
html.dark .btn-banner-copy {
  background: var(--surface-3);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
html.dark .btn-banner-copy:hover {
  background: var(--gold-dim);
  color: var(--gold);
}
.alert-banner-dismissible[hidden] {
  display: none !important;
}
.alert-banner-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  opacity: 0.85;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}
.alert-banner-close-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.alert-banner-close:hover {
  opacity: 1;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.08);
}
html.dark .alert-banner-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Toasts */
.zgs-toast-stack {
  position: fixed;
  z-index: 12000;
  bottom: max(16px, env(safe-area-inset-bottom));
  right: max(16px, env(safe-area-inset-right));
  top: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.zgs-toast {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 14px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--t1);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.zgs-toast-in {
  opacity: 1;
  transform: translateY(0);
}
.zgs-toast-out {
  opacity: 0;
  transform: translateY(6px);
}
.zgs-toast-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.zgs-toast-msg {
  flex: 1;
  min-width: 0;
}
.zgs-toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--t3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.zgs-toast-close:hover {
  background: var(--surface-2);
  color: var(--t1);
}
.zgs-toast-timer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(127, 127, 127, 0.18);
  overflow: hidden;
  pointer-events: none;
}
.zgs-toast-timer-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  background: var(--gold);
}
.zgs-toast-success {
  border-color: var(--green-border);
  background: var(--surface);
}
.zgs-toast-success .zgs-toast-icon {
  background: var(--green-dim);
  color: var(--green);
}
.zgs-toast-success .zgs-toast-timer-bar {
  background: var(--green);
}
.zgs-toast-error {
  border-color: var(--red-border);
}
.zgs-toast-error .zgs-toast-icon {
  background: var(--red-dim);
  color: var(--red);
}
.zgs-toast-error .zgs-toast-timer-bar {
  background: var(--red);
}
.zgs-toast-warning {
  border-color: var(--amber-border);
}
.zgs-toast-warning .zgs-toast-icon {
  background: var(--amber-dim);
  color: var(--amber);
}
.zgs-toast-warning .zgs-toast-timer-bar {
  background: var(--amber);
}
.zgs-toast-info {
  border-color: var(--border-hi);
}
.zgs-toast-info .zgs-toast-icon {
  background: var(--surface-2);
  color: var(--t2);
}
.zgs-toast-info .zgs-toast-timer-bar {
  background: var(--t2);
}
@media (max-width: 640px) {
  .zgs-toast-stack {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(400px, calc(100vw - 24px));
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--t2);
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--t3);
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--t1);
  font-family: var(--font-display);
}

/* Logo */
.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark:hover {
  text-decoration: none;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.logo-wordmark {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
  display: block;
  line-height: 1.2;
}

.logo-wordmark span {
  color: var(--gold);
}

.logo-tagline {
  font-size: 10px;
  font-weight: 500;
  color: var(--t3);
  display: block;
}

.logo-img {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 34px;
  width: auto;
  max-width: min(180px, 100%);
  object-fit: contain;
  border-radius: 10px;
}

/* Toggle switch */
.zgs-toggle {
  position: relative;
  width: 38px;
  height: 21px;
  flex-shrink: 0;
  cursor: pointer;
  display: inline-block;
}

.zgs-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.zgs-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: var(--surface-3);
  border: 1.5px solid var(--border);
  transition: all 0.2s;
}

.zgs-toggle input:checked + .zgs-toggle-track {
  background: var(--gold);
  border-color: var(--gold);
}

.zgs-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}

.zgs-toggle input:checked ~ .zgs-toggle-knob {
  transform: translateX(17px);
}

.input,
.select {
  background-color: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--t1);
  width: 100%;
  outline: none;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-height: 44px;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239aa3c4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
  cursor: pointer;
}

html.dark .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b94c4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.select-sm {
  min-height: 0;
  height: 34px;
  padding: 0 30px 0 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 34px;
  background-position: right 10px center;
  background-size: 16px 16px;
  vertical-align: middle;
}

.data-table td .select-sm {
  width: auto;
  min-width: 7.5rem;
  max-width: 10rem;
}

.input:focus,
.select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
  background-color: var(--surface);
}

.select-sm:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239aa3c4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

html.dark .select-sm:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b94c4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--t2);
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Legacy compat (existing Blade views) ── */
:root, html.dark {
  --text: var(--t1);
  --muted: var(--t3);
  --card: var(--surface);
  --card-2: var(--surface-2);
  --gold-soft: var(--gold-dim);
  --gold-2: #d99400;
  --warn: var(--amber);
  --border-strong: var(--border-hi);
}

/* ── App shell (DashboardLayout) ── */
.zgs-shell { min-height: 100vh; display: flex; flex-direction: column; }
.zgs-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}
.zgs-sidebar-toggle .zgs-icon {
  width: 16px;
  height: 12px;
}
.zgs-user-menu-chevron {
  width: 18px;
  height: 20px;
}
.zgs-topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 400;
}
.zgs-topbar-end {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  margin-left: auto;
  flex-shrink: 0;
}
.zgs-topbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 520px;
}
.zgs-search {
  flex: 1;
  position: relative;
  width: 100%;
}
.zgs-search input {
  width: 100%;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 52px 0 44px;
  font-size: 14px;
  color: var(--t1);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.zgs-search input::placeholder { color: var(--t3); }
.zgs-search input:focus {
  border-color: var(--border-hi);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.zgs-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--t3);
  pointer-events: none;
}
.zgs-search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 22px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #667085;
  background: #f9fafb;
  border: 1px solid #e4e7ec;
  border-radius: 5px;
  box-shadow: none;
  pointer-events: none;
  user-select: none;
}
html.dark .zgs-search-kbd {
  color: #98a2b3;
  background: rgba(255, 255, 255, 0.04);
  border-color: #344054;
}
.zgs-search-dropdown {
  position: fixed;
  z-index: 10000;
  max-height: min(360px, 70vh);
  overflow: auto;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border-hi);
  background: var(--panel-bg);
  color: var(--t1);
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  opacity: 1;
}
.zgs-search-dropdown[hidden] { display: none !important; }
.zgs-search-group {
  margin: 8px 8px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--t3);
}
.zgs-search-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--t1);
  text-decoration: none;
  font-size: 14px;
}
.zgs-search-item span { color: var(--t3); font-size: 12px; }
.zgs-search-item:hover { background: var(--surface-2); text-decoration: none; }
.zgs-search-empty { margin: 8px; color: var(--t3); font-size: 13px; }
.zgs-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--t2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.zgs-icon-btn:hover {
  background: var(--surface-2);
  color: var(--t1);
  border-color: var(--border-hi);
}
.zgs-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #c87d00);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #000;
  border: 2px solid var(--gold-border);
  flex-shrink: 0;
}
.zgs-user-menu { position: relative; }
.zgs-user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--t1);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.zgs-user-menu-trigger:hover {
  background: var(--surface-2);
  border-color: var(--border);
}
.zgs-user-menu-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--t1);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zgs-user-menu-chevron {
  width: 18px;
  height: 18px;
  color: var(--t3);
}
.zgs-user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 8px 0;
  z-index: 500;
}
.zgs-user-menu-panel[hidden] { display: none !important; }
.zgs-user-menu-header { padding: 12px 16px 10px; }
.zgs-user-menu-fullname {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
}
.zgs-user-menu-email {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--t3);
  word-break: break-all;
}
.zgs-user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.zgs-user-menu-nav,
.zgs-user-menu-logout { display: block; }
.zgs-user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: var(--t2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.zgs-user-menu-item .zgs-icon {
  width: 24px;
  height: 24px;
}
.zgs-user-menu-item:hover {
  background: var(--surface-2);
  color: var(--t1);
  text-decoration: none;
}
.zgs-user-menu-signout { color: var(--t2); }
.zgs-app-layout { display: flex; flex: 1; min-height: 0; }
.zgs-sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 8px;
  flex-shrink: 0;
  transition: width 0.2s ease;
}
.zgs-sidebar-brand {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  min-height: 60px;
}
.zgs-sidebar-brand .logo-img {
  height: 32px;
  max-width: 180px;
}
.zgs-sidebar-brand .logo-img--icon {
  display: none;
  height: 40px;
  width: 40px;
  max-width: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.zgs-nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  padding: 10px 16px 6px;
  margin: 0;
  line-height: 1.2;
}
.zgs-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  margin: 0 10px;
  color: var(--t2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.3;
  min-height: 0;
}
.zgs-nav-item:hover { color: var(--t1); background: var(--surface-2); text-decoration: none; }
.zgs-nav-item.active { color: var(--gold); background: var(--gold-dim); font-weight: 700; }
.zgs-nav-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  color: inherit;
}
.zgs-nav-icon .zgs-hi-icon {
  width: 24px;
  height: 24px;
}
.zgs-hi-icon {
  display: block;
  flex-shrink: 0;
}
.zgs-nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 7px;
}
.zgs-sidebar-divider { height: 1px; background: var(--border); margin: 8px 16px; }
.zgs-sidebar-footer { margin-top: auto; padding: 10px; border-top: 1px solid var(--border); }
.zgs-user-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.zgs-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #c87d00);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
}
.zgs-user-name { font-size: 14px; font-weight: 700; color: var(--t1); margin: 0; }
.zgs-user-plan {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 1px 0 0;
}
.zgs-main { flex: 1; overflow-y: auto; padding: 24px; min-width: 0; background: var(--page-bg); }
.zgs-main-inner { max-width: var(--content-max); margin: 0 auto; }
.zgs-mobile-drawer { display: none; }

.zgs-shell.zgs-access-locked .zgs-topbar,
.zgs-shell.zgs-access-locked .zgs-sidebar,
.zgs-shell.zgs-access-locked .zgs-main {
  filter: blur(6px) saturate(0.8);
  opacity: 0.72;
  pointer-events: none;
  user-select: none;
}
.zgs-access-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.zgs-access-lock-card {
  max-width: 520px;
  width: 100%;
  border: 1px solid var(--gold-border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, #000 8%);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.45);
  padding: 24px;
  text-align: center;
}
.zgs-access-lock-card h2 {
  margin: 0 0 10px;
  font-size: 28px;
  color: var(--gold);
}
.zgs-access-lock-card p {
  margin: 0 0 16px;
  color: var(--t2);
}

/* Collapsed sidebar (desktop) */
.zgs-shell.sidebar-collapsed { --sidebar-w: var(--sidebar-w-collapsed); }
.zgs-shell.sidebar-collapsed .zgs-sidebar-brand {
  justify-content: center;
  padding: 16px 10px;
}
.zgs-shell.sidebar-collapsed .zgs-sidebar-brand .logo-img--full {
  display: none;
}
.zgs-shell.sidebar-collapsed .zgs-sidebar-brand .logo-img--icon {
  display: block;
}
.zgs-shell.sidebar-collapsed .zgs-nav-label,
.zgs-shell.sidebar-collapsed .zgs-sidebar-divider,
.zgs-shell.sidebar-collapsed .zgs-sidebar-footer { display: none; }
.zgs-shell.sidebar-collapsed .zgs-nav-item {
  justify-content: center;
  padding: 8px;
  margin: 1px 8px;
  gap: 0;
}
.zgs-shell.sidebar-collapsed .zgs-nav-item .zgs-nav-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.zgs-shell.sidebar-collapsed .zgs-nav-badge { display: none; }

html:not(.dark) .theme-icon-dark { display: block; }
html:not(.dark) .theme-icon-light { display: none; }
html.dark .theme-icon-dark { display: none; }
html.dark .theme-icon-light { display: block; }

/* Logo */
.logo-mark { display: flex; align-items: center; justify-content: center; text-align: center; gap: 10px; text-decoration: none; }
.logo-mark:hover { text-decoration: none; }
.logo-icon {
  width: 34px; height: 34px; border-radius: 9px; background: var(--surface-3);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px;
}
.logo-wordmark {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  color: var(--t1); display: block; line-height: 1.2;
}
.logo-wordmark span { color: var(--gold); }
.logo-tagline { font-size: 10px; font-weight: 500; color: var(--t3); display: block; }
.logo-img {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 34px;
  width: auto;
  max-width: min(180px, 100%);
  object-fit: contain;
  border-radius: 10px;
}

/* Legacy pills (dashboard JS) */
.pill { font-size: .72rem; border-radius: 999px; padding: 4px 10px; font-weight: 600; display: inline-block; }
.pill.on { background: var(--green-dim); color: var(--green); border: 1px solid var(--green-border); }
.pill.off { background: var(--red-dim); color: var(--red); border: 1px solid var(--red-border); }
.pill.warn { background: var(--amber-dim); color: var(--amber); border: 1px solid var(--amber-border); }
.mono { font-family: var(--font-mono); word-break: break-all; font-size: 12.5px; }
.mini {
  background: var(--surface-2); border: 1px solid var(--border-hi); color: var(--t1);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: .8rem; font-weight: 500;
}
.mini:hover { border-color: var(--gold); color: var(--gold); }
.mini.danger:hover { border-color: var(--red); color: var(--red); }
.error { color: var(--red); margin-top: 12px; font-size: .88rem; display: none; }
.error.show { display: block; }
.gen-form { display: flex; gap: 10px; flex-wrap: wrap; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--t1); margin: 0; }

/* Auth layout — explicit dark surface so verify-email / login never flash light theme vars */
.auth-page {
  min-height: 100vh;
  padding: 48px 20px 40px;
  box-sizing: border-box;
  background: radial-gradient(ellipse at 20% 0%, rgba(240, 165, 0, 0.08), transparent 50%), #07080f;
  color: #f0f2ff;
}
.auth-page .auth-title { color: #f0f2ff; }
.auth-page .auth-subtitle,
.auth-page .auth-divider,
.auth-page .auth-foot,
.auth-page .auth-footer,
.auth-page .field-label { color: #8b94c4; }
.auth-layout {
  width: min(100%, 420px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 28px;
}
header.auth-brand {
  width: 100%;
  text-align: center;
  line-height: 0;
}
a.logo-mark {
  justify-content: center;
  text-align: center;
}
a.logo-mark.logo-mark--auth {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  gap: 0;
  text-decoration: none;
  text-align: center;
}
a.logo-mark.logo-mark--auth .logo-img--auth {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 43px;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 10px;
}
.auth-brand-mark {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8b94c4;
  text-align: center;
}
.auth-brand-mark sup {
  font-size: 0.7em;
  top: -0.35em;
}
.auth-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.auth-card-wrap {
  padding: 32px; border: 1px solid #22274a; border-radius: var(--radius-lg);
  background: #0d0f1a; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  color: #f0f2ff;
}
.auth-intro { margin-bottom: 24px; }
.auth-title {
  margin: 0; font-family: var(--font-display); font-size: 1.75rem;
  font-weight: 700; letter-spacing: -0.03em; color: var(--t1);
}
.auth-subtitle { margin: 8px 0 0; color: var(--t3); line-height: 1.5; }
.auth-footer { text-align: center; color: var(--t3); font-size: 0.9375rem; }
.auth-footer a { font-weight: 600; color: var(--gold); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-action-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 8px 0; color: var(--t3); font-size: 0.875rem;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-message {
  margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--red-dim); color: var(--red); border: 1px solid var(--red-border); font-size: 0.875rem;
}
.auth-message.success { background: var(--green-dim); color: var(--green); border-color: var(--green-border); }
.auth-message.alert-banner-dismissible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.auth-message.alert-banner-dismissible .alert-banner-body { flex: 1; min-width: 0; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.auth-checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--t2); margin: 0; }
.auth-checkbox input { accent-color: var(--gold); }
.auth-foot { text-align: center; margin-top: 8px; font-size: .875rem; color: var(--t3); }
.auth-err { color: var(--red); font-size: .78rem; margin-top: 6px; }

/* Stub page */
.stub-page { text-align: center; padding: 48px 24px; }
.stub-page h2 { font-family: var(--font-display); margin: 0 0 8px; }
.stub-page p { color: var(--t3); margin: 0 0 20px; }

/* TailAdmin compatibility (gold tuned) */
.ta-shell {
  --ta-primary: var(--gold);
  --ta-primary-dim: var(--gold-dim);
  --ta-primary-border: var(--gold-border);
  --ta-surface: var(--surface);
  --ta-surface-2: var(--surface-2);
  --ta-border: var(--border);
  --ta-text: var(--t1);
  --ta-muted: var(--t3);
}
.ta-card {
  background: var(--panel-bg);
  border: 1px solid var(--ta-border);
  box-shadow: var(--shadow-card);
}
.ta-surface {
  background: var(--ta-surface-2);
  border: 1px solid var(--ta-border);
}
.ta-page-header .page-title {
  color: var(--ta-text);
}
.ta-page-header .page-subtitle {
  color: var(--ta-muted);
}
.ta-alert strong {
  color: var(--ta-primary);
}
.ta-shell .btn.btn-primary {
  background: var(--ta-primary);
  border-color: var(--ta-primary);
  color: #111;
}
.ta-shell .btn.btn-primary:hover {
  filter: brightness(1.02);
}
.ta-shell .btn.btn-outline {
  border-color: var(--ta-primary-border);
}

/* Skeleton loaders */
@keyframes zgsShimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.zgs-skel {
  display: inline-block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
  background-size: 800px 100%;
  animation: zgsShimmer 1.4s ease-in-out infinite;
  vertical-align: middle;
}
.zgs-skel-row td { padding: 14px 16px; }
.zgs-skel-list { padding: 6px 0; }
.zgs-skel-list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.zgs-skel-search { padding: 8px 12px; }
.zgs-skel-search .zgs-skel-list-item { padding: 10px 0; border-bottom-color: var(--border); }
.zgs-skel-feed .feed-item { pointer-events: none; }

@media (max-width: 960px) {
  .zgs-topbar {
    height: auto;
    min-height: var(--topbar-h);
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
    padding: 12px 16px max(12px, env(safe-area-inset-top)) 16px;
    align-items: center;
  }
  .zgs-sidebar-toggle {
    grid-column: 1;
    grid-row: 1;
  }
  .zgs-topbar-end {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    gap: 8px;
    margin-left: 0;
  }
  .zgs-topbar-search {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    width: 100%;
  }
  .zgs-user-menu-name,
  .zgs-user-menu-chevron { display: none; }
  .zgs-user-menu-trigger { padding: 2px; }
  .zgs-sidebar { display: none; }
  .zgs-search { max-width: none; min-width: 0; width: 100%; }
  .zgs-search input { font-size: 16px; height: 44px; }
  .zgs-search input:focus { box-shadow: 0 0 0 2px var(--gold-dim); }
  .zgs-search-kbd { display: none; }
  .zgs-main { padding: 16px 14px; }
  .page-title { font-size: 20px; }
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .data-table { font-size: 12.5px; min-width: 720px; }
  .data-table thead th,
  .data-table tbody td { padding: 9px 12px; }
  .stats-grid,
  .stats-grid-4,
  .stats-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zgs-mobile-drawer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1200;
  }
  .zgs-mobile-drawer[hidden] { display: none !important; }
  .zgs-mobile-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
  }
  .zgs-mobile-drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: min(84vw, 320px);
    height: 100%;
    overflow-y: auto;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 0 0 16px;
  }
  .zgs-mobile-drawer-brand {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
  }
  .zgs-mobile-drawer-brand .logo-img {
    height: 32px;
    max-width: min(160px, 100%);
  }
  .logo-tagline { display: none; }
}
@media (max-width: 640px) {
  .page-title { font-size: 18px; }
  .stats-grid,
  .stats-grid-4,
  .stats-grid-3 { grid-template-columns: 1fr; }
  .zgs-main { padding: 16px 12px; }
  .zgs-topbar { padding-left: 12px; padding-right: 12px; }
  .zgs-icon-btn { width: 40px; height: 40px; }
  .zgs-avatar { width: 36px; height: 36px; font-size: 12px; }
}

/* Admin pagination */
.zgs-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.zgs-pagination-meta {
  margin: 0;
  font-size: 12px;
  color: var(--t3);
}
.zgs-pagination-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.zgs-page-disabled {
  opacity: 0.45;
  pointer-events: none;
}
