/* VIVID team app. Same palette as vividcleaningsolutionssc.com: deep green, gold, warm cream.
   Built phone-first: big tap targets, one column, works with gloves on. */
:root {
  --bg: hsl(50 33% 97%);
  --card: #fff;
  --fg: hsl(157 31% 16%);
  --green: hsl(157 31% 16%);
  --green-mid: hsl(157 31% 25%);
  --green-soft: hsl(157 25% 92%);
  --gold: hsl(48 61% 60%);
  --gold-dark: hsl(48 58% 36%);
  --gold-soft: hsl(48 70% 92%);
  --muted: hsl(157 10% 35%);
  --line: hsl(48 25% 86%);
  --warn: hsl(28 80% 40%);
  --warn-soft: hsl(32 90% 94%);
  --bad: hsl(0 65% 42%);
  --bad-soft: hsl(0 80% 96%);
  --ok: hsl(150 55% 30%);
  --radius: 12px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--green-mid); }
:focus-visible { outline: 3px solid var(--gold-dark); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; }
.hidden, [hidden] { display: none !important; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--green); color: #fff; padding-top: env(safe-area-inset-top); }
.top__inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; margin-right: auto; }
.brand img { width: 36px; height: 36px; border-radius: 8px; background: #fff; object-fit: contain; }
.brand b { display: block; letter-spacing: .14em; font-size: .95rem; }
.brand small { display: block; color: var(--gold); letter-spacing: .12em; font-size: .7rem; font-weight: 600; }
.link-btn { background: none; border: 0; color: inherit; font: inherit; font-size: .875rem; padding: .5rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 1rem; display: grid; gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.card--hero { background: var(--green); color: #fff; border: 0; }
.card--hero .muted { color: hsl(157 20% 82%); }
.card--hero h1, .card--hero h2 { color: #fff; }
.card--warn { background: var(--warn-soft); border-color: hsl(32 70% 80%); }
.card--bad { background: var(--bad-soft); border-color: hsl(0 60% 85%); }
.row { display: flex; align-items: center; gap: .75rem; }
.row--between { justify-content: space-between; }
.wrap-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.stack { display: grid; gap: .85rem; }
.grid2 { display: grid; gap: .85rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }

/* Forms */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: .75rem .8rem; min-height: 48px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green-mid); outline: none; box-shadow: 0 0 0 3px var(--green-soft); }
input.code { font-size: 1.6rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: .6rem; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--green); }
.hint { font-size: .85rem; color: var(--muted); margin-top: .3rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: 600 1rem var(--sans); color: #fff; background: var(--green); border: 0; border-radius: 10px; padding: .8rem 1.2rem; min-height: 48px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--green-mid); color: #fff; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn--gold { background: var(--gold); color: var(--green); } .btn--gold:hover { background: hsl(48 61% 52%); color: var(--green); }
.btn--ghost { background: transparent; color: var(--green); border: 1.5px solid var(--line); } .btn--ghost:hover { background: var(--green-soft); color: var(--green); }
.btn--bad { background: var(--bad); }
.btn--block { width: 100%; }
.btn--big { min-height: 64px; font-size: 1.15rem; border-radius: 14px; }
.btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Pills and status */
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; background: var(--green-soft); color: var(--green); white-space: nowrap; }
.pill--gold { background: var(--gold-soft); color: var(--gold-dark); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--bad { background: var(--bad-soft); color: var(--bad); }
.pill--muted { background: hsl(50 20% 92%); color: var(--muted); }

/* Clock */
.clock { font-variant-numeric: tabular-nums; font-size: 2.6rem; font-family: var(--serif); line-height: 1; }
.progress { height: 10px; background: hsl(157 20% 30%); border-radius: 99px; overflow: hidden; margin: .75rem 0 .35rem; }
.progress > span { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .4s; }
.card:not(.card--hero) .progress { background: var(--green-soft); }

/* Lists */
.list { display: grid; gap: .5rem; }
.item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; text-align: left; font: inherit; color: inherit; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: .85rem 1rem; min-height: 60px; text-decoration: none; cursor: pointer; }
button.item:hover, a.item:hover { border-color: var(--green-mid); }
.item b { display: block; }
.item > span > .small { display: block; }
.item--done { background: var(--green-soft); border-color: hsl(157 25% 80%); }
.item--locked { cursor: default; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); flex: none; }
.dot--open { background: var(--gold); } .dot--done { background: var(--ok); }

