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

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

:root {
  --navy: #0D1B2A;
  --navy-light: #162436;
  --gold: #C8A96E;
  --gold-light: #E4C99A;
  --cream: #F7F3EE;
  --text: #1A2535;
  --text-muted: #6B7A8D;
  --border: #E5E7EB;
  --white: #ffffff;
  --sidebar-w: 240px;
  --success: #10B981;
  --danger: #EF4444;
}

body { font-family: 'Inter', sans-serif; background: #F1F3F6; color: var(--text); display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w); background: var(--navy); min-height: 100vh;
  position: fixed; top: 0; left: 0; display: flex; flex-direction: column;
  z-index: 50;
}
.sidebar-logo {
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(200,169,110,0.15);
}
.sidebar-logo-main { font-size: 1.1rem; color: var(--gold); font-weight: 600; }
.sidebar-logo-sub { font-size: 0.65rem; color: rgba(200,169,110,0.5); letter-spacing: 2px; text-transform: uppercase; margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-section-label { font-size: 0.62rem; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,0.25); padding: 1rem 1.5rem 0.5rem; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 1.5rem; color: rgba(255,255,255,0.6); text-decoration: none;
  font-size: 0.875rem; transition: all 0.15s; border-left: 2px solid transparent;
}
.sidebar-nav a:hover { color: var(--white); background: rgba(255,255,255,0.04); }
.sidebar-nav a.active { color: var(--gold); border-left-color: var(--gold); background: rgba(200,169,110,0.07); }
.sidebar-nav a .icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(200,169,110,0.1);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: rgba(255,255,255,0.4); text-decoration: none; transition: color 0.15s;
}
.sidebar-footer a:hover { color: var(--gold); }

/* MAIN */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
.topbar {
  background: var(--white); padding: 0 2rem; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
}
.page-title { font-size: 1.1rem; font-weight: 500; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-badge {
  background: rgba(200,169,110,0.12); color: var(--gold-dark);
  font-size: 0.75rem; padding: 0.25rem 0.75rem; border-radius: 99px; font-weight: 500;
}
.topbar-site-link {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; color: var(--text-muted); text-decoration: none;
  padding: 0.4rem 0.875rem; border: 1px solid var(--border);
  border-radius: 6px; transition: all 0.15s;
}
.topbar-site-link:hover { border-color: var(--gold); color: var(--gold); }
.content { padding: 2rem; flex: 1; }

/* CARDS / STATS */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--white); border-radius: 8px; padding: 1.25rem 1.5rem; border: 1px solid var(--border); }
.stat-card-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.stat-card-value { font-size: 1.75rem; font-weight: 600; color: var(--navy); line-height: 1; }
.stat-card-sub { font-size: 0.75rem; color: var(--success); margin-top: 0.25rem; }

/* TABLES */
.panel { background: var(--white); border-radius: 8px; border: 1px solid var(--border); overflow: hidden; margin-bottom: 2rem; }
.panel-head { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { font-size: 0.95rem; font-weight: 500; }
table { width: 100%; border-collapse: collapse; }
th { padding: 0.75rem 1.5rem; text-align: left; font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); background: #FAFAFA; border-bottom: 1px solid var(--border); }
td { padding: 0.875rem 1.5rem; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFBFF; }
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 99px; font-size: 0.7rem; font-weight: 500; }
.badge-green { background: #D1FAE5; color: #065F46; }
.badge-gray { background: #F3F4F6; color: #6B7280; }
.badge-gold { background: rgba(200,169,110,0.15); color: var(--gold-dark); }

/* FORMS */
.editor-wrap { display: grid; grid-template-columns: 1fr 360px; gap: 1.5rem; align-items: start; }
.form-panel { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; }
.form-panel h3 { font-size: 0.95rem; font-weight: 500; margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--text-muted); margin-bottom: 0.4rem; letter-spacing: 0.5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.625rem 0.875rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-family: 'Inter', sans-serif; font-size: 0.875rem; color: var(--text);
  background: var(--white); transition: border-color 0.15s; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,169,110,0.12); }
.field textarea { resize: vertical; min-height: 100px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 0.875rem 0; border-top: 1px solid var(--border); }
.toggle-label { font-size: 0.875rem; color: var(--text); }
.toggle { position: relative; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border); border-radius: 99px; cursor: pointer; transition: 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px; background: white; border-radius: 50%; transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--gold); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1.1rem; border-radius: 6px; font-size: 0.825rem; font-weight: 500; cursor: pointer; border: none; transition: all 0.15s; font-family: 'Inter', sans-serif; text-decoration: none; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); }
.btn-navy { background: var(--navy); color: white; }
.btn-navy:hover { background: var(--navy-light); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); background: #F9FAFB; }
.btn-danger { background: #FEE2E2; color: var(--danger); }
.btn-danger:hover { background: #FECACA; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.775rem; }

/* NOTIFICATIONS */
.toast { display: none; position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999; background: var(--navy); color: white; padding: 0.875rem 1.5rem; border-radius: 8px; font-size: 0.875rem; border-left: 3px solid var(--gold); }
.toast.show { display: block; animation: slideIn 0.25s ease; }
@keyframes slideIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* TABS */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab { padding: 0.75rem 1.25rem; font-size: 0.875rem; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-top: none; border-left: none; border-right: none; transition: all 0.15s; font-family: 'Inter', sans-serif; }
.tab.active { color: var(--navy); border-bottom-color: var(--gold); font-weight: 500; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Empty state */
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.3; }
.empty p { font-size: 0.875rem; }

@media (max-width: 1024px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .editor-wrap { grid-template-columns: 1fr; }
}
