/* Happy Hounds brand: peach-orange, white and charcoal (from the approved prototype).
   Orange = action, amber = needs checking, red = emergency/blocked only, green = confirmed/complete. */
:root {
  --orange: #c77c48; --orange-dark: #a8622f; --orange-deep: #8f5226; --peach: #fff0e6; --cream: #fffdfb; --ink: #342a25;
  --muted: #6f645d; --line: #ead8cd; --green: #247150; --amber: #a45919; --red: #a4362c;
  --shadow: 0 7px 24px #8b563412;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--peach); color: var(--ink);
  font: 16px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--orange); outline-offset: 2px; }

.top { background: #fff; border-bottom: 1px solid var(--line); display: flex; gap: 12px;
  justify-content: space-between; align-items: center; padding: 12px 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 64px; height: 52px; object-fit: contain; }
.brand h1 { margin: 0; color: var(--orange); font-size: 1.2rem; letter-spacing: .035em; }
.brand p { margin: 1px 0; color: var(--muted); font-size: .76rem; }
.who { text-align: right; font-size: .85rem; color: var(--muted); }
.who b { display: block; color: var(--ink); }
.who button { margin-top: 4px; }

.nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px 0; max-width: 1180px; margin: auto; }
.nav:empty { display: none; }
.nav button { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 10px 14px;
  white-space: nowrap; font-weight: 800; }
