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

:root {
  --bg: #0a0a0f;
  --text: #f5f1ea;
  --muted: #a39d93;
  --faint: #6f6a63;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.08);

  --gold: #e9b86c;
  --gold-soft: #f6d9a4;
  --rose: #e8789c;
  --grad: linear-gradient(135deg, #f7dba8 0%, #e6a85a 48%, #e2789c 100%);
  --grad-soft: linear-gradient(135deg, rgba(247, 219, 168, 0.18), rgba(226, 120, 156, 0.14));

  --free: #3ddc97;
  --few: #f7b84b;
  --full: #f2706d;
  --prog: #f7b84b;
  --done: #7dd3fc;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(55rem 38rem at 8% -12%, rgba(230, 168, 90, 0.20), transparent 60%),
    radial-gradient(48rem 36rem at 108% 8%, rgba(226, 120, 156, 0.16), transparent 60%),
    radial-gradient(42rem 30rem at 50% 115%, rgba(110, 100, 240, 0.14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-soft); }
[hidden] { display: none !important; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(560px, 100% - 32px); }

/* ---------- Header ---------- */
.top { padding: 26px 0 8px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 46px; height: 46px; border-radius: 15px; flex: none;
  display: grid; place-items: center;
  background: var(--grad); color: #1b1208;
  box-shadow: 0 10px 30px -8px rgba(230, 168, 90, 0.6);
}
.logo svg { width: 24px; height: 24px; }
.brand h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: 0.01em; }
.brand p { margin: 0; color: var(--muted); font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.live {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px;
  background: rgba(61, 220, 151, 0.10); border: 1px solid rgba(61, 220, 151, 0.25);
  color: #9ef0c8; font-size: 13px; font-weight: 500;
}
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--free); position: relative; }
.live i::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--free); animation: ping 1.8s ease-out infinite;
}
.live.off { background: rgba(242, 112, 109, 0.1); border-color: rgba(242, 112, 109, 0.3); color: #ffb4b2; }
.live.off i { background: var(--full); }
.live.off i::after { display: none; }

/* ---------- Cards ---------- */
main { padding: 12px 0 64px; display: grid; gap: 18px; }
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
main > .card:nth-child(2) { animation-delay: 0.06s; }
main > .card:nth-child(3) { animation-delay: 0.12s; }
main > .card:nth-child(4) { animation-delay: 0.18s; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card h2 { margin: 0; font-size: 18px; font-weight: 600; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { color: var(--muted); margin: 6px 0; }
.error { color: #ff9c99; font-size: 14px; min-height: 1.2em; margin: 6px 0 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--glass-2);
  font-weight: 500; font-size: 15px; white-space: nowrap; text-decoration: none; color: inherit;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.24); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary {
  background: var(--grad); color: #1b1208; border-color: transparent; font-weight: 600;
  box-shadow: 0 10px 28px -10px rgba(230, 168, 90, 0.75);
}
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 14px 32px -10px rgba(230, 168, 90, 0.9); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn.danger { color: #ffb0ae; }
.btn.danger:hover { background: rgba(242, 112, 109, 0.14); border-color: rgba(242, 112, 109, 0.4); }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Form fields ---------- */
label.field { display: grid; gap: 7px; font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.25); color: var(--text);
  font-size: 16px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { height: auto; min-height: 110px; padding: 12px 16px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 4px rgba(233, 184, 108, 0.18);
}
.field select option { background: #17161c; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Dialog (bottom sheet on phones) ---------- */
dialog {
  border: 1px solid var(--line-2); border-radius: 26px; padding: 0;
  width: min(480px, 100% - 24px); max-height: calc(100vh - 32px);
  background: linear-gradient(180deg, #1c1a20, #121116); color: var(--text);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8);
}
dialog[open] { animation: sheet 0.35s cubic-bezier(0.2, 0.9, 0.2, 1); }
dialog::backdrop { background: rgba(5, 5, 8, 0.6); backdrop-filter: blur(6px); }
.sheet { padding: 26px; display: grid; gap: 16px; }
.sheet h2 { margin: 0; font-size: 22px; font-weight: 600; }
.sheet .sub { margin: -10px 0 0; color: var(--muted); }
.sheet-actions { display: flex; gap: 10px; margin-top: 4px; }
.sheet-actions .btn { flex: 1; }
@media (max-width: 600px) {
  dialog { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 26px 26px 0 0; border-bottom: 0; }
  dialog[open] { animation: sheet-up 0.35s cubic-bezier(0.2, 0.9, 0.2, 1); }
}

/* ---------- Tokens ---------- */
.token {
  display: inline-grid; place-items: center; flex: none;
  min-width: 52px; height: 40px; padding: 0 10px; border-radius: 12px;
  font-weight: 600; font-size: 16px; letter-spacing: 0.02em;
  background: var(--glass-2); border: 1px solid var(--line-2);
}
.token.in_progress { background: rgba(247, 184, 75, 0.14); border-color: rgba(247, 184, 75, 0.4); color: #ffd690; }
.token.done { background: rgba(125, 211, 252, 0.1); border-color: rgba(125, 211, 252, 0.3); color: #bfe8ff; }
.token.no_show, .token.cancelled { color: var(--faint); text-decoration: line-through; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 13px 20px; border-radius: 14px; max-width: calc(100% - 32px);
  background: #24222a; border: 1px solid var(--line-2); box-shadow: var(--shadow);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(242, 112, 109, 0.5); }

/* ---------- Animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(2); opacity: 0; } }
@keyframes sheet { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shimmer { to { background-position: 200% center; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
