/* FleetDesk — rental CRM. Dense, quiet, built for all-day use. */

:root {
  --ink:        #12161D;
  --ink-2:      #38414F;
  --muted:      #6B7686;
  --line:       #E4E7EC;
  --line-soft:  #EEF0F4;
  --bg:         #F5F6F8;
  --surface:    #FFFFFF;
  --surface-2:  #FAFBFC;

  --brand:      #0E7C66;
  --brand-ink:  #0A5C4C;
  --brand-soft: #E7F5F1;

  --blue:       #2563EB;  --blue-soft:  #E8EFFE;
  --green:      #12855F;  --green-soft: #E3F6EE;
  --amber:      #B45309;  --amber-soft: #FDF0DC;
  --red:        #C8322B;  --red-soft:   #FCE9E8;
  --violet:     #6D3FD1;  --violet-soft:#EFE9FD;
  --slate:      #5A6473;  --slate-soft: #EDEFF3;

  --radius:     10px;
  --radius-sm:  7px;
  --shadow:     0 1px 2px rgba(16,22,32,.06), 0 6px 20px -8px rgba(16,22,32,.12);
  --shadow-lg:  0 24px 60px -20px rgba(16,22,32,.35);
  --sidebar-w:  228px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; font-weight: 620; letter-spacing: -.011em; }
p { margin: 0; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }

/* ------------------------------------------------------------- boot / auth */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; gap: 14px;
  justify-items: center; color: var(--muted); background: var(--bg); z-index: 50;
}
.boot__spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .boot__spinner { animation-duration: 2.4s; } }

.auth {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 20% -10%, #E9F3F0 0%, var(--bg) 60%);
  z-index: 40; overflow: auto;
}
.auth__panel {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); padding: 28px;
}
.auth__brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.auth__brand strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.auth__brand span { display: block; font-size: 12px; color: var(--muted); }
.auth__title { font-size: 20px; margin-bottom: 4px; }
.auth__hint { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.auth__form { display: grid; gap: 14px; }
.auth__error {
  font-size: 13px; color: var(--red); background: var(--red-soft);
  padding: 9px 11px; border-radius: var(--radius-sm);
}

/* -------------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  display: flex; flex-direction: column; gap: 8px;
  background: #14181F; color: #C9D1DC; position: sticky; top: 0; height: 100vh;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px;
  font-weight: 640; color: #fff; letter-spacing: -.01em;
}
.sidebar__brand a { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.sidebar__brand a:hover { opacity: .85; text-decoration: none; }
/* The chooser screen is full-bleed: no sidebar, no topbar. */
.app.is-chooser .sidebar, .app.is-chooser .topbar { display: none; }
.app.is-chooser { grid-template-columns: 1fr; }
.sidebar__close { display: none; margin-left: auto; background: none; border: 0; color: #8D97A5; font-size: 24px; line-height: 1; cursor: pointer; }
/* align-content:start — otherwise a short menu stretches its rows to fill the column. */
.nav { display: grid; gap: 2px; padding: 0 10px; overflow-y: auto; flex: 1; align-content: start; }
.nav__item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: #B7C0CD; font-size: 13.5px; font-weight: 500; cursor: pointer;
  background: none; border: 0; width: 100%; text-align: left;
}
.nav__item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav__item.is-active { background: rgba(255,255,255,.1); color: #fff; }
.nav__item svg { flex: none; opacity: .85; }
.nav__badge {
  margin-left: auto; font-size: 11px; font-weight: 650; padding: 1px 6px;
  border-radius: 999px; background: var(--red); color: #fff;
}
.nav__group { padding: 14px 12px 5px; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: #6E7A8A; }
.sidebar__foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); display: grid; gap: 9px; }
.who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.who__avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 650; flex: none;
}
.who__meta { min-width: 0; }
.who__meta strong { display: block; font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who__meta small { display: block; font-size: 11px; color: #8D97A5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; background: rgba(245,246,248,.86); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__menu { display: none; }
.topbar__actions { margin-left: auto; display: flex; gap: 8px; }
.search { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; }
.search svg { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; padding: 8px 12px 8px 33px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); font-size: 13.5px;
}
.search input::placeholder { color: #98A2B2; }
.search__results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); max-height: 60vh; overflow: auto; padding: 6px;
}
.search__group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 4px; }
.search__row {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: pointer;
}
.search__row:hover, .search__row.is-active { background: var(--brand-soft); }
.search__row small { color: var(--muted); margin-left: auto; }

