/* ============================================================
   BaytiCare Tournées — Design « Swiss Transport »
   Marine profond + accent ambre sécurité, Space Grotesk / Inter
   ============================================================ */
:root {
  --bc-blue: #17406F;
  --bc-blue-deep: #0F2C4E;
  --bc-blue-light: #2E7DD1;
  --bc-blue-soft: #EAF1FA;
  --bc-amber: #F2A413;
  --bc-amber-soft: #FDF3DD;
  --bc-grey: #64748B;
  --bc-grey-light: #F2F5F9;
  --bc-border: #E3E9F1;
  --bc-ink: #16233A;
  --bc-success: #1A8A5A;
  --bc-warning: #B7791F;
  --bc-danger: #C0392B;
  --bc-radius: 12px;
  --bc-shadow: 0 1px 2px rgba(15,44,78,.06), 0 4px 14px rgba(15,44,78,.06);
  --bc-shadow-lift: 0 6px 22px rgba(15,44,78,.12);
  --bc-font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --bc-font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--bc-font-body);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(46,125,209,.07), transparent 60%),
    var(--bc-grey-light);
  color: var(--bc-ink);
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--bc-blue-light); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .bc-stat .num { font-family: var(--bc-font-display); letter-spacing: -.01em; }

/* ---------- Layout ---------- */
.bc-shell { display: flex; min-height: 100vh; }

.bc-sidebar {
  width: 252px;
  background: linear-gradient(178deg, var(--bc-blue) 0%, var(--bc-blue-deep) 100%);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.25) transparent;
}
.bc-brand {
  padding: 18px;
  background: #fff;
  border-bottom: 3px solid var(--bc-amber);
}
.bc-brand img { width: 100%; height: auto; max-width: 210px; display: block; }

.bc-nav { list-style: none; padding: 16px 12px; margin: 0; }
.bc-nav li { margin-bottom: 3px; }
.bc-nav a {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px 11px 16px; border-radius: 10px;
  color: rgba(255,255,255,.82); font-weight: 500; font-size: 14.5px;
  transition: background .15s ease, color .15s ease;
}
.bc-nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.bc-nav a.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.bc-nav a.active::before {
  content: ""; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 3.5px;
  border-radius: 4px; background: var(--bc-amber);
}
.bc-nav .icon { width: 20px; text-align: center; opacity: .95; }
.bc-nav-sep { border: 0; border-top: 1px dashed rgba(255,255,255,.18); margin: 14px 16px; }

.bc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bc-topbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bc-border);
  padding: 14px 28px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 900;
}
.bc-topbar h1 {
  font-size: 20px; margin: 0; color: var(--bc-blue); font-weight: 700;
  position: relative; padding-bottom: 3px;
}
/* Signature « ligne de route » sous le titre */
.bc-topbar h1::after {
  content: ""; position: absolute; left: 1px; bottom: -3px; width: 46px; height: 0;
  border-bottom: 2.5px dashed var(--bc-amber); border-radius: 2px;
}
.bc-user { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--bc-grey); }
.bc-content { padding: 28px; flex: 1; }

/* ---------- Mobile nav ---------- */
.bc-burger { display: none; background: none; border: 0; font-size: 24px; color: var(--bc-blue); cursor: pointer; }
.bc-overlay { display: none; }

@media (max-width: 900px) {
  .bc-sidebar {
    position: fixed; z-index: 1200; left: -270px; transition: left .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
  }
  .bc-sidebar.open { left: 0; }
  .bc-burger { display: block; }
  .bc-overlay.show { display: block; position: fixed; inset: 0; background: rgba(15,44,78,.45); z-index: 1100; }
  .bc-content { padding: 16px; }
  .bc-topbar { padding: 12px 16px; }
}

/* ---------- Cards ---------- */
.bc-card {
  background: #fff; border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius); box-shadow: var(--bc-shadow);
  padding: 22px; margin-bottom: 20px;
}
.bc-card h2 { margin: 0 0 14px; font-size: 16.5px; color: var(--bc-blue); font-weight: 700; }
.bc-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.bc-card-head h2 { margin: 0; }

/* ---------- Stats ---------- */
.bc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.bc-stat {
  position: relative;
  background: #fff; border: 1px solid var(--bc-border); border-radius: var(--bc-radius);
  box-shadow: var(--bc-shadow); padding: 20px 20px 20px 24px; display: flex; align-items: center; gap: 16px;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.bc-stat:hover { transform: translateY(-2px); box-shadow: var(--bc-shadow-lift); }
.bc-stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--bc-amber), var(--bc-blue-light));
}
.bc-stat .num { font-size: 30px; font-weight: 700; color: var(--bc-blue); line-height: 1.05; }
.bc-stat .lbl { color: var(--bc-grey); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-top: 3px; }
.bc-stat .ic {
  width: 52px; height: 52px; border-radius: 13px;
  background: linear-gradient(140deg, var(--bc-blue-soft), #fff);
  border: 1px solid var(--bc-border);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  flex-shrink: 0;
}

/* ---------- Tables ---------- */
.bc-table { width: 100%; border-collapse: collapse; }
.bc-table th, .bc-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--bc-border); }
.bc-table th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
  color: var(--bc-blue); background: var(--bc-blue-soft);
}
.bc-table th:first-child { border-radius: 8px 0 0 8px; }
.bc-table th:last-child { border-radius: 0 8px 8px 0; }
.bc-table tbody tr { transition: background .12s ease; }
.bc-table tbody tr:hover { background: var(--bc-amber-soft); }
.bc-table-wrap { overflow-x: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; font-family: var(--bc-font-body);
  text-decoration: none; transition: all .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2.5px solid var(--bc-amber); outline-offset: 2px; }
