/* ─────────────────────────────────────────────────────────────────────────
   SankiEvents — Design System v2
   Inspired by the Sanki logo: electric gradient (cyan→blue→magenta→violet)
   on a deep charcoal/near-black base. Premium, festival-event feel.
   ───────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Sora:wght@600;700;800&display=swap');

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

:root {
  /* Base surfaces */
  --bg-base: #0a0a0f;
  --bg-surface: #111118;
  --bg-raised: #18181f;
  --bg-card: #1c1c25;
  --bg-border: #2a2a38;
  --bg-border-subtle: #1f1f2b;

  /* Text */
  --text-primary: #f0f0f8;
  --text-secondary: #9494b0;
  --text-muted: #5a5a78;

  /* Brand gradient (matches logo: cyan → blue → magenta → violet) */
  --grad: linear-gradient(135deg, #00d4ff 0%, #7c3aed 45%, #ec4899 100%);
  --grad-soft: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(124, 58, 237, 0.15) 45%, rgba(236, 72, 153, 0.15) 100%);
  --grad-border: linear-gradient(135deg, #00d4ff, #7c3aed, #ec4899);

  /* Accent (primary CTA — violet) */
  --accent: #7c3aed;
  --accent-light: #a855f7;
  --accent-hover: #6d28d9;
  --accent-dim: rgba(124, 58, 237, 0.18);
  --accent-border: rgba(124, 58, 237, 0.4);

  /* Cyan (secondary highlight) */
  --cyan: #00d4ff;
  --cyan-dim: rgba(0, 212, 255, 0.12);

  /* Pink (tertiary / punch) */
  --pink: #ec4899;
  --pink-dim: rgba(236, 72, 153, 0.15);

  /* Semantic colours */
  --danger: #f43f5e;
  --danger-dim: rgba(244, 63, 94, 0.15);
  --success: #10b981;
  --success-dim: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-dim: rgba(245, 158, 11, 0.15);

  /* Layout */
  --sidebar-w: 252px;
  --topbar-h: 62px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 32px rgba(124, 58, 237, 0.2);
}

/* ── Light theme override ──
   Toggled by setting data-theme="light" on <html>. Brand/semantic colours
   stay the same so gradients, badges, etc. remain on-brand in both modes. */
[data-theme='light'] {
  --bg-base: #f6f6fb;
  --bg-surface: #ffffff;
  --bg-raised: #f0f0f7;
  --bg-card: #ffffff;
  --bg-border: #e2e2ee;
  --bg-border-subtle: #ebebf3;

  --text-primary: #16161f;
  --text-secondary: #57576e;
  --text-muted: #8a8aa0;

  --shadow: 0 4px 24px rgba(30, 30, 60, 0.08);
  --shadow-glow: 0 0 32px rgba(124, 58, 237, 0.12);
}

[data-theme='light'] .sidebar,
[data-theme='light'] .topbar {
  box-shadow: none;
}

[data-theme='light'] .modal-backdrop {
  background: rgba(20, 20, 35, 0.35);
}

html,
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  height: 100%;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ── Theme toggle button ── */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 6px;
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-border);
}

.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn .icon-moon { display: inline-flex; }
[data-theme='light'] .theme-toggle-btn .icon-sun { display: inline-flex; }
[data-theme='light'] .theme-toggle-btn .icon-moon { display: none; }

/* ── Mobile sidebar / hamburger ── */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 12px;
  left: 14px;
  width: 38px;
  height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  z-index: 120;
  box-shadow: var(--shadow);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99;
}

.sidebar-overlay.open {
  display: block;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

/* ── Layout ── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--bg-border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.4);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--bg-border-subtle);
}

.sidebar-brand > .sidebar-close-btn {
  margin-left: auto;
}

/* Gradient logo mark */
.sidebar-logo {
  width: 38px;
  height: 38px;
  background: var(--grad);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.45);
}

.sidebar-name {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 15px;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.sidebar-role {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 10px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  margin-bottom: 1px;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-raised);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent-light);
  font-weight: 600;
  border: 1px solid var(--accent-border);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 70%;
  background: var(--grad);
  border-radius: 0 2px 2px 0;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--bg-border-subtle);
}

