/* CareDodo prototype. Large type and high contrast for older users (NF-8). */
:root {
  --blue: #0356be; --blue-d: #023f8c; --blue-l: #e8f0fb;
  --green: #2f8a17; --green-l: #e9f6e4;
  --orange: #e57a00; --orange-l: #fff2e0;
  --red: #b3261e; --red-l: #fde8e7;
  --ink: #1b1f24; --ink-2: #4a5360; --line: #d6dce4; --bg: #f6f8fb; --card: #fff;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 18px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--orange); outline-offset: 2px; }
h1 { font-size: 1.7rem; margin: .2em 0 .5em; line-height: 1.2; }
h2 { font-size: 1.3rem; margin: 1.2em 0 .5em; }
h3 { font-size: 1.08rem; margin: .8em 0 .3em; }
p { margin: .4em 0 .8em; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }

/* Demo banner (DM-1) */
.demo-banner { background: #fff4d6; border-bottom: 2px solid #f0b400; color: #3d2e00; position: sticky; top: 0; z-index: 50; }
.demo-banner-inner { max-width: 1200px; margin: 0 auto; padding: 8px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .95rem; }
.demo-banner strong { white-space: nowrap; }
.demo-banner-text { flex: 1 1 300px; }
.demo-banner.collapsed .demo-banner-text { display: none; }
.demo-banner-toggle { margin-left: auto; background: transparent; border: 1px solid #b38600; color: #3d2e00; border-radius: 8px; padding: 2px 10px; font-size: .85rem; cursor: pointer; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 8px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-name { font-weight: 800; font-size: 1.25rem; background: linear-gradient(90deg, var(--blue), var(--green) 55%, var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; background: #fff4d6; color: #6b4e00; border: 1px solid #f0b400; border-radius: 6px; padding: 0 6px; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.topnav a { text-decoration: none; color: var(--ink); padding: 8px 12px; border-radius: 10px; font-weight: 600; }
.topnav a.active, .topnav a:hover { background: var(--blue-l); color: var(--blue-d); }
.topright { display: flex; gap: 8px; align-items: center; }
.bell { position: relative; }
.bell .count { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 6px; }

.main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; outline: none; }
.footer { border-top: 1px solid var(--line); background: #fff; padding: 16px; font-size: .9rem; }
.footer p { max-width: 1200px; margin: 4px auto; }

/* Building blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.tight { padding: 12px 14px; }
.card > h2:first-child, .card > h1:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); display: block; }
.tile .num { font-size: 1.9rem; font-weight: 800; color: var(--blue-d); }
.tile.warn .num { color: var(--orange); }
.tile.bad .num { color: var(--red); }
.tile:hover { border-color: var(--blue); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; border-radius: 12px; padding: 10px 18px; border: 2px solid var(--blue); background: var(--blue); color: #fff; cursor: pointer; text-decoration: none; min-height: 48px; }
.btn:hover { background: var(--blue-d); border-color: var(--blue-d); }
.btn.secondary { background: #fff; color: var(--blue); }
.btn.secondary:hover { background: var(--blue-l); }
.btn.green { background: var(--green); border-color: var(--green); }
.btn.orange { background: var(--orange); border-color: var(--orange); }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: .9rem; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: none; color: var(--blue); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }

form .field { margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
.hint { font-size: .85rem; color: var(--ink-2); font-weight: 400; }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], input[type=tel], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; min-height: 48px; }
textarea { min-height: 90px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 24px; height: 24px; margin-top: 2px; flex: none; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.badge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: .8rem; font-weight: 700; background: #eef1f5; color: var(--ink-2); white-space: nowrap; }
.badge.submitted, .badge.pending_verification, .badge.enrolled, .badge.signed_up, .badge.documents_submitted, .badge.background_check, .badge.training, .badge.draft, .badge.pending, .badge.proposed, .badge.open { background: #eef1f5; color: #3b4450; }
.badge.matching, .badge.scheduled, .badge.issued, .badge.certified, .badge.invited { background: var(--blue-l); color: var(--blue-d); }
.badge.confirmed, .badge.verified, .badge.completed, .badge.active, .badge.paid, .badge.settled, .badge.accepted, .badge.approved, .badge.published, .badge.pass, .badge.resolved { background: var(--green-l); color: #1f5e0f; }
.badge.in_progress { background: #fff4d6; color: #6b4e00; }
.badge.escalated, .badge.expired, .badge.rejected, .badge.suspended, .badge.cancelled, .badge.no_show, .badge.overdue, .badge.declined, .badge.fail, .badge.disabled { background: var(--red-l); color: var(--red); }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 16px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--blue-l); }

.list-item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-item:last-child { border-bottom: none; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--green)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; flex: none; }
.avatar.sm { width: 36px; height: 36px; font-size: .9rem; }
.stars { color: #e5a000; letter-spacing: 1px; }
.pill-choice { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.choice { border: 2px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.choice:hover { border-color: var(--blue); }
.choice.selected { border-color: var(--blue); background: var(--blue-l); }
.choice .price { font-weight: 800; color: var(--blue-d); }

.steps { display: flex; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; flex-wrap: wrap; }
.steps li { padding: 4px 12px; border-radius: 999px; background: #eef1f5; font-size: .85rem; font-weight: 600; }
.steps li.on { background: var(--blue); color: #fff; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 6px 0 6px 18px; border-left: 3px solid var(--line); position: relative; }
.timeline li::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--blue); position: absolute; left: -7px; top: 13px; }

.notice { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; background: var(--blue-l); border: 1px solid #b9cff0; }
.notice.warn { background: #fff4d6; border-color: #f0b400; }
.notice.bad { background: var(--red-l); border-color: #f1b5b1; }
.notice.good { background: var(--green-l); border-color: #b5dca7; }
.demo-callout { background: #fff4d6; border: 2px dashed #f0b400; border-radius: 12px; padding: 12px 14px; margin: 12px 0; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; background: #1b1f24; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 100; max-width: 90vw; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.toast.error { background: var(--red); }

.daygroup h3 { position: sticky; top: 44px; background: var(--bg); padding: 6px 0; margin: 14px 0 6px; }
.visit-chip { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--blue); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; text-decoration: none; color: var(--ink); }
.visit-chip.in_progress { border-left-color: var(--orange); }
.visit-chip.completed { border-left-color: var(--green); }
.visit-chip.cancelled, .visit-chip.no_show { border-left-color: var(--red); opacity: .75; }
.visit-chip .time { font-weight: 800; min-width: 92px; }

/* Operator day board */
.board { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.board-row { display: grid; grid-template-columns: 190px 1fr; border-bottom: 1px solid var(--line); min-width: 900px; }
.board-row .who { padding: 8px 10px; font-weight: 600; font-size: .9rem; border-right: 1px solid var(--line); }
.board-track { position: relative; height: 46px; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100%/14 - 1px), #eef1f5 calc(100%/14 - 1px), #eef1f5 calc(100%/14)); }
.board-avail { position: absolute; top: 0; bottom: 0; background: rgba(47,138,23,.10); }
.board-visit { position: absolute; top: 6px; bottom: 6px; background: var(--blue); color: #fff; border-radius: 8px; font-size: .72rem; padding: 2px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-decoration: none; }
.board-visit.in_progress { background: var(--orange); }
.board-visit.completed { background: var(--green); }
.board-head .board-track { height: 26px; background: none; }
.board-head .tick { position: absolute; top: 4px; font-size: .72rem; color: var(--ink-2); transform: translateX(-50%); }

.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 80; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--bg); z-index: 81; overflow-y: auto; padding: 18px; box-shadow: -8px 0 30px rgba(0,0,0,.2); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { font: inherit; border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 12px; cursor: pointer; font-weight: 600; }
.tabs button.on { border-color: var(--blue); background: var(--blue-l); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 600; }
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.hero img { width: 100%; max-width: 360px; justify-self: center; }
.demo-accounts button { width: 100%; text-align: left; }
.sensitive { background: #fffdf4; border: 1px dashed #d1b200; }
.empty { text-align: center; color: var(--ink-2); padding: 24px; }
@media (max-width: 760px) {
  html { font-size: 17px; }
  .hero { grid-template-columns: 1fr; }
  .topnav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .topnav a { white-space: nowrap; }
  .kv { grid-template-columns: 1fr; }
}
@media print { .demo-banner { position: static; } .topbar, .footer .muted { display: none; } }
