:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #e5e7eb;
  --success: #10b981;
  --danger: #dc2626;
  --shadow: 0 18px 45px rgba(37, 99, 235, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #e8f0ff 0, var(--bg) 38%);
  color: var(--text);
  min-height: 100vh;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(1180px, calc(100% - 24px)); margin: 0 auto; padding: 22px 0 56px; }
.topbar, .panel-header, .section-heading, .ticket-card, .ticket-info, .hero-copy { display: flex; align-items: center; }
.topbar, .panel-header, .section-heading, .ticket-card { justify-content: space-between; gap: 16px; }
.topbar { margin-bottom: 20px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 5vw, 3rem); }
h2 { margin-bottom: 6px; }
.eyebrow { margin-bottom: 4px; color: var(--primary); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.icon-btn, .text-btn, .delete-btn { border: 0; background: transparent; }
.icon-btn { width: 46px; height: 46px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.hero-card, .panel, .tickets-section { background: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.8); border-radius: 24px; box-shadow: var(--shadow); }
.hero-card { padding: clamp(20px, 4vw, 34px); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hero-copy { gap: 18px; max-width: 720px; }
.hero-copy p { color: var(--muted); margin-bottom: 0; line-height: 1.6; }
.hero-icon { width: 64px; height: 64px; border-radius: 18px; background: #dbeafe; display: grid; place-items: center; font-size: 2rem; flex: 0 0 auto; }
.primary-btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 14px 20px; border: 0; border-radius: 14px; background: var(--primary); color: #fff; font-weight: 800; text-decoration: none; transition: transform .2s, background .2s; }
.primary-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.full { width: 100%; }
.panel, .tickets-section { margin-top: 22px; padding: clamp(18px, 4vw, 30px); }
.text-btn { color: var(--primary); font-weight: 700; }
.editor-grid { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(300px, 1.1fr); gap: 28px; margin-top: 20px; }
.preview-card { min-height: 420px; border-radius: 20px; overflow: hidden; background: #eef2f7; display: grid; place-items: center; }
.preview-card img { width: 100%; height: 100%; object-fit: contain; max-height: 560px; }
.ticket-form { display: grid; gap: 16px; }
.ticket-form label, fieldset { display: grid; gap: 8px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 13px 14px; color: var(--text); outline: none; }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; font-weight: 400; }
fieldset { border: 0; padding: 0; margin: 0; }
.payment-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.payment-option input { display: none; }
.payment-option span { padding: 12px; border: 1px solid var(--border); border-radius: 12px; text-align: center; cursor: pointer; }
.payment-option input:checked + span { border-color: var(--primary); background: #eff6ff; color: var(--primary); }
.count-badge { min-width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; background: #dbeafe; color: var(--primary); font-weight: 800; }
.empty-state { text-align: center; padding: 44px 16px 28px; color: var(--muted); }
.empty-state span { font-size: 3rem; }
.ticket-list { display: grid; gap: 12px; }
.ticket-card { padding: 16px; border: 1px solid var(--border); border-radius: 16px; }
.ticket-info { gap: 12px; }
.ticket-avatar { width: 46px; height: 46px; border-radius: 14px; background: #eef2ff; display: grid; place-items: center; }
.ticket-card h3 { margin-bottom: 4px; }
.ticket-meta { margin-bottom: 0; color: var(--muted); font-size: .92rem; }
.ticket-right { text-align: right; display: grid; gap: 6px; }
.ticket-total { font-size: 1.12rem; }
.delete-btn { color: var(--danger); font-size: .82rem; }
.loader-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .58); backdrop-filter: blur(6px); }
.loader-card { width: min(420px, 100%); background: #fff; border-radius: 24px; padding: 32px; text-align: center; box-shadow: 0 30px 90px rgba(15,23,42,.28); }
.spinner { width: 58px; height: 58px; border: 6px solid #dbeafe; border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 18px; animation: spin 1s linear infinite; }
.progress-track { height: 8px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .25s; }
.hidden { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 820px) {
  .hero-card { align-items: stretch; flex-direction: column; }
  .editor-grid { grid-template-columns: 1fr; }
  .preview-card { min-height: 280px; }
}
@media (max-width: 560px) {
  .app-shell { width: min(100% - 16px, 1180px); padding-top: 14px; }
  .hero-copy { align-items: flex-start; }
  .hero-icon { width: 52px; height: 52px; }
  .payment-options { grid-template-columns: 1fr; }
  .ticket-card { align-items: flex-start; }
  .ticket-right { min-width: 84px; }
}