.nav button[aria-current="page"] { background: var(--orange-dark); color: #fff; border-color: var(--orange-dark); }
.nav .more { display: none; color: var(--orange-dark); }

.app { max-width: 1180px; margin: auto; padding: 16px; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }
.head h2 { margin: 0; font-size: 1.45rem; }
.head p { margin: 2px 0 0; color: var(--muted); }
.grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: 14px; align-items: start; }
.stack > * + * { margin-top: 14px; }
.card { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 16px; }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.sub { margin: 0; color: var(--muted); font-size: .9rem; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0;
  border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row small { color: var(--muted); }
.empty { padding: 18px; text-align: center; color: var(--muted); }
.notice { margin-top: 12px; padding: 11px 12px; border-left: 4px solid var(--amber); background: #fff8f0; }
.notice.red { border-color: var(--red); background: #fdf0ee; }
.notice.green { border-color: var(--green); background: #eef7f2; }

/* White on --orange is only 3.3:1; buttons use --orange-dark (4.7:1) so the label meets AA. */
.button { background: var(--orange-dark); color: #fff; border: 0; padding: 10px 14px; font-weight: 800; min-height: 44px; }
.button:hover { background: var(--orange-deep); }
.button.secondary:hover, .button.danger:hover { background: var(--peach); }
.button.secondary { background: #fff; color: var(--orange-dark); border: 1px solid var(--orange); }
.button.danger { background: #fff; color: var(--red); border: 1px solid var(--red); }
.button.small { padding: 6px 10px; min-height: 36px; font-size: .85rem; }
.button:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--orange-dark); text-decoration: underline; padding: 0; font-weight: 700; }
.link.quiet { min-height: 44px; padding: 0 8px; font-weight: 400; }
.who .link { display: inline-block; padding: 12px 0 12px 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 14px; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 8px; min-height: 44px; color: var(--muted); font-weight: 700; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange-dark); }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.badge { display: inline-block; font-size: .82rem; font-weight: 800; padding: 3px 8px; border-radius: 99px;
  background: #e8f4ec; color: var(--green); white-space: nowrap; }
.badge.amber { background: #fff0df; color: var(--amber); }
.badge.red { background: #fbe8e6; color: var(--red); }
.badge.grey { background: #f1ece8; color: var(--muted); }
.flags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }

.lanes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.lane { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 120px; }
.lane h3 { font-size: .92rem; margin: 0; padding: 12px 12px 2px; }
.lane > p { font-size: .78rem; color: var(--muted); margin: 0 12px 8px; }
.dog { display: block; width: calc(100% - 16px); margin: 0 8px 8px; background: var(--cream); border: 1px solid var(--line);
  padding: 10px; text-align: left; color: var(--ink); }
.dog strong, .dog small { display: block; }
.dog small { color: var(--muted); margin-top: 2px; }
.dog-action { display: block; margin-top: 8px; color: var(--orange-dark); font-weight: 800; font-size: .9rem; }
.dog:hover { border-color: var(--orange-dark); }

.field { display: block; margin: 11px 0; font-weight: 700; }
.field input:not([type=checkbox]), .field select, .field textarea { display: block; width: 100%; margin-top: 5px;
  padding: 10px; border: 1px solid #d9c3b5; background: #fff; min-height: 44px; font-weight: 400; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-weight: 700; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; }

dialog { border: 0; max-width: 520px; width: calc(100% - 24px); padding: 20px; box-shadow: 0 16px 60px #0004; }
dialog::backdrop { background: #382d2870; }
dialog h2 { margin-top: 0; }
.error { color: var(--red); font-weight: 800; margin: 8px 0 0; }
.error:empty { display: none; }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 11px 16px; max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
.foot { font-size: .8rem; color: var(--muted); padding: 18px 4px; text-align: center; }
.big { font-size: 1.35rem; font-weight: 800; margin: 2px 0; }

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .lanes { grid-template-columns: 1fr 1fr; }
  .button.small { min-height: 44px; padding: 8px 12px; }   /* thumb-sized on phones and tablets */
}
@media (max-width: 700px) {
  .nav { flex-wrap: wrap; overflow: visible; }
  .nav .extra { display: none; }
  .nav.open .extra { display: block; }
  .nav .more { display: block; }
}
@media (max-width: 520px) {
  .app { padding: 10px; }
  .top { padding: 10px 12px; }
  .brand img { width: 52px; height: 44px; }
  .brand p { display: none; }
  .lanes { grid-template-columns: 1fr; }
  .lane.is-empty { min-height: 0; }
  .lane.is-empty .empty { display: none; }
  .lane.has[data-lane="care"] { order: -1; }   /* care that's due comes first on a phone */
  .row { flex-wrap: wrap; }
}

/* Rota — Bethany's colour convention (requested by Barry): red off/holiday, blue all day,
   green mornings, yellow afternoons. Text labels always accompany the colour. */
.rota-scroll { overflow-x: auto; }
.rota { border-collapse: collapse; width: 100%; min-width: 640px; }
.rota th, .rota td { border: 1px solid #b9a79c; padding: 0; text-align: center; font-size: .86rem; }
.rota thead th, .rota tbody th, .rota tfoot th { background: #fff; padding: 8px 6px; }
.rota tbody th { text-align: left; white-space: nowrap; }
/* Names stay visible while the week scrolls sideways on a phone. */
.rota thead th:first-child, .rota tbody th, .rota tfoot th { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 #b9a79c; }
.rota td.total, .rota tfoot td { background: #fff; padding: 8px 6px; font-weight: 700; }
.rota td > button, .rota td:not(.total) { font-weight: 700; }
.rota td > button { all: unset; box-sizing: border-box; display: block; width: 100%; min-height: 50px; padding: 7px 4px; cursor: pointer; }
.rota td > button:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.rota td:not(:has(button)):not(.total) { padding: 7px 4px; }
.rota small { display: block; font-weight: 400; }
.rota small.label { font-style: italic; }
.rota thead .date { font-weight: 400; }
.week-title { font-weight: 700; color: var(--ink) !important; }
.shift.all_day { background: #3f68b5; color: #fff; }
.shift.morning { background: #8cc56f; color: #1f2a17; }
.shift.afternoon { background: #f5c842; color: #2e2508; }
.shift.off, .shift.holiday { background: #c93d31; color: #fff; }   /* 5.0:1 with white */
.shift.unset { background: #fff; color: var(--muted); }
.badge.shift { font-weight: 800; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.note { border-left: 3px solid var(--line); padding: 8px 0 8px 12px; margin-top: 12px; }
.note.for-me { border-color: var(--orange); background: #fff8f0; }
.note p { margin: 0 0 4px; }
.note small { color: var(--muted); }
.tag { color: var(--orange-dark); }
.print-only { display: none; }
@media print {
  .top, .nav, .no-print, .toast, .foot { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .rota { min-width: 0; }
  .shift { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
