/* =========================================================
   YAHWEH CARGO LOGISTICS — Design System
   Palette: UPS-inspired logistics brown + amber gold
   ========================================================= */

:root {
  /* Surface scale (legacy --navy-* names kept for compatibility = cargo brown) */
  --navy-950: #120c09;
  --navy-900: #1a120e;
  --navy-800: #2a1c16;
  --navy-700: #3d281e;
  --navy-600: #5c3d2c;
  --slate-800: #2c221c;
  --slate-700: #4a3b32;
  --slate-600: #6b574a;
  --slate-400: #b5a498;
  --slate-300: #d4c8be;
  --slate-200: #e6ddd4;
  /* UPS-style amber gold */
  --gold-500: #ffb500;
  --gold-400: #ffc933;
  --gold-300: #ffd966;
  --gold-600: #d49200;
  --gold-glow: rgba(255, 181, 0, 0.28);
  --success: #2f9e6a;
  --success-bg: rgba(47, 158, 106, 0.14);
  --info: #c4a574;
  --info-bg: rgba(196, 165, 116, 0.16);
  --warning: #e8a317;
  --warning-bg: rgba(232, 163, 23, 0.14);
  --danger: #e07060;
  --danger-bg: rgba(224, 112, 96, 0.14);
  --orange: #e8924a;
  --orange-bg: rgba(232, 146, 74, 0.14);
  --purple: #b8956c;
  --purple-bg: rgba(184, 149, 108, 0.14);

  /* Dark — espresso / warehouse brown glass */
  --bg-primary: #16100c;
  --bg-secondary: #1e1510;
  --bg-card: rgba(42, 28, 22, 0.78);
  --bg-elevated: rgba(58, 40, 30, 0.82);
  --bg-input: rgba(22, 15, 11, 0.9);
  --bg-glass: rgba(255, 210, 140, 0.04);
  --text-primary: #f5efe8;
  --text-secondary: #c4b3a4;
  --text-muted: #8a7668;
  --border: rgba(210, 175, 130, 0.12);
  --border-strong: rgba(255, 181, 0, 0.34);
  --glass-blur: 18px;
  --sidebar-w: 280px;
  --sidebar-collapsed: 80px;
  --header-h: 72px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 10px 40px rgba(255, 181, 0, 0.16);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  /* Ink on gold buttons */
  --ink-on-gold: #1a120e;
}

/* Light mode — dimmed kraft / warm taupe (not bright white) */
[data-theme="light"] {
  --bg-primary: #cfc6bb;
  --bg-secondary: #d9d1c6;
  --bg-card: rgba(232, 224, 214, 0.88);
  --bg-elevated: rgba(236, 229, 220, 0.94);
  --bg-input: rgba(220, 212, 202, 0.95);
  --bg-glass: rgba(240, 234, 226, 0.55);
  --text-primary: #241812;
  --text-secondary: #4f3f34;
  --text-muted: #7a685a;
  --border: rgba(50, 32, 22, 0.12);
  --border-strong: rgba(50, 32, 22, 0.2);
  --shadow: 0 8px 28px rgba(40, 24, 14, 0.12);
  --shadow-gold: 0 10px 32px rgba(180, 120, 0, 0.14);
  --navy-800: #c4b8aa;
  --navy-700: #b0a294;
  --navy-600: #8a7668;
  --gold-500: #c48a00;
  --gold-400: #d49200;
  --gold-300: #e6a800;
  --gold-600: #a67400;
  --ink-on-gold: #1a120e;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- Typography ---- */
.font-display { font-family: var(--font-display); }
.text-gold { color: var(--gold-500); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--navy-600); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-600); }

