@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #040b14;
  --bg-secondary: #071322;
  --bg-card: rgba(11, 23, 40, 0.6);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border: rgba(212, 168, 83, 0.12);
  --border-hover: rgba(212, 168, 83, 0.28);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --gold: #d4a853;
  --gold-light: #f3d8a2;
  --gold-dark: #aa8033;
  --gold-gradient: linear-gradient(135deg, #d4a853 0%, #aa8033 100%);
  --accent: #38bdf8;
  --accent-light: #7dd3fc;
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0ea5e9;
  --sidebar-w: 270px;
  --header-h: 70px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 10px 30px -10px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 40px -15px rgba(0,0,0,.7), 0 0 15px rgba(212,168,83,0.06);
  --transition: .3s cubic-bezier(.4, 0, .2, 1);
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 10% 20%, #0a1f33 0%, #040b14 90%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, .font-serif {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--gold-light); }

button {
  cursor: pointer;
  font-family: inherit;
  outline: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: .9rem;
  background: rgba(7, 19, 34, 0.8);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .7rem 1rem;
  outline: none;
  transition: all var(--transition);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
  background: rgba(11, 23, 40, 0.95);
}

/* Custom placeholder color */
::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

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

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #071526 0%, #040b14 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-brand {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sidebar-brand h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 0.5rem;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}
.sidebar-brand span {
  font-size: .7rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 3px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0.85;
}

.sidebar-nav {
  flex: 1;
  padding: 1.2rem 0.8rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem 1.2rem;
  color: var(--text-secondary);
  font-size: .9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.sidebar-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(3px);
}
.sidebar-nav a.active {
  color: #fff;
  background: rgba(212, 168, 83, 0.12);
  border: 1px solid rgba(212, 168, 83, 0.25);
  box-shadow: 0 4px 15px -5px rgba(212, 168, 83, 0.2);
}
.sidebar-nav a.active svg {
  color: var(--gold);
}
.sidebar-nav a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition);
}
.sidebar-nav a:hover svg {
  color: var(--gold-light);
}
.sidebar-nav .nav-badge {
  margin-left: auto;
  background: var(--gold-gradient);
  color: #040b14;
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 1.2rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 400;
}

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

