:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #06b6d4;
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #94a3b8;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --sidebar-bg: #0f172a;
  --sidebar-active: rgba(37,99,235,.2);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
  --transition: .2s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════ Layout ═══════════ */
.layout-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: 264px;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand-icon { flex-shrink: 0; color: #60a5fa; }

.sidebar-logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .5px;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.nav-group { margin-bottom: 24px; }

.nav-title {
  font-size: 11px;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 12px 8px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  border-radius: 10px;
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-svg {
  width: 18px; height: 18px; margin-right: 12px;
  flex-shrink: 0; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  opacity: .7; transition: opacity var(--transition);
}

.nav-item.active .nav-svg { opacity: 1; }

.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #60a5fa;
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: #60a5fa;
}

/* ═══════════ Top Bar ═══════════ */
.layout-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  height: 64px;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  z-index: 10;
  position: sticky;
  top: 0;
}

.topbar-left { display: flex; align-items: baseline; gap: 12px; }

.topbar-title { font-size: 18px; font-weight: 700; color: var(--text); }

.topbar-subtitle { color: var(--muted); font-size: 13px; }

.topbar-pill {
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(37,99,235,.1);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.role-pill {
  background: rgba(16,185,129,.08);
  color: var(--success);
  border-color: rgba(16,185,129,.15);
}

.logout-btn { height: 34px !important; font-size: 13px; padding: 0 14px !important; }

.layout-content {
  padding: 24px 28px 40px;
  flex: 1;
  overflow-y: auto;
}

/* ═══════════ Login ═══════════ */
.login-scene {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a1628 0%, #0f2544 35%, #0d1f3c 65%, #091929 100%);
  overflow: hidden;
}

.login-scene #loginCanvas {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}

.login-glass-card {
  position: relative; z-index: 2;
  width: 420px; max-width: 92vw;
  padding: 44px 36px 32px;
  border-radius: 24px;
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 32px 64px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.1);
}

.login-brand { text-align: center; margin-bottom: 8px; }

.login-logo-ring {
  display: inline-flex; align-items: center; justify-content: center;
  width: 68px; height: 68px; border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  box-shadow: 0 8px 24px rgba(20,84,216,.4);
  margin-bottom: 18px;
}

.login-title { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: 2px; margin: 0; }

.login-subtitle {
  margin: 6px 0 0; font-size: 12px; color: rgba(255,255,255,.4);
  letter-spacing: 1.5px; text-transform: uppercase;
}

.login-divider {
  height: 1px; margin: 24px 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
}

.login-fields { display: grid; gap: 18px; }
.login-field-group {}

.login-label {
  display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,.55); letter-spacing: .5px;
}

.login-input-wrap { position: relative; display: flex; align-items: center; }

.login-input-icon {
  position: absolute; left: 14px; width: 18px; height: 18px;
  color: rgba(255,255,255,.3); pointer-events: none; z-index: 1;
}

.login-input-wrap input {
  width: 100%; height: 48px; padding: 0 16px 0 44px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 14px;
  background: rgba(255,255,255,.06); color: #fff; font-size: 15px;
  outline: none; transition: border-color .2s, background .2s, box-shadow .2s;
}

.login-input-wrap input::placeholder { color: rgba(255,255,255,.25); }

.login-input-wrap input:focus {
  border-color: rgba(59,130,246,.6);
  background: rgba(255,255,255,.09);
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}

.login-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #3b82f6, #60a5fa);
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37,99,235,.35);
  transition: transform .18s, box-shadow .18s;
  margin-top: 6px;
}

.login-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(37,99,235,.45); }
.login-btn:active { transform: translateY(0); }

.login-msg { text-align: center; font-size: 13px; min-height: 20px; color: #fca5a5; }
.login-msg:empty { display: none; }

.login-footer {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  margin-top: 28px; font-size: 11px; color: rgba(255,255,255,.28);
}

.login-dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,.2); }

/* ═══════════ Typography ═══════════ */
.card-head h3, .card-header h3, .section-title {
  margin: 0; color: var(--text); font-weight: 700;
}

.card-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.section-title { font-size: 18px; }

.section-eyebrow {
  margin-bottom: 6px; color: var(--primary); font-size: 12px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase;
}

.spacer { margin-right: auto; }

/* ═══════════ Form Controls ═══════════ */
input:not([type="checkbox"]):not([type="radio"]),
select, button, textarea {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 13px;
  font-size: 14px;
  font-family: inherit;
}

