/* ============================================================
   Bacchus Loyalty — Custom Stylesheet
   Dark Luxury Theme with Gold Accents
   ============================================================ */

:root {
  --bg-base:       #070B14;
  --bg-surface:    #0D1421;
  --bg-card:       #111827;
  --bg-hover:      #1a2540;
  --border:        rgba(255,255,255,0.07);
  --border-gold:   rgba(201,168,76,0.35);
  --gold:          #C9A84C;
  --gold-light:    #E8C97E;
  --gold-dark:     #9A7A2A;
  --text-primary:  #F1F5F9;
  --text-muted:    #94A3B8;
  --text-faint:    #475569;
  --sidebar-w:     260px;
  --header-h:      64px;
  --radius:        12px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-gold:   0 4px 20px rgba(201,168,76,0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--border-gold); border-radius: 4px; }

/* ── Layout ─────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s ease;
  overflow-y: auto;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.page-body { padding: 28px 28px; flex: 1; }

/* ── Sidebar Logo ────────────────────────────────────── */
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-gold);
  flex-shrink: 0;
}

.sidebar-logo .logo-text { line-height: 1.2; }
.sidebar-logo .logo-title { font-size: 15px; font-weight: 700; color: var(--gold-light); }
.sidebar-logo .logo-sub { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; }

/* ── Sidebar Nav ─────────────────────────────────────── */
.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-group { margin-bottom: 4px; }

.nav-group-label {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 0;
  transition: all .2s ease;
  cursor: pointer;
  position: relative;
  font-size: 13.5px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(201,168,76,0.12), transparent);
  color: var(--gold-light);
  border-left: 3px solid var(--gold);
}

.nav-item .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .7;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  line-height: 16px;
}

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 22px; }

