/* Manager website. Builds on site.css (same tokens, buttons, pills, header). No inline styles anywhere:
   charts are SVG attributes and <progress> elements, everything else is classes. */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.center { text-align: center; }
.meta { color: var(--muted); }
.grow { flex: 1; min-width: 0; }

/* ---------- header extras ---------- */
.account { display: flex; align-items: center; gap: 10px; }
.company-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-switch { display: flex; align-items: center; gap: 8px; }
.company-switch select, .field select { padding: 8px 14px; border: 2px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-weight: 700; max-width: 220px; }
.menu-account { border-top: 1px solid var(--line); padding: 10px 6px 4px; display: grid; gap: 10px; justify-items: start; }
@media (max-width: 820px) { .account { display: none; } }

.app-main { padding-block: 32px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0; }
.page-head p { margin: 4px 0 0; }
.back { display: inline-block; margin-bottom: 10px; font-weight: 700; }

/* ---------- flash messages ---------- */
.flash { border-radius: var(--radius-sm); padding: 14px 18px; margin: 0 0 20px; font-weight: 700; }
.flash-ok { background: var(--mint-soft); color: var(--mint-ink); }
.flash-error { background: var(--coral-soft); color: var(--coral-ink); }
.flash ul { margin: 6px 0 0; padding-left: 20px; font-weight: 600; }

/* ---------- tiles and panels ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.tile { border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 2px; font-weight: 700; }
.tile strong { font-size: 2.3rem; line-height: 1.1; font-weight: 800; }
.tile-icon svg { width: 24px; height: 24px; }
.tile-primary { background: var(--primary); color: var(--on-primary); }
.tile-soft { background: var(--soft); color: var(--soft-ink); }
.tile-sun { background: var(--sun-soft); color: var(--sun-ink); }
.tile-mint { background: var(--mint-soft); color: var(--mint-ink); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.panel h2 { font-size: 1.25rem; margin: 0 0 0.7em; }
.panel h3 { font-size: 1.05rem; margin: 1.2em 0 0.4em; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel > p:last-child { margin-bottom: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .tiles, .two-col { grid-template-columns: 1fr; } }

.row-link { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.row-link:first-of-type { border-top: 0; }
a.row-link:hover strong { text-decoration: underline; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--soft-ink); font-weight: 800; flex: none; }
.avatar-flag { background: var(--sun-soft); color: var(--sun-ink); }
.empty-note { color: var(--muted); margin: 0; padding: 8px 0; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.bar { fill: var(--soft); }
.bar-today { fill: var(--sun); }
.bar-value { fill: var(--muted); font: 700 14px "Nunito", system-ui, sans-serif; }
.bar-label { fill: var(--muted); font: 700 15px "Nunito", system-ui, sans-serif; }
.bar-label-today { fill: var(--ink); }

progress.meter { appearance: none; -webkit-appearance: none; width: 100%; height: 10px; border: 0; border-radius: 6px; background: var(--soft); overflow: hidden; display: block; }
progress.meter::-webkit-progress-bar { background: var(--soft); border-radius: 6px; }
progress.meter::-webkit-progress-value { background: var(--primary); border-radius: 6px; }
progress.meter::-moz-progress-bar { background: var(--primary); border-radius: 6px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data caption { text-align: left; font-weight: 800; padding-bottom: 8px; }
table.data th, table.data td { text-align: left; vertical-align: middle; padding: 12px 10px; border-bottom: 1px solid var(--line); }
table.data th { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 800; }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data a { font-weight: 800; }
tr.off td { opacity: 0.6; }
.cell-bar { min-width: 120px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; margin-block: 20px; }
.form.inline { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; margin-block: 8px 0; }
.field label { display: block; font-weight: 800; margin-bottom: 6px; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select:not(.plain), .field textarea { width: 100%; padding: 13px 16px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); font: inherit; }
.field select { border-radius: 16px; max-width: none; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--coral-ink); }
.field-note { margin: 6px 4px 0; color: var(--muted); font-size: 0.9rem; }
.has-error .field-note { color: var(--coral-ink); font-weight: 700; }
.btn-block { width: 100%; }
.btn-danger { background: var(--coral-soft); color: var(--coral-ink); }
button.btn { cursor: pointer; font-family: inherit; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.toolbar .field { min-width: 150px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { padding: 9px 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 800; }
.chip[aria-current="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.checklist { display: grid; gap: 6px; margin: 8px 0 16px; padding: 0; list-style: none; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.checklist label { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 16px; font-weight: 700; cursor: pointer; background: var(--card); }
.checklist input { width: 20px; height: 20px; accent-color: var(--primary); }
.checklist label:has(input:checked) { border-color: var(--primary); background: var(--soft); }

/* ---------- zones ---------- */
.zone-thumb { width: 64px; height: 64px; border-radius: 20px; background: var(--soft); display: block; flex: none; }
.zone-thumb svg { width: 100%; height: 100%; display: block; }
.zone-fill { fill: var(--primary); fill-opacity: 0.25; stroke: var(--primary); stroke-width: 3; stroke-linejoin: round; }
.zone-big { width: 100%; max-width: 360px; aspect-ratio: 1; border-radius: var(--radius); background: var(--soft); }

/* ---------- visits and corrections ---------- */
.visit { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 14px 0; border-top: 1px solid var(--line); align-items: center; }
.visit:first-of-type { border-top: 0; }
.visit-when { font-weight: 800; }
.visit.voided .visit-when { text-decoration: line-through; opacity: 0.6; }
.visit-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 18px; padding-bottom: 6px; border-bottom: 2px solid var(--line); font-weight: 800; }
.audit { border-top: 1px solid var(--line); padding: 12px 0; }
.audit:first-of-type { border-top: 0; }
.audit .reason { font-weight: 700; }

/* ---------- sign-in pages ---------- */
body.guest { background: var(--bg); }
.guest-hero { background: var(--primary); padding: 36px 20px 84px; border-radius: 0 0 44px 44px; display: flex; justify-content: center; }
.guest-hero .brand { color: var(--on-primary); font-size: 1.7rem; }
.guest-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); width: min(100% - 32px, 440px); margin: -52px auto 20px; padding: 28px; position: relative; }
.guest-card h1 { font-size: 1.7rem; }
.guest-card .meta { margin-top: -4px; }
.guest-foot { text-align: center; color: var(--muted); font-size: 0.92rem; padding-bottom: 32px; }

@media (max-width: 640px) { .panel { padding: 18px; } .visit { grid-template-columns: 1fr; } }

/* ---------- small helpers used by the pages ---------- */
.panel-summary { cursor: pointer; font-weight: 800; font-size: 1.1rem; }
details.panel[open] > .panel-summary { margin-bottom: 8px; }
.checkline { display: flex !important; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; }
.checkline input { width: 20px; height: 20px; accent-color: var(--primary); }
.big { font-size: 2.4rem; line-height: 1.1; font-weight: 800; }
.form.inline .btn { justify-self: start; }