/* ---- Layout Shell ---- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  border-right: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), width var(--transition);
  overflow: hidden;
}

[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #1a120e 0%, #120c09 100%);
  border-right-color: rgba(255, 181, 0, 0.15);
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 181, 0, 0.12);
  min-height: var(--header-h);
}

.sidebar-brand .logo-icon {
  width: 42px; height: 42px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px var(--gold-glow));
}

.sidebar-brand .brand-text { overflow: hidden; white-space: nowrap; }
.sidebar-brand .brand-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.sidebar-brand .brand-tag {
  font-size: 0.65rem;
  color: var(--gold-500);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .sidebar-footer-text { opacity: 0; width: 0; overflow: hidden; }

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

.nav-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 181, 0, 0.5);
  padding: 12px 12px 8px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 4px;
  border: 1px solid transparent;
  position: relative;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item i {
  width: 22px;
  text-align: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  color: rgba(255, 181, 0, 0.55);
  transition: color var(--transition);
}

.nav-item:hover {
  background: rgba(255, 181, 0, 0.08);
  color: #fff;
  border-color: rgba(255, 181, 0, 0.12);
}
.nav-item:hover i { color: var(--gold-400); }

.nav-item.active {
  background: linear-gradient(135deg, rgba(255, 181, 0, 0.18), rgba(255, 181, 0, 0.06));
  color: #fff;
  border-color: rgba(255, 181, 0, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 181, 0, 0.08);
}
.nav-item.active i { color: var(--gold-400); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--gold-500);
  border-radius: 0 3px 3px 0;
}

.nav-label { white-space: nowrap; transition: opacity var(--transition); }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 181, 0, 0.12);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}

.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

/* ---- Top Header ---- */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(22, 16, 12, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
}

[data-theme="light"] .top-header {
  background: rgba(220, 212, 202, 0.92);
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 10px; }

.page-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: var(--ink-on-gold);
  box-shadow: 0 4px 16px var(--gold-glow);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  box-shadow: 0 6px 24px rgba(255, 181, 0, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--gold-500);
  color: var(--gold-400);
  background: rgba(255, 181, 0, 0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 8px 12px;
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 181, 0, 0.08);
  color: var(--gold-400);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
}

.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
}
.btn-success:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.2);
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
}
.btn-icon.btn-sm { width: 32px; height: 32px; }

/* ---- Icon toggle buttons (theme / lang) ---- */
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1rem;
  position: relative;
}
.icon-btn:hover {
  border-color: var(--gold-500);
  color: var(--gold-400);
  background: rgba(255, 181, 0, 0.08);
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-strong); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ---- Stat Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  cursor: default;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}
.stat-card:hover::before { opacity: 1; }

.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 14px;
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-icon.gold { background: rgba(255,181,0,0.15); color: var(--gold-400); }
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-icon.orange { background: var(--orange-bg); color: var(--orange); }
.stat-icon.purple { background: var(--purple-bg); color: var(--purple); }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-label .req { color: var(--danger); margin-left: 2px; }

.form-control, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
  appearance: none;
}
.form-control:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-control::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 90px; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%94a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-select option { background: var(--navy-900); color: #fff; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-section {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.form-section:last-child { border-bottom: none; margin-bottom: 0; }
.form-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-500);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- Tables ---- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead {
  background: var(--bg-elevated);
}
.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.data-table th:hover { color: var(--gold-400); }
.data-table th .sort-icon { margin-left: 4px; opacity: 0.4; font-size: 0.7rem; }
.data-table th.sorted .sort-icon { opacity: 1; color: var(--gold-500); }

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background var(--transition);
}
.data-table tbody tr:hover {
  background: rgba(255, 181, 0, 0.04);
}
.data-table tbody tr:last-child td { border-bottom: none; }