/* ── Main area ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--bg-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(8px);
}

.topbar-title {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-content {
  padding: 28px;
  flex: 1;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--bg-border);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Stat tiles ── */
.stats-row {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-tile {
  flex: 1;
  min-width: 150px;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stat-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.2s;
}

.stat-tile:hover::before {
  opacity: 1;
}

.stat-tile:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-glow);
}

.stat-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 8px;
  line-height: 1;
  font-family: 'Sora', sans-serif;
}

.stat-value.accent {
  color: var(--accent-light);
}

.stat-value.success {
  color: var(--success);
}

.stat-value.danger {
  color: var(--danger);
}

.stat-value.cyan {
  color: var(--cyan);
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

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

/* Primary — gradient */
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
  opacity: 0.92;
}

.btn-secondary {
  background: var(--bg-raised);
  color: var(--text-primary);
  border: 1px solid var(--bg-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-border);
  border-color: var(--text-muted);
}

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

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
  opacity: 0.88;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-raised);
}

.btn-cyan {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.btn-cyan:hover:not(:disabled) {
  background: var(--cyan);
  color: var(--bg-base);
}

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

.btn-icon {
  padding: 7px;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--bg-raised);
}

thead tr {
  border-bottom: 1px solid var(--bg-border);
}

th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  padding: 11px 14px;
  white-space: nowrap;
}

td {
  padding: 13px 14px;
  font-size: 13.5px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--bg-border-subtle);
  vertical-align: middle;
}

tbody tr {
  transition: background 0.12s;
}

