/* ════════════════════════════════════════════════════════════════════════
   BERGENIA HEALTHCARE — design system ("Clinical Modern")
   Clean healthcare SaaS: white cards on a soft neutral ground, deep teal
   primary, amber for attention states, Inter throughout, crisp borders,
   restrained shadows. Large touch targets and AA contrast preserved.

   NOTE: custom-property names are kept from the previous theme (--pine,
   --ochre, --linen…) so every consumer (admin.css, driver.html, JS) keeps
   working — only their values changed.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  --linen: #f4f7f6;        /* page background */
  --linen-2: #e9efed;      /* subtle fill */
  --card: #ffffff;
  --ink: #15211d;
  --ink-soft: #54655f;
  --ink-faint: #8aa099;
  --pine: #0e6b5a;         /* primary */
  --pine-deep: #0a4f43;    /* primary, darker */
  --pine-soft: #e2f0ec;    /* primary tint */
  --sage: #bad6cd;         /* soft accent line/border */
  --ochre: #a96f12;        /* attention / pending */
  --ochre-deep: #855708;
  --clay: #b23c2e;         /* errors / destructive */
  --plum: #44557e;         /* secondary pin (drop-off) */
  --hairline: rgba(21, 33, 29, 0.12);
  --border: #dce4e1;
  --serif: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;   /* body (legacy name) */
  --display: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif; /* headings (legacy name) */
  --shadow-sm: 0 1px 2px rgba(13, 32, 27, 0.05);
  --shadow-md: 0 1px 3px rgba(13, 32, 27, 0.06), 0 8px 24px rgba(13, 32, 27, 0.07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 100% -8%, rgba(14, 107, 90, 0.07), transparent 60%),
    radial-gradient(820px 520px at -8% 4%, rgba(68, 85, 126, 0.05), transparent 55%),
    var(--linen);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv05' 1, 'ss01' 1;
}

::selection { background: var(--pine); color: #fff; }

a { color: var(--pine); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--pine-deep); }

:focus-visible { outline: 2.5px solid var(--pine); outline-offset: 2px; border-radius: 4px; }

/* ── Masthead (booking page top bar) ── */
.masthead {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 6px 20px -16px rgba(13, 32, 27, 0.5);
}
.masthead::after {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--pine), var(--plum) 65%, transparent);
  opacity: 0.85;
}
.brand-mark {
  border-radius: 13px;
}
.masthead-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(160deg, var(--pine), var(--pine-deep));
  color: #fff;
  flex: none;
  box-shadow: var(--shadow-sm);
}
.brand-mark svg { display: block; }
.kicker {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--pine);
  margin: 0;
}
.brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 750;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.brand-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 1px;
}
.masthead-tag {
  font-size: 13.5px;
  color: var(--ink-soft);
  text-align: right;
}

.page { max-width: 1240px; margin: 0 auto; padding: 28px 20px 64px; }

.section-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.section-title h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.section-title::after { content: ''; flex: 1; border-top: 1px solid var(--hairline); transform: translateY(-4px); }

.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.italic { font-style: normal; } /* legacy hook — italics retired with the serif theme */

/* ── Panels ── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 1px 2px rgba(13, 32, 27, 0.04), 0 14px 36px -16px rgba(13, 32, 27, 0.16);
}
.panel + .panel { margin-top: 16px; }

/* ── Forms ── */
.label {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #25332e;
  margin: 0 0 6px;
}
input[type='text'], input[type='tel'], input[type='password'], input[type='search'],
input[type='datetime-local'], input[type='date'], input[type='time'], input[type='number'],
select, textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  background: #ffffff;
  border: 1.5px solid #94a8a1;
  border-radius: 11px;
  padding: 12px 14px;
  min-height: 46px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