textarea {
  height: auto; padding: 10px 13px;
  resize: vertical; line-height: 1.6;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  min-width: 150px; background: var(--surface); color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

textarea {
  min-width: 150px; background: var(--surface); color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  background: var(--surface);
}

/* Toggle switch */
input[type="checkbox"]:not(.table-check):not(.owner-check):not(.user-check):not(.ticket-option-input):not(.miniapp-vote-option-input) {
  -webkit-appearance: none; appearance: none;
  position: relative; width: 44px; height: 24px;
  border: 2px solid #cbd5e1; border-radius: 999px;
  background: #e2e8f0; cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  vertical-align: middle; flex-shrink: 0;
}

input[type="checkbox"]:not(.table-check):not(.owner-check):not(.user-check):not(.ticket-option-input):not(.miniapp-vote-option-input)::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform var(--transition);
}

input[type="checkbox"]:not(.table-check):not(.owner-check):not(.user-check):not(.ticket-option-input):not(.miniapp-vote-option-input):checked { background: var(--primary); border-color: var(--primary); }
input[type="checkbox"]:not(.table-check):not(.owner-check):not(.user-check):not(.ticket-option-input):not(.miniapp-vote-option-input):checked::after { transform: translateX(20px); }
input[type="checkbox"]:not(.table-check):not(.owner-check):not(.user-check):not(.ticket-option-input):not(.miniapp-vote-option-input):disabled { opacity: .5; cursor: not-allowed; }

.table-check,
.owner-check,
.user-check,
.ticket-option-input[type="checkbox"],
.miniapp-vote-option-input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  position: relative; width: 18px; height: 18px;
  border: 2px solid #cbd5e1; border-radius: 5px; background: #fff;
  cursor: pointer; transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  vertical-align: middle; flex-shrink: 0;
}

.table-check::after,
.owner-check::after,
.user-check::after,
.ticket-option-input[type="checkbox"]::after,
.miniapp-vote-option-input[type="checkbox"]::after {
  content: ""; position: absolute; left: 4px; top: 0;
  width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0); transition: transform .12s ease;
}

.table-check:checked,
.owner-check:checked,
.user-check:checked,
.ticket-option-input[type="checkbox"]:checked,
.miniapp-vote-option-input[type="checkbox"]:checked {
  background: var(--primary); border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.table-check:checked::after,
.owner-check:checked::after,
.user-check:checked::after,
.ticket-option-input[type="checkbox"]:checked::after,
.miniapp-vote-option-input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }

/* Radio */
input[type="radio"] {
  -webkit-appearance: none; appearance: none;
  position: relative; width: 20px; height: 20px;
  border: 2px solid #cbd5e1; border-radius: 50%; background: #fff;
  cursor: pointer; transition: border-color var(--transition), background var(--transition);
  vertical-align: middle; flex-shrink: 0;
}

input[type="radio"]::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 10px; height: 10px; border-radius: 50%; background: #fff;
  transform: translate(-50%,-50%) scale(0); transition: transform .15s;
}

input[type="radio"]:checked { background: var(--primary); border-color: var(--primary); }
input[type="radio"]:checked::after { transform: translate(-50%,-50%) scale(1); }

#ballotOptionsList input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px;
  border: 2px solid #cbd5e1; border-radius: 6px; background: #fff;
  cursor: pointer; transition: background var(--transition), border-color var(--transition);
}

#ballotOptionsList input[type="checkbox"]::after {
  content: ""; position: absolute; top: 1px; left: 5px;
  width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0); transition: transform .15s;
}

#ballotOptionsList input[type="checkbox"]:checked { background: var(--primary); border-color: var(--primary); }
#ballotOptionsList input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }

/* ═══════════ Buttons ═══════════ */
button {
  background: var(--primary);
  color: #fff;
  border: 0;
  cursor: pointer;
  padding: 0 18px;
  font-weight: 600;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

button:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

button:active { transform: translateY(0); }

button.secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
}

button.secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

button.danger {
  background: var(--danger);
  box-shadow: 0 4px 12px rgba(239,68,68,.2);
}

button.danger:hover { background: #dc2626; }

/* ═══════════ Data Table ═══════════ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  background: var(--surface);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

tbody tr { transition: background var(--transition); }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: 0; }

/* ═══════════ Content Card ═══════════ */
.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}

.content-card .card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}

.content-card .card-header h3 {
  margin: 0; font-size: 18px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}

.content-card .card-header h3::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}

.content-card .toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

.content-card table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}

table { width: 100%; border-collapse: separate; border-spacing: 0; }

