* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: #f5f6f8;
  color: #1c1f26;
}
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #14213d;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand { font-weight: 700; font-size: 1.1rem; padding: 20px; }
.sidebar nav { display: flex; flex-direction: column; flex: 1; padding: 8px 0; }
.sidebar nav a {
  color: #d8dee9; text-decoration: none; font-size: 0.95rem; padding: 10px 20px;
}
.sidebar nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.sidebar .account {
  display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem;
  padding: 16px 20px; border-top: 1px solid #2a3a63;
}
.sidebar .account form { margin: 0; }
.sidebar .account button {
  width: 100%; background: none; border: 1px solid #495a80; color: #d8dee9; padding: 6px 10px;
  border-radius: 4px; cursor: pointer;
}
.container { flex: 1; max-width: 1000px; margin: 0; padding: 24px 32px; }
h1 { margin-top: 0; }
.card {
  background: #fff; border: 1px solid #e2e5ea; border-radius: 8px; padding: 20px; margin-bottom: 16px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat { font-size: 2rem; font-weight: 700; margin: 4px 0; }
.stat-label { color: #6b7280; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e2e5ea; font-size: 0.92rem; }
th { color: #6b7280; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.03em; }
tr:hover { background: #fafbfc; }
a.button, button.button, button[type="submit"] {
  display: inline-block; background: #14213d; color: #fff; border: none; padding: 9px 16px;
  border-radius: 6px; cursor: pointer; text-decoration: none; font-size: 0.9rem;
}
a.button:hover, button[type="submit"]:hover { background: #1e2f5c; }
.row-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
form.stacked label { display: block; margin: 12px 0 4px; font-size: 0.88rem; color: #374151; font-weight: 600; }
form.stacked input, form.stacked select, form.stacked textarea {
  width: 100%; padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.92rem; font-family: inherit;
}
input#driver-search {
  width: 100%; padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.92rem; font-family: inherit;
}
.error { background: #fdecec; color: #a12525; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9rem; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge.operational, .badge.done, .badge.active { background: #dcf5e3; color: #1a7a3d; }
.badge.inactive { background: #eceff1; color: #5a6570; }
.badge.offboarded { background: #f3d9d9; color: #7a2323; }
.badge.grounded, .badge.todo { background: #fdecec; color: #a12525; }
.badge.maintenance, .badge.in_progress { background: #fff4d6; color: #92660b; }
.badge.fantastic_plus { background: #d7ecff; color: #0b5aa8; }
.badge.fantastic { background: #dcf5e3; color: #1a7a3d; }
.badge.great { background: #eaf6e3; color: #3f8a2b; }
.badge.fair { background: #fff4d6; color: #92660b; }
.badge.poor, .badge.at_risk { background: #fdecec; color: #a12525; }
.badge.platinum { background: #e9e6f7; color: #4b3f9e; }
.badge.gold { background: #fdf1cf; color: #8a6a0b; }
.badge.silver { background: #eceff1; color: #47555c; }
.badge.bronze { background: #f3e2d3; color: #8a4b1f; }
.login-wrap { max-width: 380px; margin: 80px auto; }
.status-form { display: flex; gap: 8px; align-items: center; }
.status-form select { padding: 4px 6px; }

.switch-row { display: flex; align-items: center; gap: 10px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #cfd4db; border-radius: 22px; transition: background 0.15s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.15s;
}
.switch input:checked + .slider { background: #1a7a3d; }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch-label { font-size: 0.9rem; }
.muted { color: #6b7280; font-size: 0.88rem; }
.announcement { border-bottom: 1px solid #e2e5ea; padding: 16px 0; }
.announcement:last-child { border-bottom: none; }
.announcement h3 { margin: 0 0 4px; }