/* ─── HEADER ─── */
.top-header {
  height: var(--header-h);
  background: rgba(4, 11, 20, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 1.2rem; }
.header-left h1 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.header-search {
  position: relative;
}
.header-search input {
  width: 280px;
  padding: .5rem 1rem .5rem 2.4rem;
  border-radius: 30px;
  font-size: .85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.header-search input:focus {
  width: 320px;
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--gold);
}
.header-search svg {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}
.header-right { display: flex; align-items: center; gap: 1.2rem; }
.header-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  position: relative;
  border: 1px solid transparent;
}
.header-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(212, 168, 83, 0.15);
}
.header-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}
.header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  color: #040b14;
  box-shadow: 0 3px 10px rgba(212, 168, 83, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

/* ─── PAGE CONTENT ─── */
.page-content {
  flex: 1;
  padding: 2rem;
}

/* ─── CARDS ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  transition: all var(--transition);
  overflow: hidden;
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.card-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.01);
}
.card-header h3 {
  font-size: 1.15rem;
  letter-spacing: 0.5px;
}
.card-body { padding: 1.5rem; }

/* ─── STAT CARDS ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold-gradient);
  opacity: 0.15;
  transition: opacity var(--transition), height var(--transition);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(212, 168, 83, 0.35);
}
.stat-card:hover::before {
  opacity: 1;
  height: 4px;
}
.stat-info h4 {
  font-size: .8rem;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.stat-info .stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-top: .4rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.5px;
  color: #fff;
}
.stat-info .stat-change {
  font-size: .8rem;
  margin-top: .4rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition);
}
.stat-card:hover .stat-icon {
  transform: scale(1.1);
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.purple { background: rgba(56, 189, 248, 0.1); color: var(--accent); border: 1px solid rgba(56, 189, 248, 0.2); }
.stat-icon.gold { background: rgba(212, 168, 83, 0.1); color: var(--gold); border: 1px solid rgba(212, 168, 83, 0.2); }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.stat-icon.blue { background: rgba(14, 165, 233, 0.1); color: var(--info); border: 1px solid rgba(14, 165, 233, 0.2); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-align: center;
}
.btn-primary {
  background: var(--gold-gradient);
  color: #040b14;
  box-shadow: 0 4px 15px rgba(212, 168, 83, 0.25);
}
.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 168, 83, 0.4);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--gold);
  color: #fff;
  transform: translateY(-1px);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  transform: translateY(-1px);
}
.btn-sm {
  padding: .4rem .9rem;
  font-size: .8rem;
  border-radius: 8px;
}
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}
.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ─── TABLE ─── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
thead th {
  padding: 1rem 1.2rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--border);
  background: rgba(7, 19, 34, 0.85);
  font-family: 'Inter', sans-serif;
}
tbody td {
  padding: 1rem 1.2rem;
  font-size: .88rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}
tbody tr {
  transition: all var(--transition);
  background: rgba(11, 23, 40, 0.2);
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
}
.badge-success { background: rgba(16, 185, 129, 0.08); color: var(--success); border-color: rgba(16, 185, 129, 0.25); }
.badge-warning { background: rgba(245, 158, 11, 0.08); color: var(--warning); border-color: rgba(245, 158, 11, 0.25); }
.badge-danger  { background: rgba(239, 68, 68, 0.08); color: var(--danger); border-color: rgba(239, 68, 68, 0.25); }
.badge-info    { background: rgba(56, 189, 248, 0.08); color: var(--accent); border-color: rgba(56, 189, 248, 0.25); }
.badge-gold    { background: rgba(212, 168, 83, 0.08); color: var(--gold); border-color: rgba(212, 168, 83, 0.25); }
.badge-purple  { background: rgba(139, 92, 246, 0.08); color: #a78bfa; border-color: rgba(139, 92, 246, 0.25); }

/* ─── AVATAR ─── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  background: var(--gold-gradient);
  color: #040b14;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.05);
}
.avatar-sm { width: 30px; height: 30px; font-size: .75rem; }
.avatar-lg { width: 54px; height: 54px; font-size: 1rem; }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(3, 7, 13, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  padding: 1.5rem;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: #071322;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95) translateY(15px);
  transition: transform var(--transition);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 30px rgba(212, 168, 83, 0.1);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.01);
}
.modal-header h3 {
  font-size: 1.25rem;
  letter-spacing: 0.5px;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(212, 168, 83, 0.15);
}
.modal-body { padding: 1.8rem; }
.modal-footer {
  padding: 1.2rem 1.8rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  background: rgba(255,255,255,0.01);
}

/* ─── FORM ─── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .45rem;
  letter-spacing: 0.3px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
textarea { resize: vertical; min-height: 90px; }

/* ─── TABS ─── */
.tabs {
  display: flex;
  gap: .5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding-bottom: 1px;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  padding: .75rem 1.2rem;
  font-size: .9rem;
  font-weight: 600;
  transition: all var(--transition);
}
.tab-btn:hover { color: #fff; }
.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ─── CHART (simple bar/line) ─── */
.chart-container { position: relative; width: 100%; margin-top: 1rem; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 15px; border-bottom: 1px solid var(--border); }
.chart-bar {
  flex: 1;
  background: var(--gold-gradient);
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  position: relative;
  transition: all var(--transition);
  opacity: .85;
}
.chart-bar:hover {
  opacity: 1;
  transform: scaleY(1.02);
  box-shadow: 0 0 10px rgba(212, 168, 83, 0.4);
}
.chart-bar .chart-tooltip {
  position: absolute;
  bottom: 105%;
  left: 50%;
  transform: translateX(-50%);
  background: #071322;
  border: 1px solid var(--gold);
  padding: .4rem .8rem;
  border-radius: 8px;
  font-size: .75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  color: #fff;
  font-weight: 600;
  z-index: 10;
}
.chart-bar:hover .chart-tooltip { opacity: 1; }
.chart-labels { display: flex; gap: 10px; margin-top: .6rem; }
.chart-labels span { flex: 1; text-align: center; font-size: .75rem; color: var(--text-secondary); font-weight: 500; }

/* ─── MISC ─── */
.section-title {
  font-size: 1.25rem;
  margin-bottom: 1.2rem;
  letter-spacing: 0.5px;
}
.empty-state {
  text-align: center; padding: 4rem 2rem; color: var(--text-secondary);
}
.empty-state svg { width: 56px; height: 56px; margin-bottom: 1rem; opacity: .3; color: var(--gold); }
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .8rem; }
.mt-1 { margin-top: .6rem; }
.mt-2 { margin-top: 1.2rem; }
.mb-1 { margin-bottom: .6rem; }
.mb-2 { margin-bottom: 1.2rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .6rem; }
.gap-2 { gap: 1.2rem; }

/* Grid systems helper */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

@media (max-width: 992px) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(212, 168, 83, 0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212, 168, 83, 0.35); }

/* ─── ANIMATIONS ─── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-15px); } to { opacity: 1; transform: translateX(0); } }
.fade-in { animation: fadeIn .4s cubic-bezier(.4, 0, .2, 1) forwards; }
.slide-in { animation: slideIn .35s cubic-bezier(.4, 0, .2, 1) forwards; }

/* ─── RESPONSIVE ─── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.menu-toggle:hover { background: rgba(255, 255, 255, 0.05); }

@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, 0.8); }
  .main-wrapper { margin-left: 0; }
  .menu-toggle { display: flex; }
  .header-search input { width: 180px; }
  .header-search input:focus { width: 220px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-content { padding: 1.2rem; }
  .top-header { padding: 0 1.2rem; }
  .header-search { display: none; } /* Hide search on mobile */
  .card-header { padding: 1rem 1.2rem; }
  .card-body { padding: 1.2rem; }
}