/* ═══════════ Stats Grid ═══════════ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.stat {
  position: relative;
  overflow: hidden;
  min-height: 110px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}

.stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37,99,235,.15);
}

.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}

.stat:hover::before { opacity: 1; }

.stat span {
  position: relative; z-index: 1;
  font-weight: 500; font-size: 13px;
  color: var(--muted);
}

.stat strong {
  position: relative; z-index: 1;
  display: block; font-size: 28px;
  margin-top: 10px; color: var(--text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ═══════════ Badges ═══════════ */
.badge {
  display: inline-flex; align-items: center;
  height: 24px; border-radius: 6px; padding: 0 8px;
  font-size: 12px; font-weight: 600;
  background: var(--primary-light); color: var(--primary);
}

.badge.success { background: rgba(16,185,129,.1); color: var(--success); }
.badge.warning { background: rgba(245,158,11,.1); color: var(--warning); }
.badge.danger { background: rgba(239,68,68,.1); color: var(--danger); }

/* ═══════════ Pager ═══════════ */
.pager {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 12px; margin-top: 16px;
}

/* ═══════════ Notices ═══════════ */
.notice {
  margin-top: 12px; padding: 14px 16px;
  border: 1px solid rgba(37,99,235,.12); border-radius: var(--radius);
  background: var(--primary-light); color: var(--text-secondary);
  font-size: 13px; line-height: 1.6;
}

.role-note {
  margin-bottom: 16px; padding: 14px 16px;
  border: 1px solid rgba(16,185,129,.15); border-radius: var(--radius);
  background: rgba(16,185,129,.05); color: #065f46;
  font-size: 13px; line-height: 1.7;
}

/* ═══════════ Actions ═══════════ */
.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.activity-table {
  table-layout: fixed;
}

.activity-table .activity-col-id {
  width: 52px;
}

.activity-table .activity-col-community {
  width: 130px;
}

.activity-table .activity-col-time {
  width: 160px;
}

.activity-table .activity-col-count {
  width: 72px;
}

.activity-table .activity-col-toggle {
  width: 78px;
}

.activity-table .activity-col-status {
  width: 86px;
}

.activity-table .activity-col-actions {
  width: 128px;
}

.activity-table th,
.activity-table td {
  padding: 12px 10px;
}

.activity-table th:first-child,
.activity-table td:first-child,
.activity-table td:nth-child(5),
.activity-table td:nth-child(6),
.activity-table td:nth-child(7),
.activity-table td:nth-child(8),
.activity-table td:nth-child(9),
.activity-table td:nth-child(10),
.activity-table td:nth-child(11) {
  text-align: center;
}

.activity-table td:nth-child(2),
.activity-table td:nth-child(4) {
  white-space: normal;
  word-break: break-word;
}

.activity-table td:nth-child(2) strong {
  display: block;
}

.activity-actions-cell {
  white-space: normal;
  width: 128px;
  min-width: 128px;
}

.activity-actions {
  width: 100%;
  max-width: 128px;
  flex-direction: column;
  align-items: stretch;
}

.activity-actions button {
  width: 100%;
  flex: none;
}

td .secondary, td button { height: 32px; padding: 0 10px; font-size: 12px; border-radius: 8px; }

.muted { color: var(--muted); }

.form-label {
  display: block; margin-bottom: 6px; font-size: 13px;
  font-weight: 600; color: var(--text-secondary);
}

/* ═══════════ Modal ═══════════ */
.image-modal {
  position: fixed; inset: 0;
  display: none; align-items: center; justify-content: center;
  padding: 32px;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  animation: modalBgIn .2s ease;
}

.image-modal.show { display: flex; }

@keyframes modalBgIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.image-modal-body {
  position: relative;
  max-width: 92vw; max-height: 88vh;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  animation: modalSlideIn .25s ease;
  overflow: hidden;
}

.ticket-option-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  margin-bottom: 10px;
}

.ticket-option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.ticket-option-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.ticket-option-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.image-modal-body img {
  display: block; max-width: 86vw; max-height: 78vh;
  border-radius: var(--radius); object-fit: contain;
}

.image-modal-close {
  position: absolute; right: 16px; top: 16px;
  height: 32px !important; padding: 0 12px !important;
  font-size: 13px;
}

/* ═══════════ Chart Containers ═══════════ */
.chart-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chart-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--surface);
}

.chart-box h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ═══════════ Responsive ═══════════ */
@media (max-width: 1024px) {
  .sidebar { width: 220px; }
  .layout-content { padding: 20px 18px 32px; }
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar {
    align-items: flex-start; flex-direction: column;
    padding: 16px 18px; height: auto;
  }
  .topbar-actions { justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .data-table, .content-card table { display: block; overflow-x: auto; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  input, select, button { width: 100%; }
  .pager { justify-content: stretch; flex-wrap: wrap; }
}