/* ── Stat Cards ──────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.5); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: .08;
  transform: translate(20px, -20px);
}

.stat-card.gold::before   { background: var(--gold); }
.stat-card.blue::before   { background: #3B82F6; }
.stat-card.green::before  { background: #10B981; }
.stat-card.purple::before { background: #8B5CF6; }
.stat-card.red::before    { background: #EF4444; }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-icon.gold   { background: rgba(201,168,76,0.15); color: var(--gold); }
.stat-icon.blue   { background: rgba(59,130,246,0.15); color: #60A5FA; }
.stat-icon.green  { background: rgba(16,185,129,0.15); color: #34D399; }
.stat-icon.purple { background: rgba(139,92,246,0.15); color: #A78BFA; }
.stat-icon.red    { background: rgba(239,68,68,0.15);  color: #F87171; }
.stat-icon.cyan   { background: rgba(6,182,212,0.15);  color: #22D3EE; }

.stat-value { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stat-change { font-size: 11px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-change.up   { color: #34D399; }
.stat-change.down { color: #F87171; }

/* ── Tables ──────────────────────────────────────────── */
.table-container { overflow-x: auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data-table th {
  background: rgba(255,255,255,0.03);
  color: var(--text-faint);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

table.data-table tr:last-child td { border-bottom: none; }

table.data-table tbody tr:hover { background: rgba(255,255,255,0.025); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .2s ease;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #1a1000;
  font-weight: 600;
}
.btn-gold:hover { background: linear-gradient(135deg, var(--gold-light), var(--gold)); box-shadow: var(--shadow-gold); }

.btn-primary { background: #2563EB; color: #fff; }
.btn-primary:hover { background: #1D4ED8; }

.btn-success { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; }

.btn-danger { background: #DC2626; color: #fff; }
.btn-danger:hover { background: #B91C1C; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,0.06); }

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }
.btn-icon { padding: 7px; border-radius: 8px; }

/* ── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13.5px;
  transition: border-color .2s ease, box-shadow .2s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
  background: rgba(255,255,255,0.06);
}

.form-control::placeholder { color: var(--text-faint); }

textarea.form-control { resize: vertical; min-height: 90px; }

select.form-control option { background: var(--bg-card); color: var(--text-primary); }

.form-control.error { border-color: #EF4444; }

.input-group { display: flex; }
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-group .input-addon {
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}

.badge-gold    { background: rgba(201,168,76,0.15);  color: var(--gold-light); border: 1px solid rgba(201,168,76,0.3); }
.badge-success { background: rgba(16,185,129,0.15);  color: #34D399; border: 1px solid rgba(16,185,129,0.3); }
.badge-danger  { background: rgba(239,68,68,0.15);   color: #F87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-warning { background: rgba(245,158,11,0.15);  color: #FBBF24; border: 1px solid rgba(245,158,11,0.3); }
.badge-info    { background: rgba(59,130,246,0.15);  color: #60A5FA; border: 1px solid rgba(59,130,246,0.3); }
.badge-muted   { background: rgba(148,163,184,0.1);  color: #94A3B8; border: 1px solid rgba(148,163,184,0.2); }
.badge-purple  { background: rgba(139,92,246,0.15);  color: #A78BFA; border: 1px solid rgba(139,92,246,0.3); }

/* ── Alerts ──────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.alert-success { background: rgba(16,185,129,0.1);  border: 1px solid rgba(16,185,129,0.2);  color: #34D399; }
.alert-error   { background: rgba(239,68,68,0.1);   border: 1px solid rgba(239,68,68,0.2);   color: #F87171; }
.alert-warning { background: rgba(245,158,11,0.1);  border: 1px solid rgba(245,158,11,0.2);  color: #FBBF24; }
.alert-info    { background: rgba(59,130,246,0.1);  border: 1px solid rgba(59,130,246,0.2);  color: #60A5FA; }

/* ── Page Header ─────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header-left { display: flex; flex-direction: column; gap: 4px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.page-breadcrumb { font-size: 12px; color: var(--text-faint); display: flex; align-items: center; gap: 6px; }
.page-breadcrumb a { color: var(--gold); text-decoration: none; }
.page-breadcrumb span { opacity: .5; }

/* ── Tabs ────────────────────────────────────────────── */
.tab-list {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab-item {
  padding: 10px 20px;
  font-size: 13.5px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .2s;
  text-decoration: none;
}

.tab-item:hover { color: var(--text-primary); }
.tab-item.active { color: var(--gold-light); border-bottom-color: var(--gold); }

/* ── Pagination ──────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 0 0;
}

.page-link {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all .2s;
}

.page-link:hover { border-color: var(--gold); color: var(--gold); }
.page-link.active { background: var(--gold); color: #1a1000; border-color: var(--gold); font-weight: 600; }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ── Modal ───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
}

.modal-backdrop.show { display: flex; align-items: center; justify-content: center; padding: 20px; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: modal-in .25s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; padding: 4px; transition: color .2s; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Dropdown ────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 180px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5);
  z-index: 150;
  overflow: hidden;
  display: none;
}

.dropdown-menu.show { display: block; animation: fade-in .15s ease; }

@keyframes fade-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  transition: all .15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.08); color: #F87171; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Progress Bar ────────────────────────────────────── */
.progress { background: rgba(255,255,255,0.06); border-radius: 20px; height: 6px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 20px; transition: width .4s ease; }
.progress-bar.gold   { background: linear-gradient(90deg, var(--gold-dark), var(--gold)); }
.progress-bar.blue   { background: linear-gradient(90deg, #1D4ED8, #60A5FA); }
.progress-bar.green  { background: linear-gradient(90deg, #047857, #34D399); }
.progress-bar.purple { background: linear-gradient(90deg, #5B21B6, #A78BFA); }

/* ── Avatar ──────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 52px; height: 52px; }
.avatar-xl { width: 80px; height: 80px; }

.avatar-placeholder {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--bg-card));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--gold-light);
  font-size: 14px;
  flex-shrink: 0;
  border: 2px solid var(--border-gold);
}

/* ── Toast Notifications ─────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: toast-in .25s ease;
}

@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.toast.success { border-left: 3px solid #34D399; }
.toast.error   { border-left: 3px solid #F87171; }
.toast.warning { border-left: 3px solid #FBBF24; }
.toast.info    { border-left: 3px solid #60A5FA; }

/* ── Charts ──────────────────────────────────────────── */
.chart-container { position: relative; }

/* ── Utility ─────────────────────────────────────────── */
.text-gold     { color: var(--gold-light); }
.text-muted    { color: var(--text-muted); }
.text-faint    { color: var(--text-faint); }
.text-success  { color: #34D399; }
.text-danger   { color: #F87171; }
.text-warning  { color: #FBBF24; }
.text-info     { color: #60A5FA; }

.border-gold { border-color: var(--border-gold) !important; }

.bg-gold-soft    { background: rgba(201,168,76,0.1); }
.bg-success-soft { background: rgba(16,185,129,0.1); }
.bg-danger-soft  { background: rgba(239,68,68,0.1); }

.divider { height: 1px; background: var(--border); margin: 16px 0; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px)  { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ── Responsive Sidebar ──────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* ── Search ──────────────────────────────────────────── */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-faint);
  pointer-events: none;
}

.search-box input {
  padding-left: 38px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13.5px;
  padding: 8px 14px 8px 38px;
  outline: none;
  transition: border-color .2s;
  width: 260px;
}

.search-box input:focus { border-color: var(--gold); }
.search-box input::placeholder { color: var(--text-faint); }

/* ── Member Card ─────────────────────────────────────── */
.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.member-card:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,0.5); }

/* ── Tier Badge ──────────────────────────────────────── */
.tier-bronze   { --tier-c: #CD7F32; }
.tier-silver   { --tier-c: #C0C0C0; }
.tier-gold     { --tier-c: #FFD700; }
.tier-platinum { --tier-c: #E5E4E2; }
.tier-diamond  { --tier-c: #B9F2FF; }

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
  border: 1px solid currentColor;
  color: var(--tier-c, var(--gold-light));
}

/* ── Action Buttons ──────────────────────────────────── */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.action-btn.view   { background: rgba(59,130,246,0.12);  color: #60A5FA; }
.action-btn.edit   { background: rgba(245,158,11,0.12);  color: #FBBF24; }
.action-btn.delete { background: rgba(239,68,68,0.12);   color: #F87171; }
.action-btn:hover  { filter: brightness(1.3); transform: scale(1.05); }

/* ── Empty State ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .5; }
.empty-state h3 { font-size: 16px; color: var(--text-muted); margin-bottom: 8px; }
.empty-state p  { font-size: 13px; }

/* ── Skeleton ────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes skeleton-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Sidebar Footer ──────────────────────────────────── */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.sidebar-user-role  { font-size: 11px; color: var(--text-faint); }

/* ============================================================
   LIGHT THEME — Serodja Palette
   Soft cream base, mustard gold, and dark brown
   ============================================================ */
[data-theme="light"] {
  /* Background System */
  --bg-base:       #f6f1ea;
  --bg-surface:    #fffdfa;
  --bg-card:       #ffffff;
  --bg-hover:      #eee6d8;

  /* Borders */
  --border:        rgba(86, 44, 25, 0.10);
  --border-gold:   rgba(183, 134, 51, 0.35);

  /* Gold Palette (Mustard tones) */
  --gold:          #b78633;
  --gold-light:    #cda558;
  --gold-dark:     #8f6420;

  /* Typography (Dark Brown tones) */
  --text-primary:  #562c19;
  --text-muted:    #764a35;
  --text-faint:    #987360;

  /* Shadows */
  --shadow:        0 2px 16px rgba(86, 44, 25, 0.06);
  --shadow-gold:   0 4px 20px rgba(183, 134, 51, 0.18);
}

/* Body Background */
[data-theme="light"] body {
  background: var(--bg-base);
}

/* ── Sidebar (Light) ── */
[data-theme="light"] .sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  box-shadow: none;
}

[data-theme="light"] .sidebar-logo {
  border-bottom-color: rgba(180, 158, 120, 0.18);
}

[data-theme="light"] .sidebar-logo .logo-title {
  color: var(--gold);
}

[data-theme="light"] .sidebar-logo .logo-sub {
  color: var(--text-faint);
}

[data-theme="light"] .nav-group-label {
  color: #C4B090;
}

[data-theme="light"] .nav-item {
  color: #6B5B48;
}

[data-theme="light"] .nav-item:hover {
  background: rgba(160, 120, 64, 0.07);
  color: var(--gold);
}

[data-theme="light"] .nav-item.active {
  background: linear-gradient(90deg, rgba(160, 120, 64, 0.12) 0%, rgba(160, 120, 64, 0.03) 100%);
  color: var(--gold);
  border-left-color: var(--gold);
}

/* ── Top Header (Light) ── */
[data-theme="light"] .header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

/* ── Cards (Light) ── */
[data-theme="light"] .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(140, 110, 70, 0.06);
}

[data-theme="light"] .card:hover {
  box-shadow: 0 4px 20px rgba(140, 110, 70, 0.1), 0 0 0 0.5px rgba(160, 120, 64, 0.2);
}

[data-theme="light"] .card-header {
  border-bottom-color: rgba(180, 158, 120, 0.14);
  background: linear-gradient(180deg, #FFFDF9 0%, #FFFFFF 100%);
}

[data-theme="light"] .card-title {
  color: var(--text-primary);
}

/* ── Stat Cards (Light) ── */
[data-theme="light"] .stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(140, 110, 70, 0.06);
}

[data-theme="light"] .stat-value {
  color: #1C1410;
}

[data-theme="light"] .stat-label {
  color: #A89880;
}

/* ── Table (Light) — refined striping ── */
[data-theme="light"] table.data-table {
  border-color: rgba(180, 158, 120, 0.12);
}

[data-theme="light"] table.data-table th {
  background: linear-gradient(180deg, #FAF7F2 0%, #F5F0E8 100%);
  color: #8B7355;
  border-bottom-color: rgba(180, 158, 120, 0.2);
  font-size: 11px;
  letter-spacing: .04em;
}

[data-theme="light"] table.data-table td {
  border-bottom-color: rgba(180, 158, 120, 0.08);
  color: #3D2E1E;
}

[data-theme="light"] table.data-table tr:hover td {
  background: rgba(160, 120, 64, 0.04);
}

/* ── Form Controls (Light) — warm input fields ── */
[data-theme="light"] .form-control {
  background: #FFFCF8;
  border: 1px solid rgba(180, 158, 120, 0.28);
  color: #1C1410;
  box-shadow: inset 0 1px 3px rgba(140, 110, 70, 0.04);
}

[data-theme="light"] .form-control::placeholder {
  color: #C4B090;
}

[data-theme="light"] .form-control:focus {
  background: #FFFFFF;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(160, 120, 64, 0.12), inset 0 1px 3px rgba(140, 110, 70, 0.04);
}

[data-theme="light"] .form-label {
  color: #6B5B48;
}

/* ── Buttons (Light) ── */
[data-theme="light"] .btn-outline {
  background: rgba(255, 252, 248, 0.9);
  border-color: rgba(180, 158, 120, 0.3);
  color: #6B5B48;
}

[data-theme="light"] .btn-outline:hover {
  background: rgba(160, 120, 64, 0.08);
  border-color: var(--gold);
  color: var(--gold);
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #6B8FBF 0%, #5070A0 100%);
  box-shadow: 0 2px 8px rgba(80, 112, 160, 0.25);
}

/* ── Badge System (Light) ── */
[data-theme="light"] .badge {
  opacity: 0.9;
}

[data-theme="light"] .badge-success {
  background: rgba(22, 163, 74, 0.1);
  color: #16A34A;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

[data-theme="light"] .badge-warning {
  background: rgba(217, 119, 6, 0.1);
  color: #D97706;
  border: 1px solid rgba(217, 119, 6, 0.2);
}

[data-theme="light"] .badge-danger {
  background: rgba(220, 38, 38, 0.08);
  color: #DC2626;
  border: 1px solid rgba(220, 38, 38, 0.18);
}

[data-theme="light"] .badge-info {
  background: rgba(37, 99, 235, 0.08);
  color: #2563EB;
  border: 1px solid rgba(37, 99, 235, 0.18);
}

[data-theme="light"] .badge-muted {
  background: rgba(180, 158, 120, 0.1);
  color: #8B7355;
  border: 1px solid rgba(180, 158, 120, 0.22);
}

/* ── Modals (Light) ── */
[data-theme="light"] .modal-content {
  background: #FFFCF8;
  border: 1px solid rgba(180, 158, 120, 0.2);
  box-shadow: 0 20px 60px rgba(100, 75, 40, 0.16), 0 4px 20px rgba(140, 110, 70, 0.1);
}

[data-theme="light"] .modal-header {
  border-bottom-color: rgba(180, 158, 120, 0.14);
  background: linear-gradient(180deg, #FFFDF9 0%, #FFFCF8 100%);
}

[data-theme="light"] .modal-footer {
  border-top-color: rgba(180, 158, 120, 0.14);
}

/* ── Dropdown (Light) ── */
[data-theme="light"] .dropdown-menu {
  background: #FFFCF8;
  border: 1px solid rgba(180, 158, 120, 0.2);
  box-shadow: 0 12px 36px rgba(100, 75, 40, 0.14);
}

[data-theme="light"] .dropdown-item {
  color: #6B5B48;
}

[data-theme="light"] .dropdown-item:hover {
  background: rgba(160, 120, 64, 0.06);
  color: var(--gold);
}

/* ── Auth Card (Light) ── */
[data-theme="light"] .auth-card {
  background: rgba(255, 252, 248, 0.96);
  box-shadow: 0 24px 64px rgba(100, 75, 40, 0.12), 0 4px 24px rgba(140, 110, 70, 0.08);
  border: 1px solid rgba(180, 158, 120, 0.15);
  backdrop-filter: blur(16px);
}

/* ── Scrollbar (Light) ── */
[data-theme="light"] ::-webkit-scrollbar-track {
  background: #FAF7F2;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(160, 120, 64, 0.25);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(160, 120, 64, 0.45);
}

/* ── Page Header (Light) ── */
[data-theme="light"] .page-title {
  color: #1C1410;
}

[data-theme="light"] .page-breadcrumb a {
  color: var(--gold);
}

[data-theme="light"] .page-breadcrumb {
  color: #A89880;
}

/* ── Table Container (Light) ── */
[data-theme="light"] .table-container {
  border: 1px solid rgba(180, 158, 120, 0.12);
}

/* ── Sidebar Footer (Light) ── */
[data-theme="light"] .sidebar-footer {
  border-top-color: rgba(180, 158, 120, 0.18);
}

/* ── Serodja Decorative Pattern ── */
[data-theme="light"] .sidebar::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 200px;
  background-image: url('../images/pattern.png');
  background-size: 150px;
  background-repeat: repeat;
  opacity: 0.15;
  pointer-events: none;
  z-index: -1;
}

[data-theme="light"] .auth-bg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url('../images/pattern.png');
  background-size: 200px;
  background-repeat: repeat;
  opacity: 0.1;
  pointer-events: none;
  border-radius: 0;
}

/* ── Select2 (Light) ── */
[data-theme="light"] .select2-container--default .select2-selection--single {
  background-color: #FFFCF8 !important;
  border-color: rgba(180, 158, 120, 0.28) !important;
}

[data-theme="light"] .select2-dropdown {
  background-color: #FFFCF8 !important;
  border-color: var(--gold) !important;
  box-shadow: 0 12px 36px rgba(100, 75, 40, 0.14) !important;
}

[data-theme="light"] .select2-container--default .select2-search--dropdown .select2-search__field {
  background-color: #FAF7F2 !important;
  border-color: rgba(180, 158, 120, 0.28) !important;
  color: #1C1410 !important;
}

[data-theme="light"] .select2-container--default .select2-results__option {
  border-bottom-color: rgba(180, 158, 120, 0.1) !important;
  color: #4A3B28;
}

/* ============================================================
   MOBILE RESPONSIVE SYSTEM CSS
   ============================================================ */

/* Medium Screens & Tablets (<= 1024px) */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .3s ease;
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 16px;
  }
  #sidebar-toggle {
    display: flex !important;
  }
  .modal-content {
    max-width: 90vw;
  }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  .main-content {
    padding: 12px 10px;
  }
  
  .header {
    padding: 10px 14px;
    gap: 8px;
  }

  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .page-header-left {
    width: 100%;
  }

  /* Grid Layout Fallbacks */
  .grid-2, .grid-3, .grid-4, .stat-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Split Column Layouts */
  div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Stat Cards */
  .stat-card {
    padding: 14px;
  }

  /* Forms */
  .form-group {
    margin-bottom: 12px;
  }
  .form-control, .btn {
    min-height: 42px;
    font-size: 13.5px;
  }

  /* Tables Scrollable Container */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
    border-radius: 8px;
  }
  table.data-table {
    min-width: 600px;
    font-size: 12px;
  }
  table.data-table th, table.data-table td {
    padding: 8px 10px;
  }

  /* POS Terminal Mobile Adjustments */
  #menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 8px !important;
  }
  .pos-item-img {
    height: 80px !important;
  }

  /* Modals */
  .modal-content {
    width: 95vw !important;
    margin: 10px auto;
    padding: 16px;
  }

  /* Action Buttons & Badges */
  .badge {
    font-size: 10.5px;
    padding: 4px 8px;
  }
}

/* Small Mobile Screens (<= 480px) */
@media (max-width: 480px) {
  .page-title {
    font-size: 18px !important;
  }
  .btn {
    font-size: 12.5px;
    padding: 8px 12px;
  }
  .card-body {
    padding: 14px;
  }
}