.view { padding: 22px 20px 60px; flex: 1; min-width: 0; }
.view:focus { outline: none; }

/* ------------------------------------------------------------------ headers */
.page-head {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 550;
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); border-color: #D5D9E0; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--primary:hover { background: #0B0F15; border-color: #0B0F15; }
.btn--brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--brand:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn--danger { color: var(--red); border-color: #F0C7C5; background: #fff; }
.btn--danger:hover { background: var(--red-soft); }
.btn--ghost { background: transparent; border-color: transparent; color: inherit; }
.btn--ghost:hover { background: rgba(255,255,255,.08); border-color: transparent; }
.btn--sm { padding: 6px 11px; font-size: 12.5px; }
.btn--block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); }

/* -------------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card__head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
}
.card__head h2, .card__head h3 { font-size: 14px; }
.card__head .btn { margin-left: auto; }
.card__body { padding: 16px; }
.card__body--flush { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
/* minmax(0,1fr), not 1fr: a plain 1fr track refuses to shrink below the
   min-content width of a wide table and pushes the page sideways. */
@media (max-width: 980px) { .split { grid-template-columns: minmax(0, 1fr); } }
.split > *, .grid > *, .stack > * { min-width: 0; }
.stack, .card { min-width: 0; }

/* ---------------------------------------------------------------- KPI tiles */
.kpi { padding: 14px 16px; display: grid; gap: 3px; }
.kpi__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.kpi__value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi__hint { font-size: 12px; color: var(--muted); }
.kpi--alert .kpi__value { color: var(--red); }
.kpi--good .kpi__value { color: var(--green); }
.bar { height: 6px; border-radius: 99px; background: var(--line-soft); overflow: hidden; margin-top: 6px; }
.bar__fill { height: 100%; background: var(--brand); border-radius: 99px; }

/* ------------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 640; padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--brand-soft); }
table.data td.right, table.data th.right { text-align: right; }
.cell-title { font-weight: 570; }
.cell-sub { color: var(--muted); font-size: 12.2px; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* -------------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2.5px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 620; letter-spacing: .01em; white-space: nowrap;
  background: var(--slate-soft); color: var(--slate);
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill--free, .pill--completed, .pill--good { background: var(--green-soft); color: var(--green); }
.pill--rented, .pill--active, .pill--info { background: var(--blue-soft); color: var(--blue); }
.pill--reserved { background: var(--violet-soft); color: var(--violet); }
.pill--overdue, .pill--danger, .pill--blacklisted { background: var(--red-soft); color: var(--red); }
.pill--maintenance, .pill--warn { background: var(--amber-soft); color: var(--amber); }
.pill--plain::before { display: none; }
.badge-company {
  display: inline-block; padding: 1.5px 7px; border-radius: 5px; font-size: 11.5px;
  background: var(--slate-soft); color: var(--ink-2); font-weight: 550;
}

/* -------------------------------------------------------------------- forms */
/* align-content:start stops inputs stretching when a neighbouring field in the
   same grid row has longer help text. */