/* Checklist */
.tasks { display: grid; gap: .5rem; }
.task { display: flex; align-items: flex-start; gap: .85rem; padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 500; min-height: 56px; }
.task input { appearance: none; -webkit-appearance: none; flex: none; width: 28px; height: 28px; border: 2px solid var(--green-mid); border-radius: 8px; margin: 0; display: grid; place-content: center; cursor: pointer; }
.task input::after { content: ''; width: 14px; height: 8px; border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(-45deg) translate(1px, -2px); opacity: 0; }
.task input:checked { background: var(--green); border-color: var(--green); }
.task input:checked::after { opacity: 1; }
.task:has(input:checked) { background: var(--green-soft); border-color: hsl(157 25% 78%); }
.task:has(input:checked) span { color: var(--muted); }

/* Photo */
.photo-preview { width: 100%; max-height: 280px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

/* Table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; }
.stat b { display: block; font-family: var(--serif); font-size: 1.8rem; font-weight: 400; line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--muted); }

/* Bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; max-width: 140px; display: grid; justify-items: center; gap: 2px; padding: .55rem .25rem .6rem; font-size: .74rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabs a svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current=page] { color: var(--green); }
.tabs a[aria-current=page] svg { stroke: var(--gold-dark); }

/* Scanner */
.scanner { position: fixed; inset: 0; z-index: 50; background: #000; display: grid; grid-template-rows: 1fr auto; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner__frame { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scanner__frame span { width: min(70vw, 300px); aspect-ratio: 1; border: 4px solid var(--gold); border-radius: 22px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
.scanner__bar { background: var(--green); color: #fff; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); display: grid; gap: .75rem; text-align: center; }

/* Dialog */
dialog { border: 0; border-radius: 16px; padding: 0; max-width: min(92vw, 460px); width: 100%; color: var(--fg); }
dialog::backdrop { background: rgba(20, 35, 30, .55); }
dialog .card { border: 0; }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--green); color: #fff; padding: .75rem 1.1rem; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: 92vw; }
.toast.err { background: var(--bad); }
.empty { color: var(--muted); text-align: center; padding: 1rem 0; margin: 0; }
details > summary { cursor: pointer; font-weight: 600; padding: .25rem 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: .5rem 0; }

/* QR print sheet */
.qr-sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.qr-card { background: #fff; border: 2px solid var(--green); border-radius: 16px; padding: 1rem; text-align: center; break-inside: avoid; page-break-inside: avoid; display: grid; gap: .35rem; justify-items: center; }
.qr-card img.logo { width: 120px; height: auto; }
.qr-card .qr svg, .qr-card .qr img { width: 190px; height: 190px; display: block; }
.qr-card .room { font-family: var(--serif); font-size: 1.35rem; line-height: 1.15; }
.qr-card .site { font-size: .8rem; color: var(--muted); }
.qr-card .cta { font-weight: 700; font-size: .85rem; color: var(--green); }
.qr-card .cta i { font-style: normal; font-weight: 500; color: var(--muted); display: block; }
/* Small sticker sheet: sizes are physical inches so prints come out true to size. */
.sticker-sheet { --sticker: 0.75in; display: flex; flex-wrap: wrap; gap: 0.18in; background: #fff; padding: 0.25in; border-radius: var(--radius); border: 1px solid var(--line); }
.sticker { width: var(--sticker); display: grid; justify-items: center; gap: 2px; outline: 1px dashed #d6d6d6; outline-offset: 0.06in; break-inside: avoid; page-break-inside: avoid; }
.sticker .qr, .sticker .qr svg { width: var(--sticker); height: var(--sticker); display: block; }
.sticker__name { font-size: 6pt; line-height: 1.1; color: #333; text-align: center; max-width: calc(var(--sticker) + 0.1in); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media print {
  .sticker-sheet { border: 0; padding: 0; border-radius: 0; }
  @page { size: letter; margin: 0.4in; }
  body { background: #fff; padding: 0; }
  .top, .tabs, .no-print, .toast { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .qr-sheet { gap: .3in; }
  .qr-card { border-width: 2px; }
}
