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

:root {
  --gold: #c9a84c;
  --gold-light: #e2c36e;
  --gold-dim: rgba(201,168,76,0.15);
  --gold-border: rgba(201,168,76,0.3);
  --bg: #07070d;
  --bg2: #0e0e1a;
  --bg3: #151525;
  --bg4: #1c1c30;
  --text: #e8e8f0;
  --text-muted: #7a7a9a;
  --text-dim: #4a4a6a;
  --danger: #e05555;
  --success: #4caf82;
  --info: #5599e0;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 40px rgba(0,0,0,0.5);
  --glow: 0 0 30px rgba(201,168,76,0.15);
}

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

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1,h2,h3,h4 { font-family: 'Syne', sans-serif; font-weight: 700; line-height: 1.2; }

img { max-width: 100%; display: block; }

input, textarea, select {
  font-family: 'Inter', sans-serif;
  background: var(--bg3);
  border: 1px solid var(--bg4);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #0a0a14;
}
.btn-gold:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,168,76,0.35); color: #0a0a14; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--gold-border);
  color: var(--gold);
}
.btn-outline:hover { background: var(--gold-dim); color: var(--gold-light); }
.btn-ghost {
  background: var(--bg3);
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg4); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── CARDS ── */
.card {
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-gold { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-border); }
.badge-success { background: rgba(76,175,130,0.15); color: var(--success); }
.badge-danger { background: rgba(224,85,85,0.15); color: var(--danger); }
.badge-info { background: rgba(85,153,224,0.15); color: var(--info); }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 16px;
}
.alert-success { background: rgba(76,175,130,0.12); border: 1px solid rgba(76,175,130,0.3); color: var(--success); }
.alert-danger { background: rgba(224,85,85,0.12); border: 1px solid rgba(224,85,85,0.3); color: var(--danger); }
.alert-info { background: rgba(85,153,224,0.12); border: 1px solid rgba(85,153,224,0.3); color: var(--info); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg3);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
td {
  padding: 14px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── FORM GROUPS ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 7px;
}
.form-hint { font-size: 0.75rem; color: var(--text-dim); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

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

.sidebar {
  width: 260px;
  background: var(--bg2);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}
.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #0a0a14;
}
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 12px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--gold-dim); color: var(--gold); }
.nav-item .icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.sidebar-user img {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-border);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.85rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.7rem; color: var(--gold); }

.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--bg2);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.page-content { padding: 28px; flex: 1; }

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--gold-border); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-value { font-family: 'Syne', sans-serif; font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.stat-change { font-size: 0.72rem; color: var(--success); margin-top: 2px; }

/* ── TOGGLE ── */
.toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg4);
  border-radius: 100px;
  transition: 0.3s;
}
.toggle-slider:before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--gold); }
.toggle input:checked + .toggle-slider:before { transform: translateX(18px); background: #0a0a14; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 22px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── COLOR PICKER ── */
input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 3px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ── AVATAR ── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-border);
}
.avatar-placeholder {
  background: linear-gradient(135deg, var(--gold-dim), var(--bg4));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  color: var(--gold);
  border-radius: 50%;
  border: 2px solid var(--gold-border);
  flex-shrink: 0;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; }

/* ── SEARCH BAR ── */
.search-bar {
  position: relative;
}
.search-bar input { padding-left: 38px; }
.search-bar .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

/* ── TABS ── */
.tabs { display: flex; gap: 4px; background: var(--bg3); padding: 4px; border-radius: var(--radius-sm); margin-bottom: 24px; }
.tab {
  flex: 1;
  padding: 8px 16px;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: transparent;
  transition: all 0.2s;
}
.tab.active { background: var(--bg2); color: var(--gold); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

/* ── HAMBURGER ── */
.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 99; }

/* ── PUBLIC PAGES ── */
.public-header {
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg2) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(201,168,76,0.12) 0%, transparent 60%);
}
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); margin-bottom: 20px; }
.hero h1 span { background: linear-gradient(135deg, var(--gold), var(--gold-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.15rem; color: var(--text-muted); max-width: 560px; margin: 0 auto 36px; }
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .hamburger { display: block; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .page-content { padding: 20px 16px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .modal { max-height: 95vh; }
}
