/* 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; }

.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; }
