/* Manager dashboard. Colours from the driver app's style A (app/lib/theme.dart). System fonts only: nothing is loaded
   from outside the backend. */
:root {
  --bg: #fff8f1; --surface: #fff; --text: #2a1d14; --muted: #7a6a5e; --border: #f0e2d3;
  --accent: #d9822b; --accent-ink: #fff; --accent-soft: #fcebda; --accent-dark: #b86a1c;
  --ok: #2e9e5b; --ok-soft: #e3f4ea; --warn: #c98a00; --warn-soft: #fbf0d6; --bad: #d6453d; --bad-soft: #fbe3e1;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
[hidden] { display: none !important; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
p { line-height: 1.45; }
.muted { color: var(--muted); }
small { display: block; font-size: 12.5px; margin-top: 4px; font-weight: 400; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

button { font: inherit; border-radius: 10px; padding: 9px 16px; border: 1px solid transparent; cursor: pointer; font-weight: 600; }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-ink); }
button.primary:hover:not(:disabled) { background: var(--accent-dark); }
button.ghost { background: transparent; border-color: var(--border); color: var(--text); }
button.ghost:hover:not(:disabled) { background: var(--accent-soft); }
button.danger { background: var(--bad); color: #fff; }
button.danger-ghost { background: transparent; color: var(--bad); border-color: var(--bad-soft); }
button.link { background: none; border: 0; padding: 4px 6px; color: var(--accent-dark); font-weight: 600; }
button.link:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

input, select { font: inherit; width: 100%; padding: 9px 11px; border: 1px solid #e2d2c0; border-radius: 10px; background: #fff; color: var(--text); margin-top: 5px; }
label, fieldset { display: block; font-weight: 600; margin: 0 0 14px; }
fieldset { border: 0; padding: 0; }
legend { padding: 0; margin-bottom: 6px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }
label.check input, .team input { width: auto; margin: 0; }
.with-button { display: flex; gap: 8px; align-items: center; }
.with-button input { flex: 1; }
.with-button button { margin-top: 5px; white-space: nowrap; }
.error { color: var(--bad); background: var(--bad-soft); padding: 9px 12px; border-radius: 10px; margin: 0 0 12px; }

.brand { display: flex; gap: 10px; align-items: center; }
.brand b { display: block; font-size: 16px; }
.brand small { margin: 0; color: var(--muted); }
.logo { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; }

/* sign-in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin-card { width: min(380px, 100%); padding: 26px; }
.signin-card .brand { margin-bottom: 22px; }
.signin-card button { width: 100%; padding: 12px; }

/* signed in */
.top { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; }
.top nav a.active { background: var(--accent-soft); color: var(--accent-dark); }
.me { display: flex; align-items: center; gap: 10px; }
.page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
.bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.bar p { margin: 0; max-width: 620px; }
.filters { display: flex; gap: 18px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filters input[type=search] { max-width: 300px; margin: 0; }
.notice { padding: 22px; max-width: 620px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.off td { color: var(--muted); }
td .sub { display: block; color: var(--muted); font-size: 13px; }
td.acts { text-align: right; white-space: nowrap; }
td.order { white-space: nowrap; }
td.order button { padding: 2px 8px; min-width: 30px; }
.photo-dialog { width: min(720px, calc(100% - 32px)); }
.photo-dialog img { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--accent-soft); min-height: 120px; }
.filters select { width: auto; margin: 0; }
input.date { width: auto; margin: 0; }
h2.section { margin: 26px 0 8px; }
.notice .sub { display: block; margin-top: 4px; color: var(--muted); }
.notice.ok { border-color: var(--ok-soft); background: var(--ok-soft); }
.notice.bad { border-color: var(--bad-soft); background: var(--bad-soft); }
.num { text-align: right; white-space: nowrap; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--accent-soft); padding: 2px 6px; border-radius: 6px; }
.empty { padding: 18px; margin: 0; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent-dark); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: #8a5f00; }
.pill.off { background: #efe9e3; color: var(--muted); }

dialog { border: 0; border-radius: 18px; padding: 24px; width: min(480px, calc(100% - 32px)); color: var(--text); box-shadow: 0 20px 60px rgba(42, 29, 20, .25); }
dialog::backdrop { background: rgba(42, 29, 20, .35); }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.grow { flex: 1; }
.team { display: flex; flex-wrap: wrap; gap: 8px 18px; font-weight: 500; }
.team label { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 500; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 500; max-width: calc(100% - 32px); }

@media (max-width: 640px) {
  .top { padding: 12px 16px; gap: 10px; }
  .bar { flex-direction: column; }
  th:nth-child(5), td:nth-child(5) { display: none; }
}
#writes-box { margin-bottom: 12px; }
#writes-box .sub { display: block; margin-top: 4px; color: var(--muted); }
#agent-box { margin-bottom: 12px; }
#agent-box .sub { display: block; margin-top: 4px; color: var(--muted); }
/* Cover page: the form is wider than a notice; the sick lorry's shops as ticks */
.cover-form { max-width: 900px; }
.cover-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 18px; }
.cover-shops { max-height: 320px; overflow: auto; padding: 4px 0; }
.cover-shops label[hidden] { display: none; }
#cv-cannot { margin: 0 0 12px; }
/* A narrow screen shows each cover as a small card instead of a table wider than the phone (Cancel stays in view). */
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { display: block; padding: 2px 0; border: 0; }
  table.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
  table.stack td.when { font-weight: 700; margin-bottom: 2px; }
  table.stack td.acts { text-align: left; margin-top: 6px; }
  table.stack td.acts button { padding: 8px 12px; margin-left: -12px; }
}
