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

:root {
  --bg-void: #12141A;
  --bg-surface: #1B1E25;
  --bg-surface-2: #242832;
  --bg-surface-3: #2E3340;
  --line: #333846;

  --ember: #FF6B2C;
  --ember-dim: #7A3A1C;

  --status-new: #5B8DEF;
  --status-preparing: #FFB93C;
  --status-ready: #34D399;
  --status-completed: #8A90A0;
  --status-cancelled: #F0555F;

  --text-primary: #F3F1EC;
  --text-muted: #8A90A0;
  --text-dim: #5B6070;

  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;

  --radius: 6px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
}
a { color: var(--ember); text-decoration: none; }
button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  transition: filter 0.15s ease, transform 0.1s ease;
}
button:active { transform: scale(0.98); }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}
input, select, textarea {
  font-family: var(--font-body);
  background: var(--bg-surface-2);
  border: 1px solid var(--line);
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.btn-primary {
  background: var(--ember);
  color: #16130F;
  font-weight: 600;
  padding: 12px 20px;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-primary);
  padding: 10px 16px;
}
.btn-ghost:hover { border-color: var(--ember); }
.btn-danger { background: var(--status-cancelled); color: white; padding: 10px 16px; font-weight: 600; }

/* ---- App shell / topbar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
}
.topbar-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 15px;
  color: var(--text-primary);
}
.topbar-brand span { color: var(--ember); }
.topbar-user { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 12px; }

/* ---- Ticket card: the signature element ---- */
.ticket {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  overflow: visible;
}
.ticket::before, .ticket::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: var(--bg-void);
  border-radius: 50%;
  left: -8px;
}
.ticket::before { top: -8px; }
.ticket::after { bottom: -8px; }
.ticket-perforation {
  border-top: 2px dashed var(--line);
  margin: 12px 0;
}
.ticket-number {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
}
.status-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}
.status-new { background: rgba(91,141,239,0.15); color: var(--status-new); }
.status-preparing { background: rgba(255,185,60,0.15); color: var(--status-preparing); }
.status-ready { background: rgba(52,211,153,0.15); color: var(--status-ready); }
.status-completed { background: rgba(138,144,160,0.15); color: var(--status-completed); }
.status-cancelled { background: rgba(240,85,95,0.15); color: var(--status-cancelled); }

/* ---- Login ---- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-box {
  width: 100%; max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 36px 32px;
}
.login-logo {
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 700;
  margin-bottom: 4px;
}
.login-logo span { color: var(--ember); }
.login-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.field input { width: 100%; }
.error-msg { color: var(--status-cancelled); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ---- Layout helpers ---- */
.page { padding: 24px; max-width: 1400px; margin: 0 auto; }
.grid { display: grid; gap: 16px; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.stat-card {
  background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-family: var(--font-mono); font-size: 28px; font-weight: 700; margin-top: 6px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }

.loading, .empty-state { color: var(--text-muted); text-align: center; padding: 40px 20px; font-size: 14px; }

@media (max-width: 900px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
}

@media print {
  .no-print { display: none !important; }
  body { background: white; color: black; }
}
