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

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #1d3d4f;
  --gold: #ccac71;
  --slate: #607783;
  --steel: #4a6472;
  --bg: #f4f5f7;
  --white: #ffffff;
  --danger: #c0392b;
  --success: #27ae60;
  --warning: #e67e22;
}

body {
  font-family: 'Quicksand', sans-serif;
  background: var(--bg);
  color: #333;
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
  font-weight: 600;
}

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

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

.sidebar {
  width: 240px;
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}

.sidebar-logo img { width: 160px; }

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.05);
}

.sidebar-nav a.active {
  color: var(--gold);
  background: rgba(204,172,113,0.08);
  border-left-color: var(--gold);
}

.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.sidebar-nav a.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}

.main {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
}

/* ── Top Bar ── */
.topbar {
  background: var(--white);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e0e3e8;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-left h1 { font-size: 20px; margin: 0; }

.topbar-right { display: flex; align-items: center; gap: 16px; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

/* ── Content ── */
.content { padding: 28px 32px; flex: 1; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid #e0e3e8;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e0e3e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 { font-size: 15px; margin: 0; }
.card-body { padding: 20px; }

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid #e0e3e8;
  padding: 20px;
}

.stat-card .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate);
  margin-bottom: 6px;
}

.stat-card .value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
}

.stat-card .change {
  font-size: 12px;
  margin-top: 4px;
}

.stat-card .change.up { color: var(--success); }
.stat-card .change.down { color: var(--danger); }

/* ── Buttons ── */
.btn {
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  text-decoration: none;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--gold);
  color: var(--navy);
}
.btn-primary:hover { background: #b89a62; color: var(--navy); }

.btn-secondary {
  background: transparent;
  color: var(--steel);
  border: 1px solid #cdd2d7;
}
.btn-secondary:hover { border-color: var(--steel); color: var(--navy); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-sm { padding: 6px 14px; font-size: 12px; }

.btn-outline-gold {
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold);
}
.btn-outline-gold:hover { background: var(--gold); color: var(--navy); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate);
  border-bottom: 2px solid #e0e3e8;
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f1f3;
  vertical-align: middle;
}

tbody tr:hover { background: #fafbfc; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
}

.badge-active { background: #e8f5e9; color: #2e7d32; }
.badge-draft { background: #fff3e0; color: #e65100; }
.badge-completed { background: #e3f2fd; color: #1565c0; }
.badge-cancelled { background: #ffebee; color: #c62828; }
.badge-vip { background: #fef3e2; color: #b8860b; }
.badge-ga { background: #e8eef2; color: var(--steel); }
.badge-sold { background: #ffebee; color: #c62828; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cdd2d7;
  border-radius: 6px;
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s;
  background: var(--white);
}

.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(204,172,113,0.15);
}

select.form-control { appearance: auto; }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e0e3e8;
  margin-bottom: 24px;
}

.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'Quicksand', sans-serif;
}

.tab:hover { color: var(--navy); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Grid Layouts ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-sidebar { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

/* ── Misc ── */
.text-muted { color: var(--slate); }
.text-gold { color: var(--gold); }
.text-sm { font-size: 12px; }
.text-right { text-align: right; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.flex-gap { display: flex; gap: 12px; }

.divider {
  border: none;
  border-top: 1px solid #e0e3e8;
  margin: 20px 0;
}

/* ── QR Scanner Area ── */
.scanner-area {
  width: 320px;
  height: 320px;
  border: 3px dashed var(--gold);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--slate);
  margin: 0 auto;
  background: #fafbfc;
}

.scanner-area svg { width: 64px; height: 64px; opacity: 0.3; }

/* ── Checkin Result ── */
.checkin-result {
  background: var(--white);
  border: 2px solid var(--success);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  max-width: 400px;
  margin: 20px auto;
}

.checkin-result.invalid { border-color: var(--danger); }

/* ── Chart placeholder ── */
.chart-placeholder {
  height: 280px;
  background: linear-gradient(180deg, rgba(204,172,113,0.08) 0%, rgba(29,61,79,0.04) 100%);
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-evenly;
  padding: 40px 20px 40px;
}

.chart-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  flex: 1;
  max-width: 80px;
}

.chart-bar-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  white-space: nowrap;
}

.chart-bar {
  width: 48px;
  background: var(--gold);
  border-radius: 4px 4px 0 0;
}

.chart-bar-label {
  font-size: 11px;
  color: var(--slate);
  margin-top: 8px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Public Event Page ── */
.public-page {
  background: var(--navy);
  min-height: 100vh;
}

.public-header {
  padding: 20px 0;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.public-header img { width: 140px; }

.event-hero {
  position: relative;
  height: 340px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--steel) 100%);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.event-hero-overlay {
  width: 100%;
  padding: 40px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: var(--white);
}

.event-hero-overlay h1 {
  color: var(--white);
  font-size: 36px;
  margin-bottom: 8px;
}

.event-hero-overlay .event-meta {
  display: flex;
  gap: 24px;
  color: rgba(255,255,255,0.8);
  font-size: 14px;
}

.event-body {
  max-width: 960px;
  margin: -40px auto 0;
  padding: 0 24px 60px;
  position: relative;
  z-index: 1;
}

.ticket-card {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid #e0e3e8;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}

.ticket-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.ticket-info h4 {
  font-size: 16px;
  margin-bottom: 4px;
}

.ticket-info p { color: var(--slate); font-size: 13px; margin: 0; }

.ticket-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin-right: 20px;
}

.ticket-qty {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid #cdd2d7;
  background: var(--white);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  color: var(--navy);
}

.qty-btn:hover { border-color: var(--gold); background: #fef9f0; }
.qty-num { font-weight: 700; font-size: 16px; min-width: 20px; text-align: center; }

.order-summary {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid #e0e3e8;
  padding: 24px;
  position: sticky;
  top: 80px;
}

.order-summary h3 { font-size: 16px; margin-bottom: 16px; }

.order-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
}

.order-total {
  display: flex;
  justify-content: space-between;
  padding: 12px 0 0;
  border-top: 2px solid var(--navy);
  margin-top: 8px;
  font-weight: 700;
  font-size: 15px;
}

/* ── Toast Integration ── */
.integration-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
}

.integration-status.connected {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #27ae60;
}

/* ── Activity Log ── */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f1f3;
  font-size: 13px;
}

.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-time {
  color: var(--slate);
  font-size: 11px;
  margin-top: 2px;
}

/* ── Progress bar ── */
.progress-bar {
  height: 6px;
  background: #e0e3e8;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
}

/* Search and filters bar */
.filters-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
}