.tracking-id-cell {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--gold-400) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---- Status Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-booking { background: var(--purple-bg); color: var(--purple); border-color: rgba(168,85,247,0.25); }
.badge-picked { background: rgba(99,102,241,0.12); color: #818cf8; border-color: rgba(99,102,241,0.25); }
.badge-transit { background: var(--info-bg); color: var(--info); border-color: rgba(196,165,116,0.28); }
.badge-arrived { background: var(--warning-bg); color: var(--warning); border-color: rgba(245,158,11,0.25); }
.badge-customs { background: var(--danger-bg); color: var(--danger); border-color: rgba(239,68,68,0.25); }
.badge-enroute { background: var(--orange-bg); color: var(--orange); border-color: rgba(232,146,74,0.3); }
.badge-insurance { background: rgba(56,189,248,0.14); color: #38bdf8; border-color: rgba(56,189,248,0.32); }
.badge-clearance { background: rgba(244,114,182,0.14); color: #f472b6; border-color: rgba(244,114,182,0.32); }
.badge-out { background: var(--orange-bg); color: var(--orange); border-color: rgba(249,115,22,0.25); }
.badge-delivered { background: var(--success-bg); color: var(--success); border-color: rgba(16,185,129,0.25); }
.badge-exception { background: var(--danger-bg); color: var(--danger); border-color: rgba(239,68,68,0.25); }
.badge-paid { background: var(--success-bg); color: var(--success); border-color: rgba(16,185,129,0.25); }

/* ---- Page Content ---- */
.page-content {
  padding: 28px;
  flex: 1;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.35s ease; }

/* ---- Search Bar ---- */
.search-box {
  position: relative;
  max-width: 360px;
  flex: 1;
}
.search-box i {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.search-box input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
}
.search-box input:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  transform: scale(0.92) translateY(16px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 960px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 2;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--bg-card);
}

/* ---- Toast ---- */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 300px;
  max-width: 420px;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-left: 3px solid var(--gold-500);
}
.toast.removing { animation: toastOut 0.3s ease forwards; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
.toast.warning { border-left-color: var(--warning); }

.toast-icon { font-size: 1.1rem; margin-top: 1px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--info); }
.toast.warning .toast-icon { color: var(--warning); }

.toast-body { flex: 1; }
.toast-title { font-weight: 700; font-size: 0.875rem; margin-bottom: 2px; }
.toast-msg { font-size: 0.8rem; color: var(--text-secondary); }
.toast-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.9rem; padding: 2px;
}
.toast-close:hover { color: var(--text-primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(40px) scale(0.9); }
}

/* ---- Timeline ---- */
.timeline {
  position: relative;
  padding-left: 32px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 11px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-500), var(--navy-600));
}
.timeline-item {
  position: relative;
  padding-bottom: 28px;
  animation: fadeIn 0.4s ease both;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:nth-child(1) { animation-delay: 0.05s; }
.timeline-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-item:nth-child(3) { animation-delay: 0.15s; }
.timeline-item:nth-child(4) { animation-delay: 0.2s; }
.timeline-item:nth-child(5) { animation-delay: 0.25s; }
.timeline-item:nth-child(6) { animation-delay: 0.3s; }
.timeline-item:nth-child(7) { animation-delay: 0.35s; }

.timeline-dot {
  position: absolute;
  left: -32px; top: 4px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--gold-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--gold-500);
  z-index: 1;
}
.timeline-item.current .timeline-dot {
  background: var(--gold-500);
  color: var(--ink-on-gold);
  box-shadow: 0 0 0 4px var(--gold-glow), 0 0 16px var(--gold-glow);
  animation: pulse-gold 2s infinite;
}
.timeline-item.done .timeline-dot {
  background: var(--gold-500);
  color: var(--ink-on-gold);
  border-color: var(--gold-500);
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 4px var(--gold-glow), 0 0 16px var(--gold-glow); }
  50% { box-shadow: 0 0 0 8px transparent, 0 0 24px var(--gold-glow); }
}

.timeline-status {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.timeline-item.current .timeline-status { color: var(--gold-400); }
.timeline-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.timeline-meta i { margin-right: 4px; color: var(--gold-600); }

.timeline-comment {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border-left: 3px solid var(--gold-500);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.timeline-comment i {
  color: var(--gold-500);
  margin-right: 6px;
}

/* ---- Customs Banner ---- */
.customs-banner {
  background: linear-gradient(135deg, rgba(255,181,0,0.18), rgba(255,181,0,0.06));
  border: 1px solid rgba(255,181,0,0.4);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.5s ease;
}
.customs-banner::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--gold-glow), transparent 70%);
  pointer-events: none;
}
.customs-banner-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: rgba(255,181,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--gold-400);
  margin-bottom: 14px;
  animation: pulse-gold 2.5s infinite;
}
.customs-banner h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold-400);
  margin-bottom: 8px;
}
.customs-banner p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 18px;
  max-width: 560px;
}

/* ---- Track Hero ---- */
.track-hero {
  text-align: center;
  padding: 48px 24px 40px;
  position: relative;
}
.track-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse, var(--gold-glow), transparent 70%);
  pointer-events: none;
  opacity: 0.5;
}
.track-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 10px;
  position: relative;
}
.track-hero h1 span { color: var(--gold-500); }
.track-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 32px;
  position: relative;
}

