/* ─── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --brand:       #1a56db;
  --brand-dark:  #1245b3;
  --brand-light: #ebf0fd;
  --success:     #16a34a;
  --warning:     #d97706;
  --danger:      #dc2626;
  --neutral-50:  #f9fafb;
  --neutral-100: #f3f4f6;
  --neutral-200: #e5e7eb;
  --neutral-400: #9ca3af;
  --neutral-600: #4b5563;
  --neutral-800: #1f2937;
  --neutral-900: #111827;

  --radius:  6px;
  --radius-lg: 10px;
  --shadow:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Courier New', monospace;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); color: var(--neutral-800); background: var(--neutral-50); line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ─── Typography ─────────────────────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem;  font-weight: 600; }
p  { color: var(--neutral-600); }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: .9rem; font-weight: 500; font-family: var(--font);
  cursor: pointer; border: 1px solid transparent;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary   { background: var(--brand);   color: #fff; border-color: var(--brand); }
.btn-primary:hover:not(:disabled)  { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover:not(:disabled)  { background: #15803d; }

.btn-danger    { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled)   { background: #b91c1c; }

.btn-ghost     { background: transparent; color: var(--neutral-600); border-color: var(--neutral-200); }
.btn-ghost:hover:not(:disabled)    { background: var(--neutral-100); }

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ─── Form elements ──────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: .875rem; font-weight: 500; color: var(--neutral-800); }
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--neutral-200); border-radius: var(--radius);
  font-size: .9rem; font-family: var(--font); color: var(--neutral-800);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--neutral-200); box-shadow: var(--shadow);
}
.card-body { padding: 24px; }

/* ─── Badges / status ────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 99px;
  font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-denied    { background: #fee2e2; color: #991b1b; }
.badge-completed { background: var(--neutral-100); color: var(--neutral-600); }
.badge-cancelled { background: var(--neutral-100); color: var(--neutral-400); }
.badge-internal  { background: #ede9fe; color: #5b21b6; }

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-4  { gap: 16px; }
.mt-2   { margin-top: 8px; }
.mt-4   { margin-top: 16px; }
.mt-6   { margin-top: 24px; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--neutral-400); }
.font-mono { font-family: var(--mono); }

/* ─── Toast notifications ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; color: #fff;
  box-shadow: var(--shadow-md);
  animation: slide-in .2s ease;
}
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-info    { background: var(--brand); }

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ─── Loading spinner ─────────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--neutral-200);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--neutral-400);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: .4; }