.btn-primary { background: linear-gradient(180deg, #1D4E86, var(--bc-blue)); color: #fff; box-shadow: 0 2px 6px rgba(23,64,111,.35); }
.btn-primary:hover { background: var(--bc-blue-deep); color: #fff; box-shadow: 0 4px 12px rgba(23,64,111,.4); }
.btn-outline { background: #fff; color: var(--bc-blue); border-color: var(--bc-border); box-shadow: 0 1px 2px rgba(15,44,78,.06); }
.btn-outline:hover { background: var(--bc-blue-soft); border-color: #cddcef; }
.btn-success { background: linear-gradient(180deg, #1E9A66, var(--bc-success)); color: #fff; box-shadow: 0 2px 6px rgba(26,138,90,.35); }
.btn-success:hover { background: #14724A; color: #fff; }
.btn-danger { background: #fff; color: var(--bc-danger); border-color: #F0C4BF; }
.btn-danger:hover { background: #FDECEB; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 13px 22px; font-size: 16px; border-radius: 12px; }

/* ---------- Forms ---------- */
.bc-form-row { margin-bottom: 16px; }
.bc-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .bc-form-grid { grid-template-columns: 1fr; } }
label.bc-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13.5px; color: var(--bc-ink); }
.bc-input, .bc-select, .bc-textarea {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--bc-border); border-radius: 10px;
  font-size: 15px; font-family: var(--bc-font-body); background: #fff; color: var(--bc-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bc-input:focus, .bc-select:focus, .bc-textarea:focus {
  outline: none; border-color: var(--bc-blue-light); box-shadow: 0 0 0 3.5px rgba(46,125,209,.14);
}
.bc-textarea { resize: vertical; min-height: 80px; }
.bc-hint { font-size: 13px; color: var(--bc-grey); margin-top: 5px; }
.bc-form-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
}
.badge-blue  { background: var(--bc-blue-soft); color: var(--bc-blue); }
.badge-grey  { background: #EEF1F5; color: var(--bc-grey); }
.badge-green { background: #E3F5EC; color: var(--bc-success); }
.badge-amber { background: var(--bc-amber-soft); color: #9A6708; }

/* ---------- Flash ---------- */
.bc-flashes { margin-bottom: 18px; }
.alert {
  padding: 13px 16px; border-radius: 11px; margin-bottom: 10px; font-size: 14px;
  border: 1px solid; display: flex; gap: 10px; align-items: flex-start;
}
.alert-success { background: #E8F6EF; border-color: #B7E3CD; color: #14724A; }
.alert-error   { background: #FDECEB; border-color: #F3C2BD; color: #A5281C; }
.alert-warning { background: #FDF6E8; border-color: #F0DCAE; color: #8A5A12; }

/* ---------- Map ---------- */
#map, .bc-map { height: 460px; width: 100%; border-radius: var(--bc-radius); border: 1px solid var(--bc-border); z-index: 1; }
.stop-marker {
  background: var(--bc-blue); color: #fff; border-radius: 50%; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
  border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.stop-marker.school { background: var(--bc-danger); }
.stop-marker.start { background: var(--bc-success); }

/* ---------- Route list ---------- */
.route-list { list-style: none; padding: 0; margin: 0; }
.route-item {
  position: relative;
  display: flex; gap: 14px; padding: 14px 0 14px 2px; border-bottom: 1px solid var(--bc-border);
}
.route-item:last-child { border-bottom: 0; }
/* Fil de route en pointillé reliant les étapes */
.route-item::before {
  content: ""; position: absolute; left: 18px; top: 48px; bottom: -2px; width: 0;
  border-left: 2px dashed #C9D6E6;
}
.route-item:last-child::before { display: none; }
.route-num {
  position: relative; z-index: 1;
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--bc-blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  font-family: var(--bc-font-display);
  border: 2.5px solid #fff; box-shadow: 0 0 0 1.5px var(--bc-border), 0 2px 5px rgba(15,44,78,.18);
}
.route-num.school { background: var(--bc-danger); }
.route-num.start { background: var(--bc-success); }
.route-body { flex: 1; min-width: 0; }
.route-body .name { font-weight: 600; }
.route-body .addr { color: var(--bc-grey); font-size: 14px; }
.route-meta { text-align: right; font-size: 13px; color: var(--bc-grey); white-space: nowrap; }

/* ---------- Children selector ---------- */
.child-picker { max-height: 340px; overflow-y: auto; border: 1.5px solid var(--bc-border); border-radius: 11px; padding: 6px; }
.child-option { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; transition: background .12s ease; }
.child-option:hover { background: var(--bc-blue-soft); }
.child-option input { width: 18px; height: 18px; accent-color: var(--bc-blue); }
.child-option .meta { font-size: 13px; color: var(--bc-grey); }

.empty-state { text-align: center; padding: 44px 20px; color: var(--bc-grey); }
.empty-state .big { font-size: 44px; margin-bottom: 10px; }

.text-muted { color: var(--bc-grey); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex-between { display:flex; justify-content: space-between; align-items:center; gap: 12px; flex-wrap: wrap; }
.gap-8 { gap: 8px; } .d-flex { display:flex; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