.track-search-wrap {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-gold);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.track-search-wrap:focus-within {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 4px var(--gold-glow), var(--shadow-gold);
}
.track-search-wrap input {
  flex: 1;
  padding: 18px 20px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  letter-spacing: 0.04em;
}
.track-search-wrap input::placeholder {
  font-family: var(--font);
  letter-spacing: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.track-search-wrap .btn {
  border-radius: 0;
  padding: 18px 28px;
  font-size: 1rem;
}

/* ---- Status Icon Large ---- */
.status-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 20px;
  margin-bottom: 24px;
}
.status-hero-icon {
  width: 88px; height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 16px;
  border: 3px solid;
  animation: pulse-gold 2.5s infinite;
}
.status-hero-label {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.status-hero-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---- Fee Table ---- */
.fee-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.fee-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.fee-table td:last-child {
  text-align: right;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.fee-table tr.total td {
  border-bottom: none;
  border-top: 2px solid var(--gold-500);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-400);
  padding-top: 16px;
}

/* ---- Rating Stars ---- */
.rating-widget {
  text-align: center;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 24px;
}
.rating-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}
.rating-stars .star {
  font-size: 2rem;
  color: var(--navy-600);
  cursor: pointer;
  transition: all 0.2s ease;
  background: none;
  border: none;
  padding: 4px;
}
.rating-stars .star:hover,
.rating-stars .star.active {
  color: var(--gold-500);
  transform: scale(1.15);
  filter: drop-shadow(0 0 8px var(--gold-glow));
}
.rating-stars .star.selected { color: var(--gold-500); }

/* ---- Agent Card ---- */
.agent-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 12px 0;
}
.agent-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink-on-gold);
  flex-shrink: 0;
}
.agent-info h4 { font-size: 0.95rem; margin-bottom: 2px; }
.agent-info a {
  color: var(--gold-400);
  text-decoration: none;
  font-size: 0.8rem;
}
.agent-info a:hover { text-decoration: underline; }
.agent-info .agent-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 3rem;
  color: var(--navy-600);
  margin-bottom: 16px;
  display: block;
}
.empty-state h3 {
  font-family: var(--font-display);
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  background: var(--bg-primary);
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -20%; left: -10%;
  width: 50%; height: 60%;
  background: radial-gradient(ellipse, rgba(255,181,0,0.08), transparent 70%);
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  bottom: -20%; right: -10%;
  width: 50%; height: 60%;
  background: radial-gradient(ellipse, rgba(180,120,60,0.1), transparent 70%);
  pointer-events: none;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: var(--shadow), var(--shadow-gold);
  position: relative;
  z-index: 1;
  animation: fadeIn 0.5s ease;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo svg {
  width: 64px; height: 64px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px var(--gold-glow));
}
.login-logo h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 4px;
}
[data-theme="light"] .login-logo h1 { color: var(--text-primary); }
.login-logo p {
  font-size: 0.75rem;
  color: var(--gold-500);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ---- Public Header (customer pages) ---- */
.public-header {
  background: rgba(22, 16, 12, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
[data-theme="light"] .public-header {
  background: rgba(220,212,202,0.92);
}
.public-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.public-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.public-brand svg { width: 40px; height: 40px; }
.public-brand .name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.public-brand .tag {
  font-size: 0.6rem;
  color: var(--gold-500);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.public-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.public-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.public-nav a:hover, .public-nav a.active {
  color: var(--gold-400);
  background: rgba(255,181,0,0.08);
}

.public-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 60px;
  min-height: calc(100vh - 72px - 80px);
}

.public-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.public-footer .gold { color: var(--gold-500); }

/* ---- QR Code ---- */
.qr-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-radius: var(--radius-sm);
}
.qr-wrap canvas, .qr-wrap img { display: block; }
.qr-label {
  font-size: 0.65rem;
  color: #8a7668;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---- Actions toolbar ---- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ---- Route arrow ---- */
.route-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}
.route-arrow i { color: var(--gold-500); font-size: 0.7rem; }

/* ---- Lang dropdown ---- */
.lang-dropdown {
  position: relative;
}
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  min-width: 140px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 60;
  overflow: hidden;
}
.lang-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.lang-menu button:hover {
  background: rgba(255,181,0,0.08);
  color: var(--gold-400);
}
.lang-menu button.active {
  color: var(--gold-400);
  background: rgba(255,181,0,0.1);
}

/* ---- Mobile Sidebar Overlay ---- */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

.hamburger {
  display: none;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.1rem;
}

/* ---- Success animation ---- */
.success-check {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--success-bg);
  border: 3px solid var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--success);
  margin: 0 auto 20px;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes scaleIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---- Info grid ---- */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.info-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.info-block h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-500);
  margin-bottom: 10px;
  font-weight: 700;
}
.info-block p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.5;
}
.info-block p strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ---- Receipt / Print ---- */
.receipt-preview {
  background: #fff;
  color: #1a120e;
  border-radius: var(--radius);
  padding: 32px;
  font-size: 0.875rem;
}
.receipt-preview * { color: inherit; }
.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #ffb500;
  padding-bottom: 20px;
  margin-bottom: 24px;
}
.receipt-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ink-on-gold) !important;
}
.receipt-header .gold-text { color: #ffb500 !important; }
.barcode-placeholder {
  height: 48px;
  background: repeating-linear-gradient(
    90deg,
    #1a120e 0px, #1a120e 2px,
    transparent 2px, transparent 4px,
    #1a120e 4px, #1a120e 5px,
    transparent 5px, transparent 8px,
    #1a120e 8px, #1a120e 11px,
    transparent 11px, transparent 13px
  );
  border-radius: 4px;
  margin: 16px 0 8px;
  max-width: 280px;
}
.receipt-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: #475569 !important;
}

