/* ==========================================================================
   TrafficFlow - Base Design System
   Colors, typography, buttons, badges, layout primitives shared everywhere.
   ========================================================================== */

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --secondary: #7C3AED;
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #DC2626;
  --bg: #F8FAFC;
  --card-bg: #FFFFFF;
  --text-dark: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 12px;
  line-height: 1.2;
  font-weight: 700;
}

p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.text-muted {
  color: var(--text-muted);
}

.section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.eyebrow {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: #fff;
  border-color: #CBD5E1;
  color: var(--text-dark);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

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

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dark);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-draft { background: #F1F5F9; color: #64748B; }
.badge-scheduled { background: #F3E8FF; color: #7C3AED; }
.badge-running { background: #DCFCE7; color: #16A34A; }
.badge-paused { background: #FEF3C7; color: #B45309; }
.badge-completed { background: #DBEAFE; color: #1D4ED8; }
.badge-failed { background: #FEE2E2; color: #DC2626; }
.badge-active { background: #DCFCE7; color: #16A34A; }
.badge-pending { background: #FEF3C7; color: #B45309; }
.badge-verified { background: #DCFCE7; color: #16A34A; }
.badge-archived { background: #F1F5F9; color: #64748B; }
.badge-open { background: #DBEAFE; color: #1D4ED8; }

/* ---------- Cards ---------- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

/* ---------- Flash messages ---------- */

.flash {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
}

.flash-success { background: #F0FDF4; border-color: #BBF7D0; color: #15803D; }
.flash-error { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
.flash-warning { background: #FFFBEB; border-color: #FDE68A; color: #B45309; }

/* ---------- Utilities ---------- */

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

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

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
}