tbody tr:hover td {
  background: var(--bg-raised);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-warning {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-accent {
  background: var(--accent-dim);
  color: var(--accent-light);
  border: 1px solid var(--accent-border);
}

.badge-cyan {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.badge-pink {
  background: var(--pink-dim);
  color: var(--pink);
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.badge-muted {
  background: var(--bg-raised);
  color: var(--text-muted);
  border: 1px solid var(--bg-border);
}

.badge-grad {
  background: var(--grad);
  color: #fff;
  border: none;
  box-shadow: 0 1px 8px rgba(124, 58, 237, 0.3);
}

/* ── Forms ── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13.5px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 5px;
}

.form-row {
  display: flex;
  gap: 14px;
}

.form-row .form-group {
  flex: 1;
}

/* ── Modal ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow), var(--shadow-glow);
  padding: 28px;
  position: relative;
}

.modal-lg {
  max-width: 800px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-title {
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  display: flex;
}

.modal-close:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-dim);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--bg-border);
}

/* ── Alerts ── */
.alert {
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  font-weight: 500;
}

.alert.show {
  display: block;
}

.alert-error {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.alert-success {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.alert-warning {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.alert-info {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid rgba(0, 212, 255, 0.3);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--bg-border);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ── Section labels ── */
.section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ── Empty states ── */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  opacity: 0.3;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
  margin-top: 8px;
}

/* ── Tags/chips ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: 20px;
  font-size: 12.5px;
  color: var(--text-secondary);
  transition: border-color 0.15s;
}

.tag:hover {
  border-color: var(--accent-border);
}

.tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.tag-remove:hover {
  color: var(--danger);
}

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

/* ── Toggle ── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle {
  appearance: none;
  width: 40px;
  height: 22px;
  background: var(--bg-border);
  border-radius: 22px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: left 0.2s, background 0.2s;
}

.toggle:checked {
  background: var(--accent);
}

.toggle:checked::after {
  left: 22px;
  background: #fff;
}

/* ── Auth pages ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at top right, rgba(124, 58, 237, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(0, 212, 255, 0.1) 0%, transparent 60%),
    var(--bg-base);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow), var(--shadow-glow);
}

.auth-logo {
  width: 52px;
  height: 52px;
  background: var(--grad);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 900;
  font-size: 24px;
  color: #fff;
  margin-bottom: 24px;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.4);
}

.auth-title {
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ── Accordion (event detail) ── */
.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.accordion-item:hover {
  border-color: var(--accent-border);
}

.accordion-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.accordion-header:hover {
  background: var(--bg-raised);
}

.accordion-header.open {
  background: var(--bg-raised);
}

.accordion-title {
  font-weight: 700;
  font-size: 14px;
}

.accordion-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.accordion-body {
  display: none;
  padding: 18px;
  border-top: 1px solid var(--bg-border);
}

.accordion-body.open {
  display: block;
}

/* ── Qty stepper ── */
.qty-display {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: fit-content;
  background: var(--bg-raised);
}

.qty-btn {
  width: 40px;
  height: 40px;
  background: var(--bg-raised);
  border: none;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.qty-btn:hover {
  background: var(--accent-dim);
}

.qty-value {
  width: 64px;
  height: 40px;
  text-align: center;
  background: var(--bg-raised);
  border: none;
  border-left: 1px solid var(--bg-border);
  border-right: 1px solid var(--bg-border);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  outline: none;
}

/* ── Stock bar ── */
.stock-bar {
  height: 5px;
  background: var(--bg-border);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.stock-bar-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 3px;
  transition: width 0.35s;
}

/* ── Gradient accent on cards ── */
.card-accent-top {
  position: relative;
  overflow: hidden;
}

.card-accent-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad);
}

/* ── Copy cells (unbooked page) ── */
.copy-cell {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
  display: inline-block;
  position: relative;
}

.copy-cell:hover {
  background: var(--accent-dim);
  color: var(--accent-light);
}

.copy-cell:hover::after {
  content: 'Click to copy';
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  color: var(--text-muted);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.copy-cell.flash {
  background: var(--success-dim) !important;
  color: var(--success) !important;
}

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.filter-bar .form-group {
  margin-bottom: 0;
  min-width: 160px;
}

.filter-bar .form-control {
  min-width: 140px;
}

/* ── Utilities ── */
.d-none {
  display: none !important;
}

.d-flex {
  display: flex;
}

.gap-1 {
  gap: 6px;
}

.gap-2 {
  gap: 10px;
}

.gap-3 {
  gap: 14px;
}

.mt-1 {
  margin-top: 6px;
}

.mt-2 {
  margin-top: 12px;
}

.mt-3 {
  margin-top: 20px;
}

.mb-3 {
  margin-bottom: 20px;
}

.text-muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--accent-light);
}

.text-cyan {
  color: var(--cyan);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-pink {
  color: var(--pink);
}

.text-sm {
  font-size: 12px;
}

.text-xs {
  font-size: 11px;
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

.fw-800 {
  font-weight: 800;
}

.w-100 {
  width: 100%;
}

.separator {
  border: none;
  border-top: 1px solid var(--bg-border);
  margin: 18px 0;
}

/* ── Page header with gradient accent ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* ── Disabled form controls (cascading filters) ── */
.form-control:disabled,
select.form-control:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--bg-surface);
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid var(--bg-border);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
.spinner-lg { width: 22px; height: 22px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.table-loading-row td {
  text-align: center;
  padding: 56px 20px !important;
  color: var(--text-muted);
}
.table-loading-row .spinner { margin-right: 8px; }

/* Dim table while a background refetch is in-flight (filters still visible) */
.table-wrap.is-loading table tbody { opacity: 0.35; pointer-events: none; transition: opacity 0.15s; }

/* ── Pagination ── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--bg-border);
  flex-wrap: wrap;
}
.pagination-info { font-size: 12px; color: var(--text-muted); }
.pagination-controls { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 30px; height: 30px;
  padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--accent-border); color: var(--text-primary); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.page-btn.active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}
.page-ellipsis { color: var(--text-muted); padding: 0 4px; font-size: 12px; }

/* ── Dashboard layout ── */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 980px) {
  .dash-grid { grid-template-columns: 1fr; }
}
.dash-stack { display: flex; flex-direction: column; gap: 18px; }

.kpi-tile {
  flex: 1;
  min-width: 168px;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.kpi-tile:hover { border-color: var(--accent-border); box-shadow: var(--shadow-glow); }
.kpi-tile-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim);
  color: var(--accent-light);
  flex-shrink: 0;
}
.kpi-tile-icon.success { background: rgba(16,185,129,0.15); color: var(--success); }
.kpi-tile-icon.danger  { background: var(--danger-dim); color: var(--danger); }
.kpi-tile-icon.cyan    { background: var(--cyan-dim); color: var(--cyan); }
.kpi-tile-icon.pink    { background: var(--pink-dim); color: var(--pink); }
.kpi-tile-body { display: flex; flex-direction: column; }

/* ── Mini bar chart ── */
.mini-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding-top: 8px;
}
.mini-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 6px;
}
.mini-bar {
  width: 100%;
  max-width: 22px;
  border-radius: 3px 3px 0 0;
  background: var(--grad);
  opacity: 0.85;
  transition: opacity 0.15s;
}
.mini-bar-col:hover .mini-bar { opacity: 1; }
.mini-bar-label {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 6px;
  white-space: nowrap;
}
.chart-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 0;
}

/* ── Donut chart ── */
.donut-chart-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 18px;
}
.donut-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.donut-center-value { font-family: 'Sora', sans-serif; font-size: 24px; font-weight: 800; color: var(--text-primary); line-height:1; }
.donut-center-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.donut-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-label { color: var(--text-secondary); flex: 1; }
.donut-legend-value { color: var(--text-primary); font-weight: 700; }

