*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--brand-text);
  background: var(--brand-bg);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: var(--leading-tight);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--brand-primary-hover); }

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ── Button ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  border: none;
  border-radius: var(--brand-radius-btn);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: var(--space-3) var(--space-6);
  min-height: 48px;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand-primary);
  color: white;
}
.btn-primary:hover { background: var(--brand-primary-hover); }

.btn-secondary {
  background: var(--brand-surface);
  color: var(--brand-text);
  border: 1px solid var(--brand-border);
}
.btn-secondary:hover { border-color: var(--brand-primary); }

.btn-ghost {
  background: transparent;
  color: var(--brand-text-muted);
}
.btn-ghost:hover { color: var(--brand-text); background: var(--brand-surface); }

.btn-danger {
  background: var(--color-danger);
  color: white;
}

.btn-sm {
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
  min-height: 36px;
  border-radius: var(--brand-radius-sm);
}

.btn-lg {
  font-size: var(--text-lg);
  padding: var(--space-4) var(--space-8);
  min-height: 56px;
}

/* ── Input ── */
.input {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--brand-text);
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: var(--space-3) var(--space-4);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-light);
}
.input.error { border-color: var(--color-danger); }
.input.success { border-color: var(--color-success); }
.input::placeholder { color: var(--brand-text-muted); }

/* ── Card ── */
.card {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
  padding: var(--space-6);
}
.card-raised {
  background: var(--brand-surface-raised);
  box-shadow: var(--shadow-md);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px var(--space-2);
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-pending { background: var(--status-pending); color: white; }
.badge-confirmed { background: var(--status-confirmed); color: white; }
.badge-preparing { background: var(--status-preparing); color: black; }
.badge-ready { background: var(--status-ready); color: white; }
.badge-delivering { background: var(--status-in-delivery); color: white; }
.badge-delivered { background: var(--status-delivered); color: white; }
.badge-cancelled { background: var(--status-cancelled); color: white; }
.badge-scheduled { background: var(--status-scheduled); color: white; }

/* ── Status dot pulse animation ── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: var(--space-2);
}
.status-dot.pending { background: var(--status-pending); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Toggle ── */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: #D1D5DB;
  border-radius: 12px;
  transition: background var(--transition-fast);
}
.toggle input:checked + .toggle-track { background: var(--brand-primary); }
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  background: var(--brand-surface-raised);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
  padding: var(--space-4) var(--space-6);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: slideUp 300ms ease;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Layout ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.text-center { text-align: center; }
.text-muted { color: var(--brand-text-muted); }
.w-full { width: 100%; }
.hidden { display: none; }

@media (min-width: 768px) {
  .desktop\:flex { display: flex; }
  .desktop\:hidden { display: none; }
}
