/* Sutika Home Care CRM — calm, warm, readable on phones */
:root {
  --bg: #f6f2ea;
  --surface: #ffffff;
  --surface-2: #fbf8f3;
  --ink: #24201b;
  --muted: #776d62;
  --line: #e6ded2;
  --brand: #2f5d50;
  --brand-deep: #234a3f;
  --brand-soft: #e4eee9;
  --accent: #c98a2b;
  --accent-soft: #f8ecd8;
  --danger: #b0412e;
  --danger-soft: #f8e4df;
  --ok: #2f7a4f;
  --ok-soft: #e1f1e6;
  --info-soft: #e7eef6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(36, 32, 27, .05), 0 4px 16px rgba(36, 32, 27, .04);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
.muted { color: var(--muted); }
.small, small { font-size: 13px; }
.late { color: var(--danger); font-weight: 500; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; color: var(--ink); }
.center { text-align: center; justify-content: center; }
.ic { width: 20px; height: 20px; flex: none; }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; font-size: 13px; word-break: break-all; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px; padding: 18px 12px; background: var(--brand-deep); color: #e9f1ed; }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; padding: 4px 8px 14px; }
.brand img { border-radius: 10px; }
.brand b { display: block; font-family: var(--serif); font-size: 17px; }
.brand small { color: #b9cfc6; }
.brand:hover { text-decoration: none; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #d6e4de; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.on { background: #fff; color: var(--brand-deep); font-weight: 600; }
.nav .badge { margin-left: auto; background: var(--accent); color: #fff; font-style: normal; font-size: 11px; border-radius: 99px; padding: 1px 7px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid rgba(255,255,255,.12); }
.me-name { flex: 1; font-size: 14px; line-height: 1.25; }
.me-name small { display: block; color: #b9cfc6; font-size: 12px; }
.me .icon-btn { color: #d6e4de; }
.main { min-width: 0; padding: 0 28px 40px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 18px 0 14px; background: var(--bg); }
.top h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.top .menu-btn { display: none; }
.bottom, .scrim { display: none; }
.content > * + * { margin-top: 16px; }
.greet { margin: 0; font-size: 16px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: #cfc4b4; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 14px; }
.btn-lg { min-height: 46px; padding: 10px 20px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.wa .ic, .icon-btn.wa { color: #1d9e55; }
.wa-solid { background: #1d9e55; border-color: #1d9e55; color: #fff; }
.wa-solid .ic { color: #fff !important; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.link:hover { text-decoration: underline; }
.danger { color: var(--danger) !important; }

/* ---------- Flash ---------- */
.flash { padding: 11px 14px; border-radius: 10px; background: var(--info-soft); margin-bottom: 12px; }
.flash-success { background: var(--ok-soft); }
.flash-error { background: var(--danger-soft); color: #7d2a1c; }
.flash-info { background: var(--accent-soft); }
.flash .pin, .pin { font-family: var(--serif); font-size: 1.4em; letter-spacing: .12em; }

/* ---------- Cards and lists ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card > h2 { margin-bottom: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-h form { display: inline; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow); }
.kpi:hover { text-decoration: none; border-color: #cfc4b4; }
.kpi small { color: var(--muted); }
.kpi b { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.15; }
.kpi.warn { background: var(--accent-soft); border-color: #ecd3ab; }
.small-kpis .kpi b { font-size: 22px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows.tight li { padding: 7px 0; }
.rows li.done .row-main b { text-decoration: line-through; color: var(--muted); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); }
.row-main:hover { text-decoration: none; }
a.row-main:hover b { color: var(--brand); }
.row-main .muted { font-size: 13px; }
.row-act { display: flex; gap: 2px; }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-family: var(--serif); font-size: 17px; margin-bottom: 4px; }
.empty .btn { margin-top: 10px; }
.tick { width: 22px; height: 22px; border-radius: 7px; border: 2px solid #c9bfb1; background: #fff; cursor: pointer; flex: none; }
.tick:hover { border-color: var(--brand); }
.tick.on, .done .tick { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center/16px no-repeat; border-color: var(--brand); }

/* ---------- Pills ---------- */
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eee8de; color: #5d5449; white-space: nowrap; vertical-align: 1px; }
.st-new { background: #e3ecf8; color: #2b558f; }
.st-contacted { background: #eae5f6; color: #5a3f97; }
.st-consultation { background: #f6e6f0; color: #8c3770; }
.st-quoted { background: var(--accent-soft); color: #8a5a12; }
.st-follow_up { background: #fdf0d6; color: #8a6312; }
.st-won, .s-done, .s-paid, .s-active, .s-completed { background: var(--ok-soft); color: var(--ok); }
.st-lost, .s-missed, .s-unpaid { background: var(--danger-soft); color: var(--danger); }
.s-scheduled { background: #e3ecf8; color: #2b558f; }
.s-partial, .s-paused { background: var(--accent-soft); color: #8a5a12; }
.s-cancelled { background: #eee; color: #888; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.r-hot { background: #d0452f; } .r-warm { background: #e0a02f; } .r-cold { background: #8aa8c7; }
.tag { display: inline-block; padding: 1px 8px; margin: 0 4px 4px 0; border-radius: 6px; background: var(--brand-soft); color: var(--brand-deep); font-size: 12px; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; font-size: 13px; flex: none; }
.me .avatar { background: rgba(255,255,255,.15); color: #fff; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; font-family: var(--serif); }
.bar { display: inline-block; width: 100%; max-width: 160px; height: 7px; border-radius: 99px; background: #eee6da; overflow: hidden; vertical-align: middle; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* ---------- Filters and tables ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select, .filters input { min-height: 38px; }
.filters label:not(.search):not(.check) { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.search { position: relative; flex: 1 1 240px; display: flex; }
.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; }
.search input { width: 100%; padding-left: 36px; }
.check { display: flex; align-items: flex-start; gap: 9px; margin: 8px 0; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
.check.inline { display: inline-flex; margin: 0 0 0 10px; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .table-wrap { box-shadow: none; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.table tr:first-child td { border-top: 0; }
.table.compact td, .table.compact th { padding: 7px 10px; }
.table .num, .num { text-align: right; }
.table td input, .table td select { min-height: 34px; }
.row-error td { background: #fdf5f3; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; padding: 10px; }

/* ---------- Forms ---------- */
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #d9cfc1; border-radius: 9px; padding: 8px 11px; min-height: 40px; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
.filters input, .filters select { width: auto; }
.filters .search input { width: 100%; }
textarea { min-height: 0; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47, 93, 80, .25); border-color: var(--brand); }
input.num { text-align: right; max-width: 140px; margin-left: auto; display: block; }
input.tiny { width: 58px; min-height: 28px; padding: 2px 6px; display: inline-block; text-align: center; }
label { display: block; font-size: 14px; font-weight: 500; color: #4a433b; }
label > input, label > select, label > textarea { margin-top: 5px; font-weight: 400; }
label small { font-weight: 400; }
.form fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.form legend { font-family: var(--serif); font-size: 17px; font-weight: 600; margin-bottom: 10px; color: var(--ink); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 14px; }
.fgrid .span2 { grid-column: span 2; }
.form > label, .form .card > label { margin-bottom: 12px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.form-actions.sticky { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); z-index: 3; }
.inline, .inline-form { display: inline; }
.inline-form { display: grid; gap: 8px; margin-top: 10px; }
.inline-form .fgrid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.add-task .fgrid { grid-template-columns: 1fr 140px 180px auto; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--brand-deep); border-color: var(--brand); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
textarea.code { font: 12px/1.45 ui-monospace, Menlo, monospace; background: var(--surface-2); }
details summary { cursor: pointer; font-weight: 600; margin: 10px 0; }
.drop-zone { position: relative; display: grid; place-items: center; text-align: center; padding: 34px 16px; border: 2px dashed #cfc4b4; border-radius: var(--radius); background: var(--surface-2); margin-bottom: 14px; cursor: pointer; }
.drop-zone.over { border-color: var(--brand); background: var(--brand-soft); }
.drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.steps { padding-left: 20px; margin: 0 0 12px; }
.steps li { margin-bottom: 6px; }

/* ---------- Detail pages ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.detail-main, .detail-side { display: grid; gap: 16px; min-width: 0; }
.hero-top { display: flex; gap: 14px; align-items: center; }
.hero-name { font-family: var(--serif); font-size: 21px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.hero-actions form { display: inline; }
.hero .flash { margin: 12px 0 0; }
.stages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.stage-btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.stage-btn:hover { border-color: var(--brand); color: var(--brand); }
.stage-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.lost-reason { flex-basis: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 7px 14px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg input:checked + span { background: var(--brand-soft); color: var(--brand-deep); }
.quick-dates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 12px; font-size: 13px; color: var(--muted); }
.quick-dates button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.quick-dates button:hover { border-color: var(--brand); color: var(--brand); }
.log-form .fgrid { margin-bottom: 4px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 12px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #c9bfb1; }
.timeline .t-call::before { border-color: var(--brand); background: var(--brand-soft); }
.timeline .t-whatsapp::before { border-color: #1d9e55; background: #dcf3e5; }
.timeline .t-stage::before { border-color: var(--accent); background: var(--accent-soft); }
.t-head { font-size: 14px; }
.t-body { margin-top: 3px; white-space: normal; }
.kv { display: grid; grid-template-columns: 112px 1fr; gap: 7px 10px; margin: 0; font-size: 14px; }
.kv.wide { grid-template-columns: 160px 1fr; margin-bottom: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.note { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; font-size: 14px; }
.health { border-color: #ecd3ab; background: #fffaf2; }

/* ---------- Board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: #efe9df; border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col header { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 10px; }
.col .drop { display: grid; gap: 8px; min-height: 140px; border-radius: 10px; transition: background .15s; }
.col.over .drop { background: rgba(47, 93, 80, .08); }
.lead-card { display: grid; gap: 3px; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; color: var(--ink); cursor: grab; box-shadow: var(--shadow); }
.lead-card:hover { text-decoration: none; border-color: #cfc4b4; }
.lead-card.dragging { opacity: .5; }
.lead-card .muted { font-size: 13px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.meta span { background: var(--surface-2); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.meta span.late { color: var(--danger); background: var(--danger-soft); }

/* ---------- Enrolment ---------- */
.form > .card + .card { margin-top: 16px; }
.svc-table td { vertical-align: middle; }
.svc-table .cat { background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.svc-table input[type=number] { max-width: 110px; }
.svc-table tr.off td:not(:first-child) { opacity: .45; }
.totals { margin: 14px 0 6px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; display: grid; gap: 4px; max-width: 380px; margin-left: auto; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-weight: 700; font-size: 17px; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.success-card { text-align: center; max-width: 640px; margin: 0 auto; }
.success-icon { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); font-size: 28px; font-weight: 700; }
.success-card h2 { font-size: 22px; }
.login-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 8px; }
.login-box div { padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.login-box small { display: block; color: var(--muted); }
.login-box b { font-size: 16px; word-break: break-all; }
.checks { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.checks.left { text-align: left; }
.checks li { padding-left: 28px; position: relative; }
.checks li::before { position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.checks .good::before { content: "✓"; background: var(--ok-soft); color: var(--ok); }
.checks .bad::before { content: "!"; background: var(--danger-soft); color: var(--danger); }
.progress-list { display: grid; gap: 8px; margin: 8px 0 10px; }
.prog { display: grid; grid-template-columns: minmax(0, 1fr) 160px 110px; gap: 12px; align-items: center; font-size: 14px; }

/* ---------- Schedule ---------- */
.daynav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.daynav input[type=date] { width: auto; }
.daylabel { font-family: var(--serif); font-size: 17px; margin-left: 6px; }
.daynav .push { margin-left: auto; }
.daynav select { width: auto; }
.visit-list { display: grid; gap: 8px; }
.visit-card { display: grid; grid-template-columns: 78px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid #8aa8c7; border-radius: 12px; color: var(--ink); box-shadow: var(--shadow); }
.visit-card:hover { text-decoration: none; border-color: #cfc4b4; }
.visit-card.s-done { border-left-color: var(--ok); }
.visit-card.s-missed { border-left-color: var(--danger); }
.visit-card.s-cancelled { opacity: .55; }
.visit-card.unassigned { border-left-color: var(--accent); background: #fffaf2; }
.vtime { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.vtime small { display: block; font-family: var(--font); font-size: 12px; color: var(--muted); font-weight: 400; }
.vmain { display: flex; flex-direction: column; min-width: 0; }
.svc-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 14px; }
.svc { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; margin: 0; }
.svc:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.svc input { width: 20px; height: 20px; accent-color: var(--brand); }
.svc span { display: flex; flex-direction: column; }
.svc small { color: var(--muted); font-weight: 400; }
.svc.used { opacity: .6; }
.card form > label { margin-bottom: 12px; }

/* ---------- Charts ---------- */
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.hbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar i { display: block; height: 10px; width: var(--w); min-width: 3px; border-radius: 99px; background: var(--brand); }
.hbar b small { font-weight: 400; color: var(--ok); }
.vbars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; height: 190px; align-items: end; }
.vbar { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; font-size: 12px; }
.vb-pair { flex: 1; width: 100%; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.vb-pair i { width: 40%; max-width: 22px; min-height: 2px; border-radius: 5px 5px 0 0; }
.b1 { background: #c5d8cf; } .b2 { background: var(--brand); }
.vbar small { color: var(--muted); font-size: 11px; }
.legend { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; }

/* ---------- Invoice ---------- */
.invoice-sheet { padding: 28px; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.inv-head h2 { margin: 6px 0 4px; font-size: 22px; }
.inv-head p { margin: 0; color: var(--muted); }
.inv-meta { text-align: right; }
.inv-meta h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.inv-meta p { color: var(--ink); margin-bottom: 6px; }
.inv-to { margin-bottom: 16px; font-size: 14px; }
.inv-table tfoot td { border-top: 1px solid var(--line); text-align: right; }
.inv-table tfoot td:first-child { text-align: right; color: var(--muted); }
.inv-table tfoot .grand td { font-weight: 700; color: var(--ink); font-size: 16px; }
.lines input { min-height: 36px; }

/* ---------- Sign in ---------- */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: radial-gradient(circle at 20% 10%, #e7efe9, transparent 50%), var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 30px 26px; box-shadow: 0 10px 40px rgba(36, 32, 27, .08); display: grid; gap: 14px; }
.auth-card.wide { max-width: 520px; }
.auth-card img { border-radius: 14px; }
.auth-card h1 span { color: var(--brand); font-style: italic; font-weight: 500; }
.auth-card p { margin: 0; }
.auth-card .flash { margin: 0; }

/* ---------- Phones and tablets ---------- */
@media (max-width: 1100px) {
  .detail { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .35); }
  .top .menu-btn { display: inline-grid; }
  .main { padding: 0 14px calc(84px + env(safe-area-inset-bottom)); }
  .top { padding: 12px 0 10px; }
  .top h1 { font-size: 20px; }
  .top-actions .btn span { display: none; }
  .top-actions .btn { padding: 8px 10px; }
  .bottom { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom a, .bottom button { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 11px var(--font); color: var(--muted); background: none; border: 0; padding: 4px 0; }
  .bottom a:hover { text-decoration: none; }
  .grid2 { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: 1fr 1fr; }
  .fgrid .span2 { grid-column: 1 / -1; }
  .add-task .fgrid { grid-template-columns: 1fr 1fr; }
  .card { padding: 15px; }
  .kpi b { font-size: 23px; }
  .prog { grid-template-columns: 1fr 90px; }
  .prog .bar { display: none; }
  .table th, .table td { padding: 9px 10px; }
  .login-box { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 100px 1fr auto; }
  .invoice-sheet { padding: 18px; }
}
@media (max-width: 520px) {
  .fgrid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .visit-card { grid-template-columns: 62px 1fr; }
  .visit-card .pill { grid-column: 2; justify-self: start; }
  .filters > select, .filters > .btn { flex: 1 1 45%; }
  .daynav .push { margin-left: 0; width: 100%; }
  .daynav .push select { width: 100%; }
}

/* ---------- Print (invoices) ---------- */
@media print {
  body { background: #fff; }
  .side, .top, .bottom, .no-print, .flash { display: none !important; }
  .shell, .detail { display: block; }
  .main { padding: 0; }
  .card { border: 0; box-shadow: none; }
  .invoice-sheet { padding: 0; }
}

/* small fixes */
.col .drop { align-content: start; }
.inline-form > .btn { justify-self: start; }
.inline-form + .timeline { margin-top: 16px; }