/* ── Top events / recent list rows ── */
.rank-badge {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-dim);
  color: var(--accent-light);
  font-size: 11px; font-weight: 800;
  flex-shrink: 0;
}
.mini-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--bg-border);
}
.mini-list-row:last-child { border-bottom: none; }
.mini-list-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.mini-list-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.mini-list-value { font-size: 13px; font-weight: 700; color: var(--text-primary); white-space: nowrap; }

/* ── Field validation (e.g. mobile number) ── */
.form-control.is-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15) !important;
}

.field-error-msg {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--danger);
  font-weight: 600;
  margin-top: 6px;
}

.field-error-msg.show {
  display: flex;
}

/* ─────────────────────────────────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────────────────────────────────── */

@media (max-width: 980px) {
  .stat-tile,
  .kpi-tile {
    min-width: 140px;
  }
}

@media (max-width: 880px) {
  .mobile-menu-btn {
    display: flex;
  }

  .sidebar-close-btn {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: none;
    width: min(var(--sidebar-w), 82vw);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.4);
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    padding: 0 16px 0 60px;
    flex-wrap: wrap;
    height: auto;
    min-height: var(--topbar-h);
    gap: 8px;
  }

  .topbar-title {
    font-size: 14px;
  }

  .topbar-actions {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
  }

  .page-content {
    padding: 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .stats-row,
  .stat-tile,
  .kpi-tile {
    min-width: 0;
  }

  .stats-row > .stat-tile,
  .stats-row > .kpi-tile {
    flex: 1 1 calc(50% - 7px);
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .filter-bar {
    padding: 14px;
  }

  .filter-bar .form-group {
    flex: 1 1 100%;
    min-width: 0;
  }

  .filter-bar .form-control {
    min-width: 0;
    width: 100%;
  }

  .modal {
    max-width: calc(100vw - 24px);
    padding: 20px;
    max-height: calc(100vh - 24px);
  }

  .modal-footer {
    flex-wrap: wrap;
  }

  .auth-card {
    padding: 28px 22px;
  }

  .card {
    padding: 16px;
  }

  th, td {
    padding: 10px 12px;
  }
}

@media (max-width: 520px) {
  .stats-row > .stat-tile,
  .stats-row > .kpi-tile {
    flex: 1 1 100%;
  }

  .btn {
    padding: 8px 14px;
  }

  .auth-card {
    padding: 24px 18px;
  }
}

.js-pm-wallet-balance{
  color: var(--accent-light);
  font-weight: 800;
}