/* ==========================================================
   DESIGN TOKENS — LIGHT THEME (AT HOME DRIVING SCHOOL)
   Blue + Red brand to match logo
   ========================================================== */
:root {
  /* Surfaces */
  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;

  /* Text */
  --text: #0d101a;
  --text-dim: #68738b;

  /* Borders */
  --border: #e3e6ef;

  /* Brand accents (blue + red) */
  --accent: #1f4eff;          /* Primary blue (logo right)  */
  --accent-2: #e03333;        /* Primary red (logo left)    */
  --accent-ink: #0a1c5a;      /* Deep navy for contrast     */

  /* Visual effects */
  --ring: rgba(31, 78, 255, 0.35);
  --shadow-1: 0 2px 14px rgba(0,0,0,0.06);
  --shadow-2: 0 18px 36px rgba(0,0,0,0.12);

  /* Shapes */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 26px;

  --space: clamp(14px, 2.4vw, 20px);

  /* Typography */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  --mono: ui-monospace, Menlo, Consolas, monospace;

  color-scheme: light;
}

/* ==========================================================
   DARK THEME OVERRIDES — harmonized blue + red
   ========================================================== */
html[data-theme="dark"] {
  --bg: #05070e;
  --bg-elev: #111522;
  --bg-card: #171b2c;

  --text: #e6ebff;
  --text-dim: #9aa6c6;

  --border: #232a3c;

  --accent: #4b6cff;          /* Softer blue in dark */
  --accent-2: #ff5757;        /* Softer red in dark  */
  --accent-ink: #cfd8ff;

  --shadow-1: 0 2px 20px rgba(0,0,0,0.45);
  --shadow-2: 0 28px 48px rgba(0,0,0,0.55);

  color-scheme: dark;
}

/* ==========================================================
   GLOBAL RESET
   ========================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .25s ease, color .25s ease;
}

/* Remove default button/input styles for consistency */
button,
input,
textarea,
select {
  font: inherit;
}

/* ==========================================================
   LAYOUT HELPERS
   ========================================================== */
.container {
  max-width: 1100px;
  margin-inline: auto;
  padding: var(--space);
}

.row {
  display: flex;
  align-items: center;
}

.col {
  display: flex;
  flex-direction: column;
}

.row.wrap {
  flex-wrap: wrap;
}

/* ==========================================================
   HEADER
   ========================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px var(--space);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow:
    0 0 10px rgba(31,78,255,0.4),
    0 0 18px rgba(224,51,51,0.4);
}

/* Simple circular theme toggle to sit next to logo/buttons */
.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 60%),
    linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), var(--shadow-1);
  cursor: pointer;
}

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
}

/* Little glow class used in some footers */
.glow {
  color: var(--accent);
  font-weight: 600;
}

/* ==========================================================
   CARDS
   ========================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.card-gradient {
  background:
    radial-gradient(
      800px 500px at 10% -10%,
      rgba(31,78,255,0.16),
      transparent 60%
    ),
    radial-gradient(
      800px 500px at 90% -10%,
      rgba(224,51,51,0.14),
      transparent 60%
    ),
    var(--bg-card);
}

.pad {
  padding: var(--space);
}

/* Pills (used across dashboards) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.85);
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition:
    background .25s,
    box-shadow .25s,
    transform .12s,
    border-color .2s;
}

.btn:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--bg-card) 82%, var(--accent) 18%);
}

.btn:disabled {
  opacity: .5;
  cursor: default;
  transform: none;
}

/* Primary = blue */
.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* Danger = red */
.btn.danger {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}

.btn.danger:hover:not(:disabled) {
  filter: brightness(1.08);
}

/* Ghost / subtle button */
.btn.ghost {
  background: transparent;
  border-color: var(--border);
}

/* ==========================================================
   INPUTS
   ========================================================== */
input,
textarea,
select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border .2s, box-shadow .2s, background .2s;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

/* ==========================================================
   TABLES
   ========================================================== */
.table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: linear-gradient(
    90deg,
    rgba(224,51,51,0.06),
    rgba(31,78,255,0.06)
  );
  color: var(--text-dim);
  font-weight: 700;
}

.table tr:last-child td {
  border-bottom: none;
}

/* ==========================================================
   UTILITIES
   ========================================================== */
.muted { color: var(--text-dim); }
.center { text-align: center; }
.hidden { display: none !important; }

.round { border-radius: var(--radius); }
.shadow { box-shadow: var(--shadow-1); }
.w-100 { width: 100%; }

.spaced { margin-top: var(--space); }

/* Simple badge for statuses */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(31,78,255,0.12);
  color: var(--accent-ink);
}

/* ==========================================================
   SCROLLBAR
   ========================================================== */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(31,78,255,0.4) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(31,78,255,0.4);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-track {
  background: transparent;
}