/* ---- Quick actions ---- */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar.collapsed {
    width: var(--sidebar-w);
  }
  .sidebar.collapsed .brand-text,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-section-title,
  .sidebar.collapsed .sidebar-footer-text {
    opacity: 1; width: auto;
  }
  .main-content,
  .sidebar.collapsed ~ .main-content {
    margin-left: 0;
  }
  .hamburger { display: inline-flex; }
  .form-row, .form-row-3, .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-content { padding: 16px; }
  .top-header { padding: 0 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .track-search-wrap { flex-direction: column; }
  .track-search-wrap .btn { border-radius: 0 0 12px 12px; }
  .public-nav a span { display: none; }
  .modal { max-height: 95vh; }
  .login-card { padding: 28px 22px; }
  #toast-container { left: 12px; right: 12px; top: 12px; }
  .toast { min-width: 0; max-width: none; }
}

/* ---- Utility ---- */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.truncate {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ---- Skeleton loading ---- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--navy-600) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =========================================================
   LOCKED BRAND BACKGROUNDS
   CSS backgrounds (not <img>) + shield layer to deter save/drag.
   Note: true DRM is impossible in browsers; this is a UX lock.
   ========================================================= */
.page-bg-lock {
  position: relative;
  isolation: isolate;
}
.page-bg-lock > .bg-locked-layer,
.bg-locked-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.bg-locked-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--bg-locked-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: var(--bg-locked-opacity, 0.18);
  filter: saturate(0.85) brightness(0.9);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.bg-locked-layer::after {
  /* Espresso wash so text stays readable + blocks direct interaction */
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(22, 16, 12, 0.78) 0%, rgba(22, 16, 12, 0.58) 45%, rgba(22, 16, 12, 0.85) 100%),
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(255, 181, 0, 0.08), transparent 60%);
  pointer-events: none;
}
[data-theme="light"] .bg-locked-layer::after {
  background:
    linear-gradient(180deg, rgba(207, 198, 187, 0.88) 0%, rgba(207, 198, 187, 0.78) 45%, rgba(207, 198, 187, 0.92) 100%),
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(196, 138, 0, 0.12), transparent 60%);
}
.bg-locked-layer.bg-fixed::before {
  background-attachment: fixed;
}
/* Full-page fixed backdrop (About / Contact / Track) */
.page-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.page-backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--bg-locked-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  opacity: var(--bg-locked-opacity, 0.16);
  filter: saturate(0.8) brightness(0.85);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.page-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(22, 16, 12, 0.78) 0%, rgba(22, 16, 12, 0.62) 40%, rgba(22, 16, 12, 0.88) 100%);
  pointer-events: none;
}
[data-theme="light"] .page-backdrop::after {
  background:
    linear-gradient(180deg, rgba(207, 198, 187, 0.9) 0%, rgba(207, 198, 187, 0.8) 50%, rgba(207, 198, 187, 0.93) 100%),
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(196, 138, 0, 0.1), transparent 55%);
}
/* Raise chrome + content above backdrop */
body.has-page-backdrop .public-header,
body.has-page-backdrop .public-main,
body.has-page-backdrop .public-footer,
body.has-page-backdrop .page-hero,
body.has-page-backdrop .content-wrap,
body.has-page-backdrop #toast-container {
  position: relative;
  z-index: 1;
}
body.has-page-backdrop {
  background: transparent;
}
/* Transparent shield over decorative zones — blocks right-click target */
.bg-protect-shield {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  cursor: default;
}
/* Content above shield within a locked section */
.page-bg-lock > .hero-inner,
.page-bg-lock > .section-inner,
.page-bg-lock > .feature-grid-inner,
.page-bg-lock > *:not(.bg-locked-layer):not(.bg-protect-shield):not(.hero-bg):not(.hero-grid) {
  position: relative;
  z-index: 2;
}
@media (max-width: 900px) {
  .bg-locked-layer.bg-fixed::before,
  .page-backdrop::before {
    background-attachment: scroll; /* iOS fixed bg quirks */
  }
}
@media print {
  .page-backdrop,
  .bg-locked-layer,
  .bg-protect-shield { display: none !important; }
}

