/* ATRA Transport Panel — navy and teal, built for glanceability on a workshop
   screen or a phone in a cab. Urgency is carried by a left rule and a label,
   never by colour alone. */

:root {
  --ink: #0d2b31;
  --ink-soft: #5a6f74;
  --paper: #f6f8f8;
  --card: #ffffff;
  --line: #dde5e5;
  --navy: #12343b;
  --teal: #0f6c72;
  --teal-soft: #e3f0f0;
  --overdue: #a4262c;
  --critical: #9a5b00;
  --steady: #2c6e49;
  --radius-lg: 14px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--teal); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* ---------- Shell ---------- */

.masthead {
  background: var(--navy);
  color: #eef5f5;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.masthead__brand {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-decoration: none;
}
.masthead__brand span { color: #6fc3c9; font-weight: 400; }
.masthead nav { display: flex; gap: 20px; flex-wrap: wrap; }
.masthead nav a {
  color: #cfe4e5;
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}
.masthead nav a:hover { color: #ffffff; }
.masthead nav a[aria-current="page"] { color: #ffffff; border-bottom-color: #6fc3c9; }
.masthead__user { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; }
.masthead__user a { color: #cfe4e5; }
.masthead__team { color: #9fc3c5; font-size: 13px; }

.page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 72px; }
.page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page__head h1 { margin: 0; font-size: 27px; font-weight: 600; }
.page__head p { margin: 4px 0 0; color: var(--ink-soft); }

/* ---------- Cards and tables ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.card > h2 { margin: 0 0 14px; font-size: 17px; font-weight: 600; }
.card__note { color: var(--ink-soft); font-size: 14px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.stat__value { font-size: 30px; font-weight: 600; line-height: 1.1; }
.stat__label { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.stat--overdue .stat__value { color: var(--overdue); }
.stat--critical .stat__value { color: var(--critical); }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-weight: 600; color: var(--ink-soft); padding: 8px 10px; border-bottom: 2px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }

.due-row { border-left: 4px solid transparent; }
.due-row--overdue { border-left-color: var(--overdue); }
.due-row--critical { border-left-color: var(--critical); }
.due-row--due-soon { border-left-color: var(--teal); }

/* ---------- Tags ---------- */

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid;
}
.tag--overdue { color: var(--overdue); border-color: #eccdcf; background: #fdf3f4; }
.tag--critical { color: var(--critical); border-color: #ecdcc0; background: #fdf8f0; }
.tag--due-soon { color: var(--teal); border-color: #c6dfe0; background: var(--teal-soft); }
.tag--ok { color: var(--steady); border-color: #cbe0d3; background: #f1f8f4; }
.tag--muted { color: var(--ink-soft); border-color: var(--line); background: var(--paper); }

/* ---------- Forms ---------- */

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field--wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 14px; }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="date"], .field input[type="number"], .field select, .field textarea {
  font: inherit;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  width: 100%;
}
.field textarea { min-height: 110px; resize: vertical; }
.field--check { flex-direction: row; align-items: center; gap: 9px; }
.field--check label { font-weight: 500; }
.field__hint { color: var(--ink-soft); font-size: 13px; }
.field__error { color: var(--overdue); font-size: 13px; }

.actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; flex-wrap: wrap; }

.btn {
  font: inherit;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: #0c5a5f; }
.btn--quiet { background: #fff; color: var(--teal); }
.btn--quiet:hover { background: var(--teal-soft); }
.btn--danger { background: #fff; color: var(--overdue); border-color: #e2bdbf; }
.btn--danger:hover { background: #fdf3f4; }
.btn--small { padding: 5px 12px; font-size: 13.5px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters select, .filters input[type="search"] {
  font: inherit; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}

/* ---------- Flashes and empties ---------- */

.flashes { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); border-left: 4px solid; }
.flash--success { background: #f1f8f4; border-color: var(--steady); }
.flash--error { background: #fdf3f4; border-color: var(--overdue); }

.empty { padding: 26px 10px; text-align: center; color: var(--ink-soft); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

.definition { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 22px; }
.definition div { display: flex; flex-direction: column; }
.definition dt { color: var(--ink-soft); font-size: 13.5px; }
.definition dd { margin: 0; font-weight: 500; }

.reg {
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--navy);
}

/* ---------- Sign in ---------- */

.signin { min-height: 100vh; display: grid; place-items: center; background: var(--navy); padding: 24px; }
.signin__card { background: #fff; border-radius: var(--radius-lg); padding: 34px; width: 100%; max-width: 400px; }
.signin__card h1 { margin: 0 0 6px; font-size: 23px; }
.signin__card p { margin: 0 0 22px; color: var(--ink-soft); }
.signin__card .btn { width: 100%; }

@media (max-width: 640px) {
  .page { padding: 20px 16px 60px; }
  .masthead { padding: 12px 16px; gap: 14px; }
  .masthead__user { margin-left: 0; width: 100%; }
}

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

/* ---------- Daily checks ---------- */

.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs img {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--line); display: block;
}
.signature-img { max-width: 100%; width: 420px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.thumbs--large { gap: 12px; }
.thumbs--large figure { margin: 0; width: 160px; }
.thumbs--large img { width: 160px; height: 120px; object-fit: cover; border-radius: 8px; }
.field input[readonly] { background: var(--paper); color: var(--ink); font-weight: 600; cursor: default; }

/* Daily checks list: type tabs, sortable headings, one block per day */
.actions--flush { margin: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 14px; color: var(--ink-soft); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tab:hover { color: var(--ink); }
.tab--on { color: var(--ink); border-bottom-color: var(--teal); }
.tab__count { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 12px; text-align: center; }
.filters__check { display: flex; gap: 6px; align-items: center; }
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover, .sort-link--on { text-decoration: underline; }
.checks-table .day-head th { background: var(--paper); text-align: left; font-size: 15px; padding-top: 14px; border-top: 2px solid var(--line); }
.day-head__sum { font-weight: 400; color: var(--ink-soft); margin-left: 10px; }
.day-head__bad { color: var(--overdue); font-weight: 600; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.inline-form { display: inline; }

/* --- Handbook ------------------------------------------------------------ */
.handbook { padding: 28px 32px; line-height: 1.6; max-width: 900px; }
.handbook h2 { font-size: 22px; margin: 36px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.handbook h3 { font-size: 18px; margin: 28px 0 8px; }
.handbook h2:first-of-type { border-top: 0; padding-top: 0; }
.handbook ul, .handbook ol { padding-left: 22px; }
.handbook li { margin: 4px 0; }
.handbook li.done::before { content: "✓ "; color: var(--steady); font-weight: 700; }
.handbook li.todo::before { content: "☐ "; color: var(--ink-soft); }
.handbook li.done, .handbook li.todo { list-style: none; margin-left: -18px; }
.hb-table { overflow-x: auto; margin: 12px 0 18px; }
.hb-table table { border-collapse: collapse; width: 100%; font-size: 15px; }
.hb-table th, .hb-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.hb-table th { background: var(--teal-soft); }
.hb-toc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 8px; }
.hb-toc ol { margin: 8px 0 0; padding-left: 0; list-style: none; columns: 2; }
.hb-toc li { margin: 3px 0; break-inside: avoid; }
.hb-toc .toc-l3 { padding-left: 16px; font-size: 14px; }
@media (max-width: 700px) { .handbook { padding: 18px 16px; } .hb-toc ol { columns: 1; } }
@media print {
  .masthead, .page__head .btn, .hb-toc { display: none; }
  .page { padding: 0; max-width: none; }
  .handbook { border: 0; box-shadow: none; max-width: none; padding: 0; }
  .handbook h2 { break-after: avoid; }
  .hb-table tr { break-inside: avoid; }
}

/* Trial and subscription notices under the header */
.banner { background: #e8f3f3; color: #12393b; padding: 10px 24px; font-size: 14.5px; border-bottom: 1px solid #c9e0e1; }
.banner--error { background: #fdecea; color: #7a1c14; border-bottom-color: #f3c3bd; }
.banner a { color: inherit; font-weight: 600; }
.card--alert { border-left: 4px solid var(--overdue); }
.card--warn { border-left: 4px solid var(--critical); }
.steps { margin: 0; padding-left: 20px; line-height: 1.8; }
.card--narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card--narrow h1 { margin-top: 0; }
.hero { max-width: 760px; margin: 24px 0 28px; }
.hero h1 { font-size: 32px; line-height: 1.2; margin: 0 0 14px; }
.hero p { font-size: 17px; color: var(--ink-soft); }
.features { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.features ul { margin: 0; padding-left: 20px; line-height: 1.7; }
.site-footer { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 14px; }
.legal { max-width: 820px; line-height: 1.6; }
.legal h2 { margin-top: 26px; font-size: 18px; }
.draft-note { background: #fff4e0; border: 1px solid #f0d199; padding: 10px 14px; border-radius: var(--radius-sm); }
