/* Brand colors come from --brand and --accent, set per practice in base.html. */
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1c2430; background: #f4f6f9; }
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
h3 { font-size: .95rem; margin: 1rem 0 .3rem; color: #4a5568; text-transform: uppercase; letter-spacing: .03em; }
main { max-width: 1240px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.25rem; background: var(--brand); color: #fff; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; }
.brand { display: flex; align-items: center; gap: .6rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { opacity: .85; font-size: .78rem; }
.logo { height: 38px; width: auto; max-width: 140px; background: #fff; border-radius: 8px; padding: 3px; }
.logo-lg { max-height: 90px; max-width: 240px; display: block; margin: 0 auto .75rem; }
nav { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
nav a { padding: .25rem 0; border-bottom: 2px solid transparent; }
nav a:hover { border-color: var(--accent); }
.who { display: flex; gap: .75rem; align-items: center; }
.foot { text-align: center; font-size: .8rem; color: #6b7686; padding: 1rem; }
.card { background: #fff; border: 1px solid #e2e7ee; border-radius: 10px; padding: 1rem 1.15rem; margin-bottom: 1rem; }
.card.narrow { max-width: 440px; margin: 2rem auto; }
.card.wide { max-width: 980px; margin: 1rem auto; }
.narrow-left { max-width: 460px; }
.center-logo { text-align: center; } .center-logo form { text-align: left; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid2.wide-left { grid-template-columns: 2fr 1fr; }
.span2 { grid-column: 1 / -1; }
@media (max-width: 860px) { .grid2, .grid2.wide-left { grid-template-columns: 1fr; } }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: .65rem; }
fieldset { border: 1px solid #e2e7ee; border-radius: 8px; padding: .75rem 1rem; display: flex; flex-direction: column; gap: .6rem; margin: 0; }
legend { font-weight: 600; padding: 0 .3rem; }
label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: #3d4756; }
label.check { flex-direction: row; align-items: center; }
input, select, textarea { font: inherit; padding: .45rem .55rem; border: 1px solid #cbd3dd; border-radius: 6px; background: #fff; color: inherit; }
input[type=color] { padding: 2px; height: 2.3rem; width: 4rem; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.vitals label { width: 7.2rem; }
button, .btn { font: inherit; padding: .45rem .85rem; border-radius: 6px; border: 1px solid #cbd3dd; background: #fff; color: #1c2430; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: var(--brand); }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.small { padding: .2rem .5rem; font-size: .8rem; }
button.link { background: none; border: 0; color: #fff; text-decoration: underline; padding: 0; }
form.inline { display: inline; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .4rem; border-bottom: 1px solid #eef1f5; vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; color: #6b7686; letter-spacing: .03em; }
tr.struck td:not(:last-child) { text-decoration: line-through; color: #8a94a3; }
.list { margin: 0; padding-left: 1.1rem; } .list li { margin: .25rem 0; }
.add { margin-top: .6rem; } .add input:first-of-type { flex: 1; min-width: 10rem; }
.search { margin-bottom: 1rem; } .search input { flex: 1; min-width: 14rem; }
.pill { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; background: #eef1f5; }
.pill.danger { background: #fde8e8; color: #9b1c1c; }
.pill.ok, .pill.s-completed { background: #e3f6ea; color: #1d6b3a; }
.pill.warn, .pill.s-checked_in { background: #fff4d6; color: #7a5300; }
.pill.s-cancelled, .pill.s-no_show { background: #f1f1f1; color: #777; }
.banner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: #fff; border: 1px solid #e2e7ee; border-left: 6px solid var(--accent); border-radius: 10px; padding: .9rem 1.15rem; margin-bottom: 1rem; }
.banner h1 { margin: 0; } .banner p { margin: .25rem 0; }
.kv { display: grid; grid-template-columns: 9rem 1fr; gap: .35rem .75rem; margin: 0; }
.kv dt { color: #6b7686; } .kv dd { margin: 0; }
.pre { white-space: pre-wrap; }
.note .vitals-line { background: #f6f8fb; padding: .4rem .6rem; border-radius: 6px; }
.addendum { border-left: 3px solid var(--accent); padding-left: .75rem; margin-bottom: .75rem; }
.error { background: #fde8e8; color: #9b1c1c; padding: .55rem .75rem; border-radius: 6px; }
.notice { background: #e8f1fd; color: #1a4d8f; padding: .55rem .75rem; border-radius: 6px; }
.muted { color: #6b7686; } .small { font-size: .82rem; }
.qr svg { display: block; margin: .5rem auto; width: 200px; height: 200px; }
code { background: #f1f3f6; padding: .1rem .3rem; border-radius: 4px; word-break: break-all; }

/* ---- left navigation layout ---- */
.topbar { justify-content: space-between; }
.layout { display: flex; align-items: stretch; min-height: calc(100vh - 58px); }
.layout main { flex: 1; min-width: 0; margin: 0 auto; }
.sidenav { width: 210px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 1rem .6rem;  background: #fff; border-right: 1px solid #e2e7ee; }
.sidenav a { padding: .5rem .75rem; border-radius: 6px; color: #2b3542; text-decoration: none; display: flex; justify-content: space-between; align-items: center; }
.sidenav a:hover { background: #f1f4f8; }
.sidenav a.active { background: var(--brand); color: #fff; }
.navhead { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #8a94a3; margin: 1rem .75rem .25rem; }
.badge { background: #d93025; color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 .45rem; min-width: 1.3rem; text-align: center; }
@media (max-width: 860px) { .layout { flex-direction: column; } .sidenav { width: 100%; min-height: 0; position: static; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid #e2e7ee; } .navhead { display: none; } }

/* ---- tabs, tiles, zones ---- */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid #e2e7ee; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; text-decoration: none; color: #4a5568; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.tile { background: #fff; border: 1px solid #e2e7ee; border-radius: 10px; padding: .9rem 1rem; border-top: 4px solid #cbd3dd; }
.tile .big { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.tile .label { color: #6b7686; font-size: .82rem; }
.tile.good { border-top-color: #1e8e3e; } .tile.bad { border-top-color: #d93025; }
.goal { font-size: .78rem; color: #6b7686; }
.zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 860px) { .zones { grid-template-columns: 1fr; } }
.zone { border-radius: 10px; padding: .8rem 1rem; border: 1px solid; }
.zone h3 { margin: 0 0 .2rem; text-transform: none; letter-spacing: 0; font-size: 1rem; }
.zone .big { font-size: 1.8rem; font-weight: 700; }
.zone.green { background: #e9f7ee; border-color: #b7e1c4; color: #145c2c; }
.zone.yellow { background: #fff7e0; border-color: #f2d98d; color: #6d4c00; }
.zone.red { background: #fdecea; border-color: #f5b5ae; color: #8a1c13; }
.zone ul { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .85rem; }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; background: #cbd3dd; }
.dot.green { background: #1e8e3e; } .dot.yellow { background: #f9ab00; } .dot.red { background: #d93025; }
.bar { height: 8px; background: #eef1f5; border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--brand); }
.overdue { color: #b3261e; font-weight: 600; }
.legal { background: #f6f8fb; border-left: 4px solid var(--brand); padding: .75rem 1rem; border-radius: 6px; font-size: .9rem; }