input:hover, select:hover, textarea:hover { border-color: #6f857e; }
input:focus, select:focus, textarea:focus {
  border-color: var(--pine);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(14, 107, 90, 0.18);
}
input::placeholder, textarea::placeholder { color: #76877f; }
textarea { resize: vertical; min-height: 72px; }
.field { margin-bottom: 15px; position: relative; }
.field-row { display: flex; gap: 13px; }
.field-row .field { flex: 1; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: #fff;
  background: linear-gradient(180deg, #11816d, var(--pine));
  border: 1px solid var(--pine-deep);
  border-radius: 12px;
  padding: 12px 22px;
  min-height: 46px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
  box-shadow: 0 1px 2px rgba(10, 79, 67, 0.22), 0 6px 16px -8px rgba(10, 79, 67, 0.4);
}
.btn:hover {
  background: linear-gradient(180deg, var(--pine), var(--pine-deep));
  box-shadow: 0 2px 4px rgba(10, 79, 67, 0.25), 0 10px 22px -8px rgba(10, 79, 67, 0.5);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(10, 79, 67, 0.25); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 6px 13px; font-size: 13px; min-height: 0; border-radius: 8px; }
.btn-ghost {
  background: transparent;
  color: var(--pine);
  border: 1px solid #b9c9c4;
  box-shadow: none;
}
.btn-ghost:hover { background: var(--pine-soft); border-color: var(--pine); box-shadow: none; }
.btn-danger { color: var(--clay); }
.btn-danger:hover { background: var(--clay); border-color: var(--clay); color: #fff; }

/* ── Badges ── */
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-assigned, .badge-sent { color: var(--pine-deep); background: var(--pine-soft); border: 1px solid rgba(14, 107, 90, 0.35); }
.badge-pending, .badge-outbox { color: var(--ochre-deep); background: #fbf3e2; border: 1px solid rgba(169, 111, 18, 0.4); }
.badge-completed { color: var(--ink-soft); background: var(--linen-2); border: 1px solid var(--border); }
.badge-cancelled, .badge-failed { color: #fff; background: var(--clay); border: 1px solid var(--clay); }
.badge-wav { color: var(--plum); background: #eceff7; border: 1px solid #c4cde2; }

/* ── Vehicle status (Fleet, #2/#8) ── */
.badge-vehicle-active { color: var(--pine-deep); background: var(--pine-soft); border: 1px solid rgba(14, 107, 90, 0.35); }
.badge-vehicle-servicing { color: var(--ochre-deep); background: #fbf3e2; border: 1px solid rgba(169, 111, 18, 0.4); }
.badge-vehicle-out_of_service { color: #fff; background: var(--clay); border: 1px solid var(--clay); }

/* ── Tables ── */
table.sheet { width: 100%; border-collapse: collapse; font-size: 14px; }
table.sheet th {
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border-bottom: 1.5px solid var(--ink);
  padding: 8px;
}
table.sheet td { border-bottom: 1px solid var(--hairline); padding: 11px 8px; vertical-align: top; }
table.sheet tr:hover td { background: #f2f6f5; }

/* ── Notices ── */
.notice {
  border: 1px solid var(--border);
  border-left: 4px solid var(--pine);
  border-radius: 10px;
  background: var(--card);
  padding: 12px 16px;
  font-size: 14px;
  margin: 12px 0;
}
.notice-error { border-left-color: var(--clay); color: var(--clay); background: #fdf5f4; border-color: #ecd2cd; }

/* ── Map & pins ── */
.map-frame {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
  background: var(--linen-2);
}
.leaflet-container { font-family: var(--serif) !important; font-size: 12px; }
.leaflet-control-zoom a { color: var(--ink) !important; }

.pin {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13.5px;
  background: var(--pine);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(13, 32, 27, 0.35);
  animation: pinDrop 0.4s cubic-bezier(0.25, 1.4, 0.5, 1) both;
}
.pin-b { background: var(--plum); }
.pin-base { background: #fff; color: var(--pine-deep); border-color: var(--pine); font-size: 10.5px; }

/* ── Footer ── */
.footer {
  max-width: 1240px;
  margin: 28px auto 0;
  padding: 18px 20px 36px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ── Motion (subtle, and off for those who prefer it) ── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pinDrop { from { opacity: 0; transform: translateY(-10px) scale(0.7); } }
@keyframes drawRing { from { stroke-dashoffset: 160; } }
@keyframes drawCheck { from { stroke-dashoffset: 60; } }

.reveal { animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.d1 { animation-delay: 0.06s; }
.d2 { animation-delay: 0.12s; }
.d3 { animation-delay: 0.18s; }
.d4 { animation-delay: 0.24s; }

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

/* ── Main menu (dashboard.html) ─────────────────────────────────────────────
   Built for older readers: type well above the 15.5px site default, high
   contrast, very large tap targets, and no motion. The first choice is a solid
   filled card so there is one obvious place to start. Cards are plain <a>s, so
   the page works with no JavaScript. */
.menu-page { max-width: 660px; }

.menu-head { text-align: center; margin: 8px 0 4px; }
.menu-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(27px, 4.4vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.menu-head p {
  margin: 10px 0 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.menu-grid { display: flex; flex-direction: column; gap: 16px; margin-top: 26px; }

.menu-card {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 108px;
  padding: 24px 26px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.menu-card:hover { border-color: var(--pine); box-shadow: var(--shadow-md); }
.menu-card:focus-visible { outline: 3px solid var(--pine); outline-offset: 3px; }
.menu-card:active { background: var(--linen-2); }

/* The primary choice. Filled, so there is no doubt where to begin. */
.menu-card-main {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
}
.menu-card-main:hover { background: var(--pine-deep); border-color: var(--pine-deep); }
.menu-card-main:active { background: var(--pine-deep); }

.menu-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--pine-soft);
  color: var(--pine-deep);
}
.menu-icon svg { width: 31px; height: 31px; }
.menu-card-main .menu-icon { background: rgba(255, 255, 255, 0.18); color: #fff; }

.menu-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.menu-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.menu-desc { font-size: 17px; line-height: 1.55; color: var(--ink-soft); }
.menu-card-main .menu-title { color: #fff; }
.menu-card-main .menu-desc { color: rgba(255, 255, 255, 0.93); }

.menu-go {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  margin-left: auto;
  color: var(--pine);
}
.menu-go svg { width: 28px; height: 28px; }
.menu-card-main .menu-go { color: #fff; }

.menu-note {
  text-align: center;
  margin: 30px auto 0;
  max-width: 38ch;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.menu-note strong { color: var(--ink); font-weight: 700; }

@media (max-width: 760px) {
  .field-row { flex-direction: column; gap: 0; }
  .footer { flex-direction: column; }
  .masthead-tag { display: none; }

  .menu-card { gap: 16px; padding: 20px; min-height: 96px; }
  .menu-icon { width: 52px; height: 52px; }
  .menu-icon svg { width: 27px; height: 27px; }
  .menu-title { font-size: 19.5px; }
  .menu-desc { font-size: 16px; }
  .menu-go { display: none; } /* the whole card is the target on a phone */
}
