:root {
  --orange: #E8541A;
  --orange-light: #F4773A;
  --brown: #2C1A0E;
  --brown-mid: #5C3D22;
  --cream: #FAF6EE;
  --peach: #FADDD0;
  --gray: #F0EBE3;
  --white: #FFFFFF;
  --sidebar-w: 220px;
  --green: #059669;
  --red: #DC2626;
  --yellow: #D97706;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', Arial, sans-serif;
  background: var(--cream);
  color: var(--brown);
  font-size: 14px;
}

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── LAYOUT ─────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--brown);
  padding: 0;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.sidebar-logo .dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

nav.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 16px 20px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.7);
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
  border-left: 3px solid transparent;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.07);
  border-left-color: var(--orange);
  text-decoration: none;
}

.nav-link .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.logout-btn {
  width: 100%;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.6);
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
}
.logout-btn:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ── MAIN ───────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1 { font-size: 18px; font-weight: 700; color: var(--brown); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.content { padding: 32px; flex: 1; max-width: 1200px; }

/* ── CARDS / STATS ──────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray);
  border-radius: 14px;
  padding: 20px 24px;
}

.stat-label { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--brown-mid); margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 900; color: var(--brown); line-height: 1; }
.stat-sub { font-size: 12px; color: var(--brown-mid); margin-top: 4px; }

/* ── TABLES ─────────────────────────────────────── */
.table-wrap { background: var(--white); border: 1px solid var(--gray); border-radius: 14px; overflow: hidden; }
.table-header { padding: 16px 20px; border-bottom: 1px solid var(--gray); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.table-header h2 { font-size: 15px; font-weight: 700; }

table { width: 100%; border-collapse: collapse; }
th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--brown-mid); background: var(--cream); border-bottom: 1px solid var(--gray); }
td { padding: 12px 16px; border-bottom: 1px solid var(--gray); font-size: 14px; color: var(--brown); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #faf8f5; }

/* ── BADGES ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 50px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
}
.badge-published { background: #D1FAE5; color: #065F46; }
.badge-draft     { background: #F3F4F6; color: #6B7280; }
.badge-soldout   { background: #FEE2E2; color: #991B1B; }
.badge-past      { background: #E5E7EB; color: #374151; }
.badge-paid      { background: #D1FAE5; color: #065F46; }
.badge-pending   { background: #FEF3C7; color: #92400E; }
.badge-expired   { background: #E5E7EB; color: #374151; }
.badge-unknown   { background: #F3F4F6; color: #6B7280; }
.badge-waiting   { background: #FEF3C7; color: #92400E; }
.badge-contacted { background: #DBEAFE; color: #1E40AF; }
.badge-seated    { background: #D1FAE5; color: #065F46; }
.badge-removed   { background: #E5E7EB; color: #374151; }
.badge-new       { background: #FEF3C7; color: #92400E; }
.badge-active    { background: #D1FAE5; color: #065F46; }
.badge-archived  { background: #E5E7EB; color: #374151; }

/* ── BUTTONS ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
}
.btn-primary  { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-light); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--cream); color: var(--brown); border: 1.5px solid var(--gray); }
.btn-secondary:hover { background: var(--peach); text-decoration: none; }
.btn-danger   { background: #FEE2E2; color: var(--red); }
.btn-danger:hover { background: #FECACA; text-decoration: none; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px 8px; }

/* ── FORMS ───────────────────────────────────────── */
.form-card { background: var(--white); border: 1px solid var(--gray); border-radius: 14px; padding: 28px; }
.form-section { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--gray); }
.form-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.form-section-title { font-size: 13px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--brown-mid); margin-bottom: 16px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 12px; font-weight: 600; color: var(--brown); }
.label-hint { font-weight: 400; color: var(--brown-mid); }

input, textarea, select {
  background: var(--cream);
  border: 1.5px solid #E0D8CF;
  border-radius: 8px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--brown);
  transition: border-color .15s;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--orange);
}
textarea { resize: vertical; min-height: 120px; }

.form-actions { display: flex; gap: 12px; margin-top: 24px; }

/* ── MODAL ───────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(44,26,14,.5);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--white);
  border-radius: 16px;
  padding: 28px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

/* ── ALERTS ──────────────────────────────────────── */
.alert { border-radius: 10px; padding: 12px 16px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: #D1FAE5; color: #065F46; }
.alert-error   { background: #FEE2E2; color: #991B1B; }
.alert-info    { background: #DBEAFE; color: #1E40AF; }
.hidden { display: none !important; }

/* ── LOGIN PAGE ──────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brown);
  padding: 40px 20px;
}
.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px;
  max-width: 400px;
  width: 100%;
}
.login-card h1 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 4px;
}
.login-card p { color: var(--brown-mid); font-size: 14px; margin-bottom: 28px; }

/* ── PROGRESS BAR ────────────────────────────────── */
.capacity-bar {
  height: 6px;
  background: var(--gray);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}
.capacity-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 3px;
  transition: width .3s;
}

/* ── JSON EDITOR ─────────────────────────────────── */
.json-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
  background: var(--cream);
  border-radius: 8px;
  padding: 12px;
}
.json-row input { margin: 0; }
.json-row .remove-btn { flex-shrink: 0; background: none; border: none; cursor: pointer; color: var(--red); font-size: 16px; padding: 8px 4px; }
.add-row-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--orange); background: none; border: none; cursor: pointer; font-weight: 600; padding: 0; margin-top: 4px; }
.add-row-btn:hover { text-decoration: underline; }