.field { display: grid; gap: 5px; min-width: 0; align-content: start; }
.field__label { font-size: 12.2px; font-weight: 570; color: var(--ink-2); }
.field__help { font-size: 11.8px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); font-size: 14px; /* 16px on mobile handled below */
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #D5D9E0; }
.field textarea { min-height: 76px; resize: vertical; }
.field--error input, .field--error select { border-color: var(--red); }
.form-grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 560px) { .form-grid .span-2 { grid-column: span 1; } }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 13px; }
legend {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  font-weight: 640; padding: 0; margin-bottom: 2px;
}
.filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px;
}
.filters input, .filters select {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; cursor: pointer; font-weight: 550; color: var(--ink-2);
}
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ------------------------------------------------------------------ picker */
.picker { position: relative; }
.picker input { width: 100%; padding: 8px 30px 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14px; }
.picker__clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px;
  border: 0; background: var(--line-soft); border-radius: 50%; cursor: pointer; color: var(--ink-2);
  line-height: 1; font-size: 15px; display: grid; place-items: center;
}
.picker__list {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; max-height: 260px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 5px;
}
.picker__item {
  display: flex; align-items: baseline; gap: 8px; padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 13.5px;
}
.picker__item small { color: var(--muted); margin-left: auto; font-size: 12px; white-space: nowrap; }
.picker__item:hover, .picker__item.is-active { background: var(--brand-soft); }
.picker__item.is-disabled { opacity: .45; cursor: not-allowed; }
.picker__empty { padding: 12px 9px; color: var(--muted); font-size: 13px; text-align: center; }
.picker__create {
  padding: 8px 9px; border-top: 1px solid var(--line-soft); margin-top: 4px; cursor: pointer;
  color: var(--brand-ink); font-weight: 570; font-size: 13.5px; border-radius: 6px;
}
.picker__create:hover { background: var(--brand-soft); }
@media (max-width: 900px) { .picker input { font-size: 16px; } }

/* --------------------------------------------------------- module switcher */
.switcher { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; margin: 0 12px 6px; background: rgba(255,255,255,.07); border-radius: 9px; }
.switcher button {
  border: 0; background: none; color: #97A1AF; font-size: 12.5px; font-weight: 600; padding: 6px 4px;
  border-radius: 7px; cursor: pointer;
}
.switcher button.is-on { background: var(--surface); color: var(--ink); }

