:root {
  --a-bg: #f4f5f7;
  --a-surface: #ffffff;
  --a-text: #1a1c23;
  --a-muted: #6b7280;
  --a-border: #e3e5ea;
  --a-accent: #00693e;
  --a-sidebar: #14141a;
  --a-sidebar-text: #cfcfd6;
  --a-radius: 12px;
  --a-shadow: 0 2px 8px rgba(20,20,26,0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  background: var(--a-bg);
  color: var(--a-text);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 220px;
  background: var(--a-sidebar);
  color: var(--a-sidebar-text);
  flex-shrink: 0;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
}
/* Light chip: the logo's dark-green wordmark would vanish on the dark sidebar. */
.admin-sidebar .brand {
  display: block;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px 8px;
  margin-bottom: 20px;
  text-align: center;
}
.admin-sidebar .brand img { height: 44px; width: auto; margin: 0 auto; display: block; }
.admin-sidebar .brand-sub {
  display: block;
  margin-top: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--a-muted);
}
.admin-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,0.08); color: #fff; }
.admin-sidebar .spacer { flex: 1; }
.admin-sidebar .who { font-size: 12px; color: #8b8b95; padding: 0 12px 8px; }
.admin-sidebar .logout-btn {
  background: none; border: 1px solid rgba(255,255,255,0.2); color: #cfcfd6;
  border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 13px; font-weight: 600;
  width: 100%;
}
.admin-sidebar .logout-btn:hover { background: rgba(255,255,255,0.08); }

.admin-main { flex: 1; padding: 28px 36px; max-width: 1100px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-topbar h1 { font-size: 22px; margin: 0; }

.a-card {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  padding: 20px;
  box-shadow: var(--a-shadow);
}
.a-card + .a-card { margin-top: 18px; }

.a-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: 8px; padding: 9px 16px;
  font-weight: 700; font-size: 13px; cursor: pointer;
}
.a-btn-primary { background: var(--a-accent); color: #fff; }
.a-btn-primary:hover { filter: brightness(0.94); }
.a-btn-secondary { background: #ececef; color: var(--a-text); }
.a-btn-secondary:hover { filter: brightness(0.96); }
.a-btn-danger { background: #fde2e2; color: #b3261e; }
.a-btn-danger:hover { filter: brightness(0.96); }
.a-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.a-btn-sm { padding: 6px 12px; font-size: 12px; }

.a-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.a-table th { text-align: left; color: var(--a-muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; padding: 8px 10px; border-bottom: 1px solid var(--a-border); }
.a-table td { padding: 10px; border-bottom: 1px solid var(--a-border); vertical-align: middle; }
.a-table tr:last-child td { border-bottom: none; }
.a-table tr:hover td { background: #fafafc; }

.a-status {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; letter-spacing: 0.02em;
}
.a-status.draft { background: #eee; color: #666; }
.a-status.published { background: #dcf5e6; color: #1f9d55; }
.a-status.cancelled { background: #fde2e2; color: #b3261e; }
.a-status.pending { background: #fff3cd; color: #8a6100; }
.a-status.paid { background: #dcf5e6; color: #1f9d55; }
.a-status.refunded, .a-status.partially_refunded { background: #e6e6fa; color: #5a4fcf; }
.a-status.expired, .a-status.valid { background: #eee; color: #666; }
.a-status.checked_in { background: #dcf5e6; color: #1f9d55; }

.a-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 900px) { .a-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.a-kpi { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--a-radius); padding: 16px 18px; box-shadow: var(--a-shadow); }
.a-kpi .label { font-size: 12px; color: var(--a-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.a-kpi .value { font-size: 24px; font-weight: 800; margin-top: 4px; }

.a-form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.a-form-field label { font-size: 13px; font-weight: 700; }
.a-form-field input, .a-form-field select, .a-form-field textarea {
  border: 1px solid var(--a-border); border-radius: 8px; padding: 9px 11px; font-size: 14px; background: #fff; color: var(--a-text);
}
.a-form-field textarea { min-height: 90px; resize: vertical; }
.a-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .a-form-grid { grid-template-columns: 1fr; } }
.a-form-error { color: #d32f2f; font-size: 13px; margin: -6px 0 12px; }
.a-form-hint { color: var(--a-muted); font-size: 12px; margin-top: -8px; margin-bottom: 12px; }

.a-empty { text-align: center; padding: 40px; color: var(--a-muted); }
.a-section-title { font-size: 15px; font-weight: 800; margin: 0 0 14px; }
.a-row-between { display: flex; align-items: center; justify-content: space-between; }
.a-search-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.a-search-bar input, .a-search-bar select { border: 1px solid var(--a-border); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.a-search-bar input { flex: 1; }

.a-modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,20,26,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.a-modal {
  background: #fff; border-radius: var(--a-radius); padding: 22px; width: 420px; max-width: 90vw;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.a-modal h3 { margin: 0 0 16px; }

.a-toast {
  position: fixed; bottom: 20px; right: 20px; background: #14141a; color: #fff;
  padding: 12px 18px; border-radius: 10px; font-size: 13px; font-weight: 600; z-index: 60;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.a-scan-input {
  font-size: 20px; padding: 14px; text-align: center; border: 2px solid var(--a-accent); border-radius: 10px; width: 100%;
}
