/* ════════════════════════════════════════════════════════════════════
   Reuni 2001 Silver — Stylesheet
   Theme: SMU Indonesia (Kuning + Maroon + Biru-Tua)
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* brand */
  --c-primary:        #fbb800;
  --c-primary-600:    #e0a300;
  --c-primary-50:     #fff7e0;
  --c-secondary:      #9e2c2e;
  --c-secondary-600:  #7a2123;
  --c-secondary-50:   #fbeaea;
  --c-accent:         #1f3c88;
  --c-accent-600:     #162d6a;

  /* surface */
  --c-bg:             #f7f8fa;
  --c-surface:        #ffffff;
  --c-surface-alt:    #f3f4f6;
  --c-border:         #e5e7eb;
  --c-border-strong:  #d1d5db;
  --c-text:           #1f2937;
  --c-text-muted:     #6b7280;
  --c-text-soft:      #9ca3af;

  --c-success:        #16a34a;
  --c-success-50:     #dcfce7;
  --c-warning:        #f59e0b;
  --c-warning-50:     #fef3c7;
  --c-danger:         #ef4444;
  --c-danger-50:      #fee2e2;
  --c-info:           #0ea5e9;
  --c-info-50:        #e0f2fe;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.12);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --sidebar-w:   240px;
  --sidebar-w-collapsed: 64px;
  --topbar-h:    56px;
}

html[data-theme="dark"] {
  --c-bg:             #0f172a;
  --c-surface:        #1e293b;
  --c-surface-alt:    #283447;
  --c-border:         #334155;
  --c-border-strong:  #475569;
  --c-text:           #e2e8f0;
  --c-text-muted:     #94a3b8;
  --c-text-soft:      #64748b;
  /* lighter tinted backgrounds for badges & active states (better contrast) */
  --c-primary-50:     rgba(251, 184, 0, 0.16);
  --c-secondary-50:   rgba(158, 44, 46, 0.22);
  --c-success-50:     rgba(22, 163, 74, 0.18);
  --c-warning-50:     rgba(245, 158, 11, 0.18);
  --c-danger-50:      rgba(239, 68, 68, 0.18);
  --c-info-50:        rgba(14, 165, 233, 0.18);
}