.chooser { display: grid; place-items: center; min-height: 70vh; padding: 20px; }
.chooser__inner { width: min(720px, 100%); }
.chooser__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 20px; }
.chooser__card {
  text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; cursor: pointer; box-shadow: var(--shadow); display: grid; gap: 8px;
  transition: transform .12s, box-shadow .12s;
}
.chooser__card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.chooser__card h2 { font-size: 17px; }
.chooser__card p { color: var(--muted); font-size: 13.5px; }
.chooser__icon { width: 40px; height: 40px; border-radius: 11px; background: var(--ink); display: grid; place-items: center; color: #fff; }

/* ------------------------------------------------------------- detail lists */
.dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 16px; font-size: 13.5px; }
.dl dt { color: var(--muted); font-size: 12.5px; }
.dl dd { margin: 0; }
.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.sep { height: 1px; background: var(--line-soft); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab {
  padding: 9px 13px; border: 0; background: none; cursor: pointer; font-size: 13.5px;
  font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab.is-on { color: var(--ink); border-bottom-color: var(--ink); }

/* --------------------------------------------------------------- timeline */
.timeline { --day-w: 40px; overflow-x: auto; border-radius: var(--radius); }
.tl-grid { min-width: max-content; }
.tl-row { display: grid; grid-template-columns: 230px 1fr; align-items: stretch; border-bottom: 1px solid var(--line-soft); }
.tl-row:last-child { border-bottom: 0; }
.tl-head { position: sticky; top: 0; z-index: 3; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.tl-veh {
  position: sticky; left: 0; z-index: 2; background: var(--surface); padding: 9px 12px;
  border-right: 1px solid var(--line); min-width: 230px;
}
.tl-head .tl-veh { background: var(--surface-2); }
.tl-days { display: grid; position: relative; }
.tl-day {
  border-right: 1px solid var(--line-soft); font-size: 10.5px; color: var(--muted);
  text-align: center; padding: 6px 0; min-width: var(--day-w);
}
.tl-day.is-weekend { background: #FAFAFB; }
.tl-day.is-today { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
.tl-lane { position: relative; height: 42px; }
.tl-lane .tl-day { height: 100%; padding: 0; }
.tl-bar {
  position: absolute; top: 7px; bottom: 7px; border-radius: 6px; padding: 0 8px;
  display: flex; align-items: center; font-size: 11.5px; font-weight: 570; color: #fff;
  overflow: hidden; white-space: nowrap; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.tl-bar--rental { background: #3B72F0; }
.tl-bar--reserved { background: #7C55DE; }
.tl-bar--overdue { background: var(--red); }
.tl-bar--block { background: #98A2B2; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.16) 0 6px, transparent 6px 12px); }
.tl-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.tl-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }

/* --------------------------------------------------------------- swap chain */
.chain { display: grid; gap: 0; }
.chain__item { display: grid; grid-template-columns: 22px 1fr; gap: 12px; }
.chain__rail { display: grid; justify-items: center; }
.chain__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: none; }
.chain__dot--past { background: var(--line); border: 2px solid #C9CFD8; }
.chain__line { width: 2px; flex: 1; background: var(--line); min-height: 14px; }
.chain__body { padding-bottom: 14px; }
.chain__title { font-weight: 570; }
.chain__meta { font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------ modal / toast */
.modal-root:empty { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,20,28,.42); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px; z-index: 60; overflow: auto;
}
.modal {
  width: min(640px, 100%); background: var(--surface); border-radius: 14px;
  box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  animation: pop .14s ease-out;
}
.modal--wide { width: min(880px, 100%); }
@keyframes pop { from { transform: translateY(6px) scale(.99); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.modal__head h2 { font-size: 15.5px; }
.modal__close { margin-left: auto; }
.modal__body { padding: 18px; overflow: auto; display: grid; gap: 14px; }
.modal__foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line-soft); }
.modal__error { font-size: 13px; color: var(--red); background: var(--red-soft); padding: 9px 11px; border-radius: var(--radius-sm); }

.toasts { position: fixed; bottom: 18px; right: 18px; display: grid; gap: 8px; z-index: 90; }
.toast {
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 9px; font-size: 13.5px;
  box-shadow: var(--shadow-lg); max-width: 380px; animation: slide .16s ease-out;
}
.toast--error { background: var(--red); }
.toast--ok { background: var(--green); }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } }

.callout {
  padding: 11px 13px; border-radius: var(--radius-sm); font-size: 13px;
  background: var(--amber-soft); color: #7C3A06; border: 1px solid #F3DDBB;
}
.callout--danger { background: var(--red-soft); color: #8C201B; border-color: #F2C9C7; }
.callout--info { background: var(--brand-soft); color: var(--brand-ink); border-color: #C9E7DF; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 70;
    transform: translateX(-100%); transition: transform .18s ease-out;
  }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar__close { display: block; }
  .topbar__menu { display: inline-grid; }
  .view { padding: 16px 14px 60px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .filters input, .filters select { font-size: 16px; }
  .toasts { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; }
  /* Scrolling a compact table sideways beats tall wrapped rows on a phone. */
  table.data td, table.data th { white-space: nowrap; padding: 10px 12px; }
  table.data .cell-sub { font-size: 11.5px; }
  .page-head h1 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ------------------------------------------------------- printed agreement */
#print-area { display: none; }

@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; padding: 0; color: #000; font-size: 12pt; }
  #print-area h1 { font-size: 19pt; margin: 0; }
  #print-area h2 {
    font-size: 11pt; text-transform: uppercase; letter-spacing: .08em;
    margin: 18pt 0 6pt; border-bottom: 1px solid #000; padding-bottom: 3pt;
  }
  #print-area p { font-size: 10.5pt; }
  .print-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 10pt; }
  .print-head p { color: #444; margin-top: 2pt; }
  .print-ref { text-align: right; font-size: 11pt; }
  .print-table { width: 100%; border-collapse: collapse; }
  .print-table th {
    text-align: left; font-weight: 600; width: 34%; padding: 4pt 0; vertical-align: top;
    color: #333; font-size: 10.5pt;
  }
  .print-table td { padding: 4pt 0; font-size: 11pt; }
  .print-sign { display: flex; gap: 40pt; margin-top: 40pt; font-size: 10pt; }
  .print-sign > div { flex: 1; }
  .print-line { border-bottom: 1px solid #000; height: 34pt; margin-bottom: 4pt; }
  .print-foot { margin-top: 24pt; font-size: 9.5pt; color: #333; }
  @page { margin: 16mm; }
}
