:root {
  --bg: #0b1220;
  --bg-elevated: #111b2e;
  --surface: #152238;
  --border: rgba(148, 163, 184, 0.18);
  --text: #e8eef7;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.15);
  --success: #34d399;
  --danger: #f87171;
  --radius: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(34, 211, 238, 0.12), transparent),
    radial-gradient(900px 500px at 100% 0%, rgba(99, 102, 241, 0.1), transparent), var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(11, 18, 32, 0.85);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #0b1220;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  text-decoration: none;
  color: inherit;
  background: transparent;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  color: #042f2e;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  border-color: rgba(34, 211, 238, 0.35);
  background: var(--accent-dim);
}

.btn-danger {
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
  background: rgba(248, 113, 113, 0.08);
}

.hero {
  padding: 4rem 0 3rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.hero p.lead {
  margin: 0 0 1.75rem;
  color: var(--muted);
  max-width: 52ch;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 3rem 0;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.section-title {
  font-size: 1.35rem;
  margin: 0 0 1rem;
}

.panel {
  max-width: 480px;
  margin: 2rem auto;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}

.admin-form-grid {
  max-width: 28rem;
}

input:not([type]),
input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(34, 211, 238, 0.35);
  outline-offset: 2px;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.alert-success {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
}

.alert-info {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: #cffafe;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-paid {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
}

.badge-unpaid {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}

.badge-cancelled {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.badge-declined {
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
}

.badge-pending-pay {
  background: rgba(251, 191, 36, 0.14);
  color: #fcd34d;
}

.badge-processing-pay {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
}

.pay-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.pay-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.pay-stat .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.pay-stat .value {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.pay-stat .sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.tab.active {
  border-color: rgba(34, 211, 238, 0.45);
  color: var(--accent);
  background: var(--accent-dim);
}

.layout-dashboard {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  padding: 2rem 0 4rem;
}

@media (max-width: 860px) {
  .layout-dashboard {
    grid-template-columns: 1fr;
  }
}

.side-nav {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--bg-elevated);
  height: fit-content;
}

.side-nav a {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}

.side-nav a:hover,
.side-nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
  text-decoration: none;
}

.dashboard-main .card {
  margin-bottom: 1.25rem;
}

.search-results {
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 0.5rem;
  display: none;
  background: var(--surface);
}

.search-results.open {
  display: block;
}

.search-results button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.search-results button:last-child {
  border-bottom: none;
}

.search-results button:hover {
  background: var(--accent-dim);
}

.line-items .line-row {
  display: grid;
  grid-template-columns: 2fr 0.7fr 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: end;
}

@media (max-width: 700px) {
  .line-items .line-row {
    grid-template-columns: 1fr;
  }
}

#payment-element {
  margin: 1rem 0;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.btn-wa {
  border-color: rgba(37, 211, 102, 0.45);
  color: #86efac;
  background: rgba(37, 211, 102, 0.08);
}

.btn-wa:hover {
  border-color: rgba(37, 211, 102, 0.65);
  background: rgba(37, 211, 102, 0.14);
  color: #bbf7d0;
}

.alert-support {
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #d1fae5;
}

.side-nav a.side-wa {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  color: #86efac;
}

.side-nav a.side-wa:hover {
  color: #bbf7d0;
  background: rgba(37, 211, 102, 0.1);
}

.hidden {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.hidden {
  display: none !important;
}

.mono {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}