/* ---- Print Styles ---- */
@media print {
  body * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }
  .print-area {
    position: absolute !important;
    left: 0; top: 0;
    width: 100% !important;
    background: #fff !important;
    color: #1a120e !important;
    padding: 20px !important;
  }
  .no-print, .sidebar, .top-header, .sidebar-overlay,
  #toast-container, .modal-overlay, .hamburger,
  .btn, .icon-btn, .public-header, .public-footer { display: none !important; }
  .print-area .badge { border: 1px solid #ccc !important; color: #333 !important; background: #f5f5f5 !important; }
  .print-area .timeline::before { background: #ffb500 !important; }
  .print-area .timeline-dot { border-color: #ffb500 !important; }
}


/* =========================================================
   GLASS UI · BANK CARDS · MOBILE NAV · FOOTER (2026 redesign)
   ========================================================= */

body {
  background-image:
    radial-gradient(ellipse 90% 60% at 10% -10%, rgba(255, 181, 0, 0.07), transparent 50%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(180, 120, 60, 0.1), transparent 45%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(90, 55, 30, 0.18), transparent 50%);
  background-attachment: fixed;
}

[data-theme="light"] body {
  background-image:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(180, 150, 100, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(200, 160, 80, 0.22), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(160, 130, 100, 0.2), transparent 55%);
}

.card, .stat-card, .feature-card, .hero-card, .login-card, .modal,
.agent-card, .rating-widget, .info-block, .glass-card, .glass-panel {
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.card, .stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card:hover, .stat-card:hover {
  border-color: var(--border-strong);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: var(--ink-on-gold);
  border: none;
  box-shadow: 0 4px 16px rgba(255, 181, 0, 0.3);
  font-weight: 600;
}
.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 22px rgba(255, 181, 0, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
}

.form-control, .form-select, .form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px var(--gold-glow);
  outline: none;
}

/* Badge processing */
.badge-processing {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(196, 165, 116, 0.35);
}

/* Pay chips */
.pay-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}
.pay-chip.processing {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(196, 165, 116, 0.35);
}
.pay-chip.paid {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.pay-chip.unpaid {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pay-status-block {
  text-align: center;
  padding: 24px 16px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  background: var(--info-bg);
  border: 1px solid rgba(196, 165, 116, 0.25);
}
.pay-status-block .pay-status-icon {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(196, 165, 116, 0.15);
  color: var(--info);
  font-size: 1.4rem;
}
.pay-status-block h3 {
  font-family: var(--font-display);
  color: var(--info);
  margin-bottom: 8px;
}

/* Bank card */
.bank-card {
  text-align: left;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  margin: 0 auto;
  max-width: 520px;
}
.bank-card-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.bank-card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255, 181, 0, 0.15);
  color: var(--gold-400);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.bank-card-header h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.bank-rows { display: flex; flex-direction: column; gap: 8px; }
.bank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border);
}
.bank-row-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.bank-row-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.bank-row-label i { margin-right: 4px; color: var(--gold-500); }
.bank-row-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}
.btn-copy {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--gold-400);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.btn-copy:hover {
  background: rgba(255, 181, 0, 0.15);
  border-color: var(--gold-500);
  transform: scale(1.05);
}
.bank-note {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 181, 0, 0.08);
  border-left: 3px solid var(--gold-500);
}
.bank-note i { color: var(--gold-500); margin-right: 6px; }