/* ── Dark-mode badge & active overrides — use bright text on tinted bg ──── */
html[data-theme="dark"] .nav-item.active {
  color: #fbb800;
}
html[data-theme="dark"] .nav-item.active .nav-icon { color: #fbb800; }
html[data-theme="dark"] .badge-pill.primary { color: #fbb800; }
html[data-theme="dark"] .badge-pill.secondary,
html[data-theme="dark"] .badge-pill.danger  { color: #fca5a5; }
html[data-theme="dark"] .badge-pill.success { color: #4ade80; }
html[data-theme="dark"] .badge-pill.warning { color: #fbbf24; }
html[data-theme="dark"] .badge-pill.info    { color: #7dd3fc; }
html[data-theme="dark"] .alert-success { color: #4ade80; }
html[data-theme="dark"] .alert-error,
html[data-theme="dark"] .alert-danger  { color: #fca5a5; }
html[data-theme="dark"] .alert-info    { color: #7dd3fc; }

/* btn-primary keeps yellow background; ensure dark text stays readable */
html[data-theme="dark"] .btn-primary { color: #1a1a1a; }
html[data-theme="dark"] .btn-warning { color: #1a1a1a; }

/* Form controls in dark mode */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] textarea.form-control {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border);
}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
  border-color: #fbb800;
  box-shadow: 0 0 0 3px rgba(251, 184, 0, 0.15);
}
html[data-theme="dark"] .form-control::placeholder { color: var(--c-text-soft); }
html[data-theme="dark"] .input-group .input-addon {
  background: var(--c-surface-alt);
  border-color: var(--c-border);
  color: var(--c-text-muted);
}

/* DataTable header/body in dark */
html[data-theme="dark"] table.dt thead th {
  background: var(--c-surface-alt);
  color: var(--c-text-soft);
}
html[data-theme="dark"] table.dt tbody tr:hover { background: rgba(251, 184, 0, 0.05); }
html[data-theme="dark"] .dt-pager-buttons button {
  background: var(--c-surface);
  border-color: var(--c-border);
  color: var(--c-text);
}
html[data-theme="dark"] .dt-pager-buttons button:hover:not(:disabled) { background: var(--c-surface-alt); }

/* Modal in dark */
html[data-theme="dark"] .modal-footer { background: rgba(0,0,0,0.2); }

/* Code & pre */
html[data-theme="dark"] code,
html[data-theme="dark"] pre {
  background: var(--c-surface-alt);
  color: var(--c-text);
}

/* Logo preview — checkered transparency pattern (so transparent PNGs render correctly) */
.logo-preview {
  width: 120px; height: 120px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  background-color: #f8fafc;
  background-image:
    linear-gradient(45deg, #d1d5db 25%, transparent 25%),
    linear-gradient(-45deg, #d1d5db 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d1d5db 75%),
    linear-gradient(-45deg, transparent 75%, #d1d5db 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}
html[data-theme="dark"] .logo-preview {
  background-color: #1e293b;
  background-image:
    linear-gradient(45deg, #334155 25%, transparent 25%),
    linear-gradient(-45deg, #334155 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #334155 75%),
    linear-gradient(-45deg, transparent 75%, #334155 75%);
}
.logo-preview img { max-width: 100%; max-height: 100%; }
.logo-preview .text-muted {
  background: var(--c-surface);
  padding: 4px 8px; border-radius: 4px;
  position: relative; z-index: 1;
}

/* ── Tabs (used in Settings, etc.) ───────────────────────────────── */
.tabs { border-bottom: 1px solid var(--c-border); }
.tab-btn {
  position: relative;
  border: 0;
  background: transparent;
  padding: 10px 16px;
  font-weight: 600;
  color: var(--c-text-muted);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  margin-bottom: -1px;
  transition: color .15s, background .15s;
}
.tab-btn:hover { color: var(--c-text); background: var(--c-surface-alt); }
.tab-btn.active {
  color: var(--c-secondary);
  background: var(--c-primary-50);
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  left: 6px; right: 6px; bottom: -1px;
  height: 3px;
  background: var(--c-primary);
  border-radius: 2px 2px 0 0;
}
html[data-theme="dark"] .tab-btn.active { color: #fbb800; }

/* ── Dark mode link & topbar contrast fixes ──────────────────────── */
/* Plain content links use a brighter blue (the navy #1f3c88 is invisible on dark bg) */
html[data-theme="dark"] a:not(.btn):not(.nav-item):not(.dropdown-menu a):not(.user-menu):not(.brand):not(.skip-to-content) {
  color: #7dd3fc;
}
html[data-theme="dark"] a:not(.btn):not(.nav-item):not(.dropdown-menu a):not(.user-menu):not(.brand):not(.skip-to-content):hover {
  color: #bae6fd;
}

/* Topbar profile pill — brighter background + bold name */
html[data-theme="dark"] .user-menu {
  background: rgba(251, 184, 0, 0.10);
  border-color: rgba(251, 184, 0, 0.25);
}
html[data-theme="dark"] .user-menu .name {
  color: #f1f5f9;
  font-weight: 700;
}
html[data-theme="dark"] .user-menu:hover {
  background: rgba(251, 184, 0, 0.18);
}

/* Topbar icon buttons brighter */
html[data-theme="dark"] .topbar .icon-btn { color: var(--c-text); }
html[data-theme="dark"] .topbar .icon-btn strong { color: #f1f5f9; }

* { box-sizing: border-box; }
html.preload * { transition: none !important; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.5;
  color: var(--c-text); background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ── Skip link ──────────────────────────────────────────────────── */
.skip-to-content {
  position: absolute; left: -9999px; top: -9999px;
}
.skip-to-content:focus {
  left: 8px; top: 8px; z-index: 9999;
  background: var(--c-accent); color: #fff;
  padding: 8px 16px; border-radius: var(--radius-sm);
}

/* ════════════════════════════════════════════════════════════════════
   ADMIN LAYOUT (sidebar + topbar)
   ════════════════════════════════════════════════════════════════════ */

.app-body { min-height: 100vh; }

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex; flex-direction: column;
  /* Leaflet's `.leaflet-top` corner containers use z-index: 1000, so the
     sidebar must sit above that to avoid map controls bleeding through the
     mobile drawer. Modal/toast bumped accordingly to stay on top of sidebar. */
  z-index: 1100;
  transition: width .2s ease, transform .2s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--c-border);
  height: var(--topbar-h); flex-shrink: 0;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-logo { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.sidebar-logo-text {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-secondary) 100%);
  color: #fff; font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-title {
  font-weight: 700; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-toggle-btn {
  background: transparent; border: 0; cursor: pointer; padding: 6px;
  border-radius: var(--radius-sm); color: var(--c-text-muted);
}
.sidebar-toggle-btn:hover { background: var(--c-surface-alt); color: var(--c-text); }

.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 12px 8px;
  scrollbar-width: thin;
}
.nav-section { margin-bottom: 14px; }
.nav-section-label {
  display: block; padding: 6px 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--c-text-soft); letter-spacing: .5px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--c-text); text-decoration: none;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--c-surface-alt); text-decoration: none; }
.nav-item.active {
  background: var(--c-primary-50);
  color: var(--c-secondary);
  font-weight: 700;
}
.nav-item.active .nav-icon { color: var(--c-secondary); }
.nav-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  color: var(--c-text-muted);
}

.topbar {
  position: fixed; left: var(--sidebar-w); right: 0; top: 0;
  height: var(--topbar-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; z-index: 90;
  transition: left .2s ease;
}
.sidebar.collapsed ~ .topbar { left: var(--sidebar-w-collapsed); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.page-title { font-size: 16px; font-weight: 700; margin: 0; }

.icon-btn {
  background: transparent; border: 0; cursor: pointer;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--c-text-muted);
  position: relative;
}
.icon-btn:hover { background: var(--c-surface-alt); color: var(--c-text); }
.icon-btn .badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--c-danger); color: #fff;
  border-radius: 8px; font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

.user-menu {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--c-surface-alt); border: 1px solid var(--c-border);
  cursor: pointer;
}
.user-menu img { width: 28px; height: 28px; border-radius: 50%; }
.user-menu .name { font-size: 13px; font-weight: 600; }

.dropdown {
  position: relative;
}
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 200px; padding: 6px;
  display: none; z-index: 200;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--c-text); text-decoration: none;
  background: transparent; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover {
  background: var(--c-surface-alt); text-decoration: none;
}
.dropdown-divider {
  height: 1px; background: var(--c-border); margin: 4px 0;
}

.page {
  margin-left: var(--sidebar-w);
  padding: calc(var(--topbar-h) + 20px) 24px 24px;
  min-height: 100vh;
  transition: margin-left .2s ease;
}
.sidebar.collapsed ~ .page { margin-left: var(--sidebar-w-collapsed); }

/* Mobile menu button — only on small screens */
.mobile-menu-btn { display: none; }

.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1090;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

@media (max-width: 768px) {
  .mobile-menu-btn { display: inline-flex; }
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0,0,0,.2);
    z-index: 1100;
  }
  .sidebar.open { transform: translateX(0); }
  .topbar, .page { left: 0 !important; margin-left: 0 !important; }
  .topbar { left: 0; padding: 0 12px; }
  .page { padding: calc(var(--topbar-h) + 12px) 12px 12px; }
  .page-title { font-size: 15px; }
  .user-menu .name { display: none; }
  .card { padding: 16px; }
  .card-header { margin: -16px -16px 12px; padding: 14px 16px; }
}

/* ════════════════════════════════════════════════════════════════════
   COMPONENTS
   ════════════════════════════════════════════════════════════════════ */

.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: -20px -20px 16px; padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-header h2, .card-header h3 { margin: 0; font-size: 16px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px; font-weight: 600; line-height: 1;
  cursor: pointer; user-select: none;
  background: var(--c-surface); color: var(--c-text);
  transition: background .15s, border-color .15s, transform .05s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary    { background: var(--c-primary); color: #1a1a1a; border-color: var(--c-primary-600); }
.btn-primary:hover    { background: var(--c-primary-600); }
.btn-secondary  { background: var(--c-secondary); color: #fff; border-color: var(--c-secondary-600); }
.btn-secondary:hover  { background: var(--c-secondary-600); color: #fff; }
.btn-accent     { background: var(--c-accent); color: #fff; border-color: var(--c-accent-600); }
.btn-accent:hover     { background: var(--c-accent-600); }
.btn-success    { background: var(--c-success); color: #fff; border-color: var(--c-success); }
.btn-danger     { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }
.btn-warning    { background: var(--c-warning); color: #1a1a1a; border-color: var(--c-warning); }
.btn-outline    { background: transparent; border-color: var(--c-border-strong); }
.btn-outline:hover    { background: var(--c-surface-alt); }
.btn-ghost      { background: transparent; border-color: transparent; }
.btn-ghost:hover      { background: var(--c-surface-alt); }
.btn-sm         { padding: 5px 10px; font-size: 12px; }
/* ── Icon-only square button — use for table action columns ─── */
.btn-icon { width: 32px; height: 32px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.btn-icon svg { width: 14px; height: 14px; }
/* ── Dropdown menu items — text actions inside dropdown-menu ── */
.menu-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 14px; background: transparent; border: 0; cursor: pointer;
  font-size: 13px; color: var(--c-text); text-decoration: none;
}
.menu-item:hover { background: var(--c-surface-alt); }
.menu-item.text-warning { color: var(--c-warning, #d97706); }
.menu-item.text-danger { color: var(--c-danger, #dc2626); }
.menu-item.text-success { color: var(--c-success, #16a34a); }
/* ── Table row hover for all DataTables ─────────────────────── */
.dt tbody tr:hover { background: var(--c-surface-alt); }
/* ── Mono identifier (username, code, sku) ──────────────────── */
.text-mono { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); font-size: 13px; letter-spacing: 0.2px; }
.btn-lg         { padding: 12px 22px; font-size: 14px; }
.btn-block      { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-row { display: grid; gap: 14px; }
@media (min-width: 720px) {
  .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.form-label {
  display: block; margin-bottom: 5px;
  font-weight: 600; font-size: 13px; color: var(--c-text);
}
.form-label .req { color: var(--c-danger); margin-left: 2px; }
.form-control, .form-select, textarea.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
  outline: 0; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-50);
}
textarea.form-control { min-height: 80px; resize: vertical; }
.form-help { font-size: 12px; color: var(--c-text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--c-danger); margin-top: 4px; }
.form-check {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px;
}
.form-check input { width: 16px; height: 16px; }

.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: 0; }
.input-group .form-control:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .form-control:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .input-addon {
  display: inline-flex; align-items: center;
  padding: 0 12px; background: var(--c-surface-alt);
  border: 1px solid var(--c-border-strong);
  font-size: 13px; color: var(--c-text-muted);
}
.input-group .input-addon:first-child { border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .input-addon:last-child  { border-left:  0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid transparent; margin-bottom: 14px;
  font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: var(--c-success-50); border-color: var(--c-success); color: var(--c-success); }
.alert-error,
.alert-danger  { background: var(--c-danger-50);  border-color: var(--c-danger);  color: var(--c-danger);  }
.alert-warning { background: var(--c-warning-50); border-color: var(--c-warning); color: #92400e; }
.alert-info    { background: var(--c-info-50);    border-color: var(--c-info);    color: var(--c-info);    }
html[data-theme="dark"] .alert-warning { color: var(--c-warning); }

/* ── Badges ──────────────────────────────────────────────────── */
.badge-pill {
  display: inline-block; padding: 2px 9px;
  font-size: 11px; font-weight: 700; border-radius: 999px;
  background: var(--c-surface-alt); color: var(--c-text);
}
.badge-pill.success { background: var(--c-success-50); color: var(--c-success); }
.badge-pill.warning { background: var(--c-warning-50); color: #92400e; }
.badge-pill.danger  { background: var(--c-danger-50); color: var(--c-danger); }
.badge-pill.info    { background: var(--c-info-50); color: var(--c-info); }
.badge-pill.primary { background: var(--c-primary-50); color: var(--c-secondary); }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto; background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius);
}
table.dt {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.dt th, table.dt td {
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
table.dt thead th {
  background: var(--c-surface-alt);
  font-weight: 700; font-size: 12px; text-transform: uppercase;
  letter-spacing: .3px; color: var(--c-text-muted);
  position: sticky; top: 0;
  cursor: pointer; user-select: none;
}
table.dt thead th.sortable::after {
  content: '⇅'; margin-left: 6px; opacity: .4; font-size: 10px;
}
table.dt thead th.sort-asc::after { content: '↑'; opacity: 1; }
table.dt thead th.sort-desc::after { content: '↓'; opacity: 1; }
table.dt tbody tr:hover { background: var(--c-surface-alt); }

.dt-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
}
.dt-toolbar .dt-search { width: auto; flex: 1 1 240px; min-width: 200px; max-width: 480px; }
.dt-pager {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--c-border);
  background: var(--c-surface); font-size: 12px;
}
.dt-pager-buttons { display: flex; gap: 4px; }
.dt-pager-buttons button {
  background: var(--c-surface); border: 1px solid var(--c-border);
  padding: 4px 10px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 12px; color: var(--c-text);
}
.dt-pager-buttons button:hover:not(:disabled) { background: var(--c-surface-alt); }
.dt-pager-buttons button.active {
  background: var(--c-primary); border-color: var(--c-primary-600); color: #1a1a1a; font-weight: 700;
}
.dt-pager-buttons button:disabled { opacity: .4; cursor: not-allowed; }

/* ── Custom Modal ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1200;
  display: none;
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--c-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px; width: 100%; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn .15s ease-out;
}
@keyframes modalIn { from { transform: translateY(8px); opacity: 0; } }
.modal.lg { max-width: 800px; }
.modal.xl { max-width: 1100px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--c-border);
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close {
  background: transparent; border: 0; cursor: pointer;
  width: 32px; height: 32px; border-radius: 6px;
  color: var(--c-text-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--c-surface-alt); color: var(--c-text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--c-border);
  background: var(--c-surface-alt);
}

.confirm-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.confirm-icon.danger { background: var(--c-danger-50); color: var(--c-danger); }
.confirm-icon.warning { background: var(--c-warning-50); color: var(--c-warning); }
.confirm-icon.info { background: var(--c-info-50); color: var(--c-info); }

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 1300; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 16px; min-width: 280px; max-width: 380px;
  pointer-events: auto;
  animation: toastIn .15s ease-out;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px;
}
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } }
.toast.success { border-left: 4px solid var(--c-success); }
.toast.error   { border-left: 4px solid var(--c-danger); }
.toast.warning { border-left: 4px solid var(--c-warning); }
.toast.info    { border-left: 4px solid var(--c-info); }
.toast .close { margin-left: auto; cursor: pointer; opacity: .6; background: transparent; border: 0; }

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

.loading-bar {
  position: fixed; top: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
  z-index: 9999; transition: width .15s, opacity .3s;
}

/* ════════════════════════════════════════════════════════════════════
   AUTH (single page)
   ════════════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-secondary) 100%);
}
.auth-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 420px;
  padding: 32px;
}
.auth-card h1 { margin: 0 0 6px; font-size: 22px; }
.auth-card .auth-sub { color: var(--c-text-muted); margin-bottom: 24px; font-size: 13px; }
.auth-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.auth-brand .auth-logo {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
  color: #fff; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.auth-brand strong { font-size: 16px; }
.auth-brand small { display: block; color: var(--c-text-muted); font-size: 12px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--c-text-muted); }
.auth-locale {
  position: absolute; top: 16px; right: 16px;
  display: flex; gap: 6px;
}
.auth-locale a {
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.2); color: #fff;
  font-size: 12px; font-weight: 600; text-decoration: none;
}
.auth-locale a.active { background: #fff; color: var(--c-secondary); }

/* ════════════════════════════════════════════════════════════════════
   LANDING PAGE (front site)
   ════════════════════════════════════════════════════════════════════ */
.landing { background: var(--c-bg); }
.landing-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
}
html[data-theme="dark"] .landing-nav {
  background: rgba(15,23,42,.95);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.landing-nav .brand { color: var(--c-text); }
html[data-theme="dark"] .landing-nav a:not(.btn) { color: var(--c-text); }
html[data-theme="dark"] .landing-nav a:not(.btn):hover { color: var(--c-primary); }

/* Landing nav toolbar (theme + language dropdowns) */
.land-toolbar { display: inline-flex; gap: 6px; align-items: center; }
.land-dd .land-dd-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--c-text);
  font-family: inherit;
}
.land-dd .land-dd-btn:hover { background: var(--c-surface); border-color: var(--c-border-strong); }
.land-dd .dropdown-menu { right: 0; left: auto; min-width: 160px; }
.land-dd .dropdown-menu a.active,
.land-dd .dropdown-menu button.active {
  background: var(--c-primary-50);
  color: var(--c-secondary);
  font-weight: 700;
}
html[data-theme="dark"] .land-dd .land-dd-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .land-dd .dropdown-menu a.active,
html[data-theme="dark"] .land-dd .dropdown-menu button.active { color: #fbb800; }

/* Theme icon swap — show sun in light mode, moon in dark */
.theme-icon-dark { display: none; }
html[data-theme="dark"] .theme-icon-light { display: none; }
html[data-theme="dark"] .theme-icon-dark { display: inline; }

/* Mobile burger menu (landing) */
.land-burger { display: none; }
.land-burger button {
  background: transparent; border: 1px solid var(--c-border);
  border-radius: 8px; padding: 6px 8px;
  color: var(--c-text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.land-burger button:hover { background: var(--c-surface-alt); }

.land-mobile-drawer {
  display: none;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  padding: 12px 20px;
  flex-direction: column;
  gap: 8px;
}
.land-mobile-drawer.show { display: flex; }
.land-mobile-drawer a:not(.btn) {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--c-text);
  font-weight: 600;
  font-size: 14px;
}
.land-mobile-drawer a:not(.btn):hover { background: var(--c-surface-alt); text-decoration: none; }

@media (max-width: 768px) {
  .landing-nav .container { padding: 10px 16px; }
  .landing-nav ul { gap: 8px; }
  .land-menu, .land-cta { display: none; }
  .land-burger { display: inline-flex; }
  .land-dd .land-dd-btn { padding: 5px 8px; gap: 4px; }
  .land-dd .land-dd-btn strong { font-size: 10px; }
}
.landing-nav .container {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.landing-nav .brand {
  display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px;
}
.landing-nav .brand .logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.landing-nav ul { list-style: none; display: flex; gap: 22px; padding: 0; margin: 0; }
.landing-nav a { color: var(--c-text); font-size: 14px; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; position: relative; }
.section-alt { background: var(--c-surface); }
html[data-theme="dark"] .section-alt { background: rgba(255, 255, 255, 0.02); }

.section-title {
  font-size: 30px; font-weight: 800; text-align: center; margin: 0 0 10px;
  color: var(--c-text);
  letter-spacing: -0.5px;
}
.section-title::after {
  content: ''; display: block; margin: 14px auto 0;
  width: 56px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
}
.section-sub {
  text-align: center; color: var(--c-text-muted); margin: 0 auto 40px;
  max-width: 640px; font-size: 15px;
}

.hero {
  position: relative; padding: 100px 0 80px;
  background:
    radial-gradient(ellipse 800px 600px at 80% 0%, rgba(251,184,0,.22), transparent 70%),
    radial-gradient(ellipse 700px 500px at 10% 100%, rgba(158,44,46,.22), transparent 70%),
    var(--c-bg);
  text-align: center;
  border-bottom: 1px solid var(--c-border);
}
html[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse 800px 600px at 80% 0%, rgba(251,184,0,.18), transparent 70%),
    radial-gradient(ellipse 700px 500px at 10% 100%, rgba(158,44,46,.25), transparent 70%),
    radial-gradient(ellipse 1000px 400px at 50% 100%, rgba(31,60,136,.15), transparent 70%),
    var(--c-bg);
}
.hero h1 {
  font-size: 44px; font-weight: 900; margin: 0 0 12px; line-height: 1.1;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-secondary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p { color: var(--c-text); opacity: .85; font-size: 17px; max-width: 720px; margin: 0 auto 24px; }
html[data-theme="dark"] .hero p { color: #cbd5e1; opacity: 1; }
.hero .cta { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.countdown {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  margin: 32px 0;
}
.countdown-cell {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 18px 22px; min-width: 90px;
  box-shadow: var(--shadow-sm); text-align: center;
}
.countdown-cell strong {
  display: block; font-size: 36px; font-weight: 900;
  color: var(--c-secondary); line-height: 1;
}
html[data-theme="dark"] .countdown-cell strong {
  background: linear-gradient(135deg, var(--c-primary), #fde68a);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.countdown-cell span { font-size: 12px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 1px; }

.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.feature {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 24px;
}
.feature .icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--c-primary-50); color: var(--c-secondary);
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { color: var(--c-text-muted); font-size: 14px; margin: 0; }

.rundown-list { display: flex; flex-direction: column; gap: 12px; }
.rundown-item {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-primary);
  border-radius: var(--radius); padding: 16px 20px;
  transition: transform .15s, box-shadow .15s;
}
.rundown-item:hover { transform: translateX(4px); box-shadow: var(--shadow); }
html[data-theme="dark"] .rundown-item { background: rgba(255, 255, 255, 0.04); }
.rundown-item .time {
  font-weight: 800; color: var(--c-secondary); min-width: 80px;
}
html[data-theme="dark"] .rundown-item .time { color: var(--c-primary); }
.rundown-item h4 { margin: 0 0 4px; font-size: 15px; color: var(--c-text); }
.rundown-item p  { margin: 0; color: var(--c-text-muted); font-size: 13px; }

.gallery-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.gallery-grid .gthumb {
  position: relative; aspect-ratio: 1/1; overflow: hidden;
  border-radius: var(--radius-sm); cursor: pointer; background: var(--c-surface-alt);
}
.gallery-grid .gthumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .25s;
}
.gallery-grid .gthumb:hover img { transform: scale(1.05); }

.sponsor-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: center; justify-items: center;
}
.sponsor-grid img { max-height: 60px; max-width: 100%; filter: grayscale(100%); opacity: .7; transition: .2s; }
.sponsor-grid img:hover { filter: none; opacity: 1; }

.testimoni-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.testimoni-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 20px;
}
.testimoni-card .stars { color: var(--c-primary); margin-bottom: 8px; }
.testimoni-card p { font-style: italic; margin: 0 0 12px; color: var(--c-text); }
.testimoni-card .author { display: flex; gap: 10px; align-items: center; }
.testimoni-card .author img { width: 36px; height: 36px; border-radius: 50%; }

.landing-foot {
  background: linear-gradient(180deg, var(--c-secondary) 0%, #6b1d1f 100%);
  color: #fff;
  padding: 56px 0 28px; margin-top: 0;
  border-top: 4px solid var(--c-primary);
}
.landing-foot a { color: #fbb800; }
.landing-foot strong, .landing-foot p { color: #fff; }

/* ════════════════════════════════════════════════════════════════════
   STAT CARDS / DASHBOARD
   ════════════════════════════════════════════════════════════════════ */
.stat-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
}
.stat-card .icon-wrap {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-primary-50); color: var(--c-secondary); flex-shrink: 0;
}
html[data-theme="dark"] .stat-card .icon-wrap { color: #fbb800; }
.stat-card .stat-value { font-size: 22px; font-weight: 800; line-height: 1.2; }
.stat-card .stat-label { font-size: 12px; color: var(--c-text-muted); }

/* ════════════════════════════════════════════════════════════════════
   GALLERY (admin)
   ════════════════════════════════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--c-border-strong); border-radius: var(--radius);
  padding: 32px; text-align: center; background: var(--c-surface);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--c-primary); background: var(--c-primary-50);
}
.upload-zone .icon { font-size: 36px; margin-bottom: 8px; color: var(--c-text-muted); }

/* ════════════════════════════════════════════════════════════════════
   CHAT
   ════════════════════════════════════════════════════════════════════ */
.chat-wrap {
  display: flex; flex-direction: column; height: calc(100vh - 140px);
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
}
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 70%; padding: 8px 12px; border-radius: 12px; }
.chat-msg.from-me { align-self: flex-end; background: var(--c-primary); color: #1a1a1a; }
.chat-msg.from-other { background: var(--c-surface-alt); }
.chat-msg .meta { font-size: 11px; opacity: .7; margin-bottom: 2px; }
.chat-input {
  display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid var(--c-border);
}
.chat-input .form-control { flex: 1; }

/* ════════════════════════════════════════════════════════════════════
   QR Ticket
   ════════════════════════════════════════════════════════════════════ */
.qr-ticket {
  max-width: 400px; margin: 24px auto;
  background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
  border-radius: var(--radius-lg); padding: 24px;
  color: #fff; text-align: center; box-shadow: var(--shadow-lg);
}
.qr-ticket .qr-box {
  background: #fff; border-radius: var(--radius); padding: 14px;
  margin: 16px auto; display: inline-block;
}
.qr-ticket h3 { margin: 0 0 6px; }
.qr-ticket .ticket-info { font-size: 13px; opacity: .9; }

/* ════════════════════════════════════════════════════════════════════
   IMPERSONATION / ADMIN BANNER
   ════════════════════════════════════════════════════════════════════ */
.admin-banner {
  background: var(--c-warning); color: #1a1a1a;
  padding: 8px 16px; text-align: center; font-size: 13px; font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════
   UTIL
   ════════════════════════════════════════════════════════════════════ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--c-text-muted); }
.text-soft   { color: var(--c-text-soft); }
.text-success{ color: var(--c-success); }
.text-danger { color: var(--c-danger); }
.text-warning{ color: var(--c-warning); }
.text-primary{ color: var(--c-secondary); }
.fw-bold { font-weight: 700; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-16 { font-size: 16px; }
.fs-18 { font-size: 18px; }
.fs-22 { font-size: 22px; }
.mb-0 { margin-bottom: 0; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mr-2 { margin-right: 8px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.d-block { display: block; }
.d-none { display: none; }
@media (min-width: 768px) {
  .d-md-block { display: block; }
  .d-md-none { display: none; }
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--c-text-muted);
}
.empty-state svg { color: var(--c-text-soft); margin-bottom: 12px; }
.empty-state h3 { color: var(--c-text); margin: 0 0 4px; font-size: 16px; }
.empty-state p { font-size: 13px; margin: 0; }