/* Public header glass */
.public-header {
  background: rgba(22, 16, 12, 0.82) !important;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .public-header {
  background: rgba(220, 212, 202, 0.88) !important;
  box-shadow: 0 1px 0 rgba(40, 24, 14, 0.06);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.1rem;
}

/* Footer rich layout */
.public-footer {
  border-top: 1px solid var(--border);
  padding: 36px 24px 28px;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
  text-align: left;
}
[data-theme="light"] .public-footer {
  background: rgba(210, 202, 192, 0.55);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.footer-tag { color: var(--text-muted); font-family: var(--font); font-size: 0.85rem; }
.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.footer-contact a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-contact a:hover { color: var(--gold-400); }
.footer-contact i {
  color: var(--gold-500);
  margin-right: 6px;
  width: 14px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}
.footer-links a:hover { color: var(--gold-400); }
.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Mobile responsive */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .hero { min-height: auto !important; padding: 40px 16px !important; }
  .public-header-inner { padding: 0 16px; }
  .nav-toggle { display: inline-flex; }
  .public-nav {
    position: absolute;
    top: 72px;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 20px;
    background: rgba(22, 16, 12, 0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: none;
    z-index: 60;
    gap: 4px;
  }
  [data-theme="light"] .public-nav {
    background: rgba(220, 212, 202, 0.98);
  }
  .public-nav.open { display: flex; }
  .public-nav a {
    padding: 12px 14px;
    border-radius: 10px;
  }
  .public-header-inner { position: relative; }
  .public-main { padding: 0 16px 48px; }
  .info-grid {
    grid-template-columns: 1fr !important;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .form-row, .form-row-3 {
    grid-template-columns: 1fr !important;
  }
  .modal { margin: 12px; max-width: calc(100vw - 24px); }
  .modal-lg { width: calc(100vw - 24px); }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 720px; }
  .feature-grid { padding: 48px 16px !important; gap: 14px !important; }
  .cta-band { margin: 24px 16px 48px !important; padding: 32px 20px !important; }
  .hero-stats { gap: 20px; }
  .footer-contact { flex-direction: column; gap: 10px; }
  .bank-card { max-width: 100%; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; }
  .hero h1 { font-size: 1.9rem !important; }
  .btn-lg { width: 100%; justify-content: center; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .status-hero-label { font-size: 1.3rem !important; }
}

/* Mono utility */
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* Smooth glass on status hero */
.status-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-lg);
}


/* Customer status PDF host (off-screen until print) */
#customer-status-report.print-area,
.print-area#customer-status-report {
  position: static !important;
  left: auto !important;
  width: 100% !important;
  z-index: auto !important;
  padding: 24px !important;
  background: #fff !important;
  color: #1a120e !important;
}


/* ---- Brand logo upload (admin settings) ---- */
.logo-upload-group { margin-top: 8px; }
.logo-upload-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.logo-preview-box {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  border: 1px solid rgba(255, 181, 0, 0.28);
  background: linear-gradient(145deg, rgba(26,18,14,0.55), rgba(61,40,30,0.35));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.18);
  flex-shrink: 0;
}
.logo-preview-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 10px;
}
.logo-preview-inner .logo-icon,
.logo-preview-inner svg {
  width: 56px;
  height: 56px;
}
.logo-preview-img {
  max-width: 68px;
  max-height: 68px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}
.logo-upload-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 200px;
}
.logo-upload-actions .btn { min-width: 160px; justify-content: center; }

/* Custom uploaded logo in chrome */
.logo-img,
img.logo-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
}
.sidebar-brand .logo-img,
.sidebar-brand img.logo-icon {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 8px var(--gold-glow));
}
.public-brand .logo-img,
.public-brand img.logo-icon {
  width: 40px;
  height: 40px;
}
.public-brand svg,
.public-brand .logo-icon { width: 40px; height: 40px; }
[data-logo] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
