/* Plant operations app. Made for phones first: big buttons, big text, one column. */
:root {
  --char: #1d2421;
  --char-2: #2c3531;
  --green: #1f6b45;
  --green-dark: #17543a;
  --green-soft: #e3f2e8;
  --amber: #c9801a;
  --amber-soft: #fbf0dc;
  --red: #b3261e;
  --red-soft: #fbe9e7;
  --blue: #2a5d8f;
  --blue-soft: #e6eef7;
  --bg: #f4f5f3;
  --card: #ffffff;
  --ink: #17201b;
  --muted: #5b665f;
  --line: #e3e6e2;
  --field: #cdd3ce;
  --field-hover: #9ea7a1;
  --hover: #f1f4f1;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 25, 0.05), 0 2px 8px rgba(20, 30, 25, 0.04);
  --font: 'Plus Jakarta Sans', 'Noto Sans Telugu', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', 'Noto Sans Telugu', Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font: 700 1.125rem/1.25 var(--font); letter-spacing: -0.01em; }
h2 { font: 700 1.05rem/1.3 var(--font); letter-spacing: -0.005em; }
a { color: var(--green); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.ic { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.22em; }
.ic.big { width: 44px; height: 44px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 0.92rem; }
.none { color: var(--muted); padding: 16px; text-align: center; }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
.bar h1 { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: transparent; color: var(--ink); border: 0; cursor: pointer; text-decoration: none; }
.bar-btn:hover { background: var(--hover); }
.bar-btn .ic { width: 22px; height: 22px; }
.bar-logo { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 4px; border-radius: 10px; background: var(--green); color: #fff; }
.bar-logo .ic { width: 20px; height: 20px; }
.bar-gap { width: 44px; }
.test-strip { background: #f2ecfa; color: #57348a; border-bottom: 1px solid #e3d8f2; text-align: center; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; padding: 5px 8px; }
.page { max-width: 680px; margin: 0 auto; padding: 16px 16px 64px; display: grid; gap: 14px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; font-size: 0.95rem; border: 1px solid var(--field); background: var(--card); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s; }
.btn:hover { border-color: var(--field-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.busy { opacity: 0.6; position: relative; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 1px 2px rgba(23, 84, 58, 0.25); }
.btn.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn.dark { background: var(--char); border-color: var(--char); color: #fff; }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.light { background: rgba(255, 255, 255, 0.15); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger-text { color: var(--red); }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: 0.875rem; border-radius: 8px; }
.btn.big { width: 100%; min-height: 50px; font-size: 1rem; }
.btn.huge { width: 100%; min-height: 64px; font-size: 1.1rem; border-radius: 12px; }
.btn.huge .ic { width: 28px; height: 28px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 140px; }
.btn-row.wrap > .btn { flex: 0 1 auto; }
.stack { display: grid; gap: 10px; width: 100%; }
.link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 0; color: var(--green); font-weight: 650; text-decoration: none; cursor: pointer; }
.link.center { display: flex; justify-content: center; }
.link.small { font-size: 0.88rem; padding: 2px 0; }

/* ---------- cards, lists ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card.list { padding: 4px 0; }
.section-title { display: flex; align-items: center; gap: 6px; margin: 10px 2px -6px; font-size: 0.75rem; line-height: 1.4; color: var(--muted); font-family: var(--font); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left; cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row .grow { display: grid; gap: 1px; }
.row-sub { display: block; font-size: 0.9rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.row-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--green-soft); color: var(--green); flex: none; }
.row-img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; }
.small-list .row { padding: 8px 12px; font-size: 0.9rem; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: #eceae2; color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--green-soft); color: var(--green-dark); }
.badge.info { background: var(--blue-soft); color: var(--blue); }
.badge.warn { background: var(--amber-soft); color: #8a560c; }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.muted { background: #eceae2; color: var(--muted); }
.summary { font-size: 1rem; color: var(--muted); }
.summary b { color: var(--ink); font-size: 1.3rem; }
.empty { display: grid; justify-items: center; gap: 12px; padding: 36px 16px; color: var(--muted); text-align: center; }
.loading { display: grid; place-items: center; padding: 60px 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--green); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* colours of the tiles and row icons */
.t-green, .t-production, .t-maintenance { background: var(--green-soft); color: var(--green); }
.t-biomass_in, .t-processing, .t-packing, .t-dispatch { background: #efe9dc; color: #6f5221; }
.t-ppe, .t-safety, .t-red { background: var(--red-soft); color: var(--red); }
.t-expense, .t-expense_request, .t-amber { background: var(--amber-soft); color: #8a560c; }
.t-work, .t-premises, .t-slate { background: #e9ecea; color: #3d4742; }
.t-blue { background: var(--blue-soft); color: var(--blue); }
.t-dark { background: var(--char); color: #fff; }

/* ---------- home ---------- */
.hello { display: grid; gap: 2px; padding: 4px 2px 2px; }
.hello h2 { font-size: 1.4rem; line-height: 1.25; letter-spacing: -0.015em; }
.hello p { color: var(--muted); font-size: 0.92rem; }

/* needs attention: one grouped list */
.attn-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.attn-row:last-child { border-bottom: 0; }
a.attn-row:hover { background: #fafbfa; }
.attn-row .grow { display: grid; gap: 1px; }
.attn-title { font-size: 0.95rem; font-weight: 600; line-height: 1.35; }
.attn-sub { font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.attn-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; flex: none; background: #edf0ed; color: #46514b; }
.attn-ic .ic { width: 19px; height: 19px; }
.attn-ic.ask { background: var(--blue-soft); color: var(--blue); }
.attn-ic.bad { background: var(--red-soft); color: var(--red); }
.attn-ic.due { background: var(--amber-soft); color: #8a560c; }
.attn-ic.good { background: var(--green-soft); color: var(--green); }
.attn-count { min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; background: #edf0ed; color: var(--ink); flex: none; }
.attn-count.ask { background: var(--blue); color: #fff; }
.attn-count.bad { background: var(--red); color: #fff; }
.attn-count.due { background: var(--amber); color: #fff; }
.attn-count.good { background: var(--green); color: #fff; }
.attn-go { color: #a3aba6; width: 18px; height: 18px; }
.punch-card { display: grid; gap: 10px; }
.punch-card.warn { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; border: 1px solid #efd9b0; background: #fffaf1; }
.punch-card.warn p { color: var(--muted); font-size: 0.92rem; }
.punch-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--amber-soft); color: #8a560c; flex: none; }
.punch-ic .ic { width: 24px; height: 24px; }
.punch-times { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.9rem; color: var(--muted); }
.punch-done b { color: var(--ink); }
.punch-over { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; color: var(--green); padding: 10px 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; display: grid; gap: 10px; align-content: start; min-height: 100px; padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
.tile:hover { border-color: var(--field); }
.tile:active { transform: scale(0.98); }
.tile-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: inherit; }
.tile.t-dark .tile-ic { background: rgba(255, 255, 255, 0.12); }
.tile .tile-ic .ic { width: 22px; height: 22px; }
.tile[class*='t-'] { background: var(--card); color: var(--ink); }
.tile[class*='t-'] .tile-ic { color: inherit; }
.tile.t-green .tile-ic, .tile.t-production .tile-ic, .tile.t-maintenance .tile-ic { background: var(--green-soft); color: var(--green); }
.tile.t-biomass_in .tile-ic, .tile.t-processing .tile-ic, .tile.t-packing .tile-ic, .tile.t-dispatch .tile-ic { background: #efe9dc; color: #6f5221; }
.tile.t-ppe .tile-ic, .tile.t-safety .tile-ic, .tile.t-red .tile-ic { background: var(--red-soft); color: var(--red); }
.tile.t-expense .tile-ic, .tile.t-expense_request .tile-ic { background: var(--amber-soft); color: #8a560c; }
.tile.t-work .tile-ic, .tile.t-premises .tile-ic, .tile.t-slate .tile-ic { background: #e9ecea; color: #3d4742; }
.tile.t-blue .tile-ic { background: var(--blue-soft); color: var(--blue); }
.tile.t-dark { background: var(--char); color: #fff; }
.tile.t-dark .tile-ic { color: #7fd19b; }
.tile-count { position: absolute; top: 12px; right: 12px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--red); color: #fff; font-size: 0.75rem; font-weight: 700; display: grid; place-items: center; }

/* ---------- forms ---------- */
.form { display: grid; gap: 20px; padding: 20px 16px; }
.field { display: grid; gap: 8px; border-radius: 12px; }
.field > .hint { margin-top: -4px; font-size: 0.86rem; }
.field-bad { outline: 2px solid var(--red); outline-offset: 6px; }
.field-bad .input { border-color: var(--red); }
.label { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 600; color: var(--ink); letter-spacing: 0.005em; }
.label i { color: var(--red); font-style: normal; }
.input { width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--field); background: #fff; font-size: 1rem; transition: border-color 0.15s, box-shadow 0.15s; }
.input:hover { border-color: var(--field-hover); }
.input::placeholder { color: #9aa19c; font-weight: 400; }
.input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(31, 107, 69, 0.15); }
select.input { appearance: none; padding-right: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235f6a64' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }

/* speak instead of typing (under every explanation box) */
.voice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.mic, .mic-lang { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--field); background: #fff; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.mic { color: var(--green-dark); border-color: #b9d7c4; background: var(--green-soft); }
.mic.on { color: #fff; background: var(--red); border-color: var(--red); animation: mic-pulse 1.2s ease-in-out infinite; }
.mic-lang { color: var(--muted); }
.mic-lang .ic, .mic .ic { width: 1.05em; height: 1.05em; }
.mic-status { font-size: 0.85rem; color: var(--muted); }
textarea.input.listening { border-color: var(--red); box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.12); }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 6px rgba(179, 38, 30, 0.18); } }

/* text box with values sent before */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(20, 30, 25, 0.14); max-height: 300px; overflow-y: auto; }
.combo-head { padding: 6px 10px 4px; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.combo-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 1rem; cursor: pointer; }
.combo-item .ic { color: #9aa19c; }
.combo-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-item:hover, .combo-item:active { background: var(--green-soft); }
.other-box { margin-top: 2px; }
textarea.input { min-height: 90px; resize: vertical; }
.input.num { font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.input.big-input { font-size: 1.25rem; letter-spacing: 0.04em; font-feature-settings: "calt" 0; }
.input.big-input::placeholder { font-size: 1rem; letter-spacing: 0; }
.phone-box { display: flex; align-items: stretch; }
.phone-cc { display: grid; place-items: center; padding: 0 14px; border: 1px solid var(--field); border-right: 0; border-radius: 10px 0 0 10px; background: var(--hover); color: var(--muted); font-weight: 600; font-size: 1.05rem; }
.phone-box .input { flex: 1; min-width: 0; border-radius: 0 10px 10px 0; }
.input.pin { letter-spacing: 0.4em; }
.otp-show { background: var(--hover); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-align: center; font-size: 1.75rem; font-weight: 700; letter-spacing: 0.3em; text-indent: 0.3em; font-variant-numeric: tabular-nums; padding: 10px 8px; margin: 0 0 4px; user-select: all; }
.btn-row.center { justify-content: center; }
.num-row { display: flex; align-items: center; gap: 8px; }
.num-row .input { flex: 1; }
.prefix, .suffix { font-weight: 600; color: var(--muted); }
.prefix { font-size: 1.15rem; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--field); border-radius: 10px; background: var(--hover); flex: none; }
.seg button { min-width: 48px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 0.95rem; font-weight: 600; cursor: pointer; }
.seg button.on { background: #fff; color: var(--green-dark); box-shadow: 0 1px 2px rgba(20, 30, 25, 0.15); }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; }
.stepper .btn { min-height: 48px; padding: 0; }
.stepper .ic { width: 22px; height: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--field); background: #fff; font-size: 0.95rem; font-weight: 500; line-height: 1.25; cursor: pointer; text-decoration: none; color: inherit; transition: background-color 0.15s, border-color 0.15s; }
.chip:hover { border-color: var(--field-hover); }
.chip.on { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); font-weight: 600; box-shadow: inset 0 0 0 1px var(--green); }
.chips.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); grid-auto-rows: 1fr; }
.chips.options .chip { justify-content: flex-start; text-align: left; }
.chips.options .chip .ic { width: 1.05em; height: 1.05em; color: var(--muted); }
.chips.small .chip { min-height: 36px; padding: 4px 12px; font-size: 0.875rem; }
.chips.yesno { display: grid; grid-template-columns: 1fr 1fr; }
.chips.yesno .chip { justify-content: center; min-height: 50px; font-size: 1rem; font-weight: 600; }
.chips.yesno .chip.yes.on { background: var(--green); border-color: var(--green); color: #fff; box-shadow: none; }
.chips.yesno .chip.no.on { background: var(--red); border-color: var(--red); color: #fff; box-shadow: none; }
.big-chips .chip { min-height: 52px; font-size: 1rem; }
.center-chips { justify-content: center; }
.total { font-size: 1rem; padding: 12px 14px; border-radius: 10px; background: var(--hover); }
.total:empty { display: none; }
.date-pick { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.date-pick summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.date-pick summary::-webkit-details-marker { display: none; }
.date-pick .input { margin-top: 8px; width: auto; min-width: 180px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-line { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.check-line input { width: 24px; height: 24px; }
.filters { display: grid; gap: 12px; padding: 12px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter { display: inline-flex; align-items: center; gap: 6px; }
.filter > span { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.filter .input { width: auto; min-height: 36px; padding: 5px 10px; border-radius: 8px; font-size: 0.875rem; font-weight: 500; }
.filter select.input { max-width: 220px; padding-right: 32px; background-position: right 8px center; background-size: 16px; }
/* status tabs: one strip, the chosen one raised */
.tabs { display: flex; justify-self: start; max-width: 100%; gap: 2px; padding: 3px; border-radius: 10px; background: var(--hover); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; min-height: 32px; padding: 6px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 0.875rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20, 30, 25, 0.15); }
.list-count { margin: 0 2px -6px; font-size: 0.8rem; color: var(--muted); }

/* photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 120px)); gap: 8px; }
.photo-cell, .photo-add { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; }
.photo-cell.loading::after { content: ''; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.55) center / 30px no-repeat; animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.3; } to { opacity: 0.9; } }
.photo-x { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo-add { display: grid; place-content: center; justify-items: center; gap: 4px; border: 1.5px dashed var(--field-hover); background: #fafbfa; color: var(--muted); font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.photo-add .ic { width: 26px; height: 26px; }
.photo-add:hover { border-color: var(--green); color: var(--green); }
.photo-one { display: grid; gap: 10px; justify-items: start; }
.photo-one img { width: 160px; height: 160px; object-fit: cover; border-radius: 14px; }
.thumb { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 12px; overflow: hidden; aspect-ratio: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.round { width: 52px; height: 52px; border-radius: 50%; flex: none; }
.thumb.round.small { width: 44px; height: 44px; }
.thumb.wide { width: 100%; aspect-ratio: 4 / 3; margin-bottom: 12px; }
.photo-grid.view { margin-top: 12px; }
.viewer { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.92); display: grid; place-items: center; padding: 12px; }
.viewer img { max-height: 92vh; max-width: 100%; object-fit: contain; border-radius: 8px; }
.viewer-x { position: absolute; top: 14px; right: 14px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; display: grid; place-items: center; }

/* ---------- camera ---------- */
.cam { position: fixed; inset: 0; z-index: 90; background: #000; color: #fff; display: grid; grid-template-rows: auto 1fr auto; }
.cam-top { padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); display: grid; gap: 2px; text-align: center; }
.cam-top span { font-size: 0.9rem; opacity: 0.8; }
.cam-view { position: relative; overflow: hidden; display: grid; place-items: center; }
.cam-video { width: 100%; height: 100%; object-fit: cover; }
.cam-video.mirror { transform: scaleX(-1); }
img.cam-video { object-fit: contain; }
.cam-oval { position: absolute; width: 64%; max-width: 330px; aspect-ratio: 3 / 4; border: 4px solid rgba(255, 255, 255, 0.85); border-radius: 50%; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35); pointer-events: none; }
.cam-oval.wide { border-radius: 40%; }
.cam-msg { position: absolute; left: 16px; right: 16px; text-align: center; background: rgba(0, 0, 0, 0.6); padding: 14px; border-radius: 12px; }
.cam-bar { display: flex; align-items: center; justify-content: space-around; gap: 12px; padding: 18px 16px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.cam-bar .btn { flex: 1; min-height: 56px; }
.cam-shot { width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; background: #fff; box-shadow: inset 0 0 0 4px #000; cursor: pointer; }
.cam-shot:disabled { opacity: 0.3; }
.cam-side { width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; display: grid; place-items: center; cursor: pointer; }
.cam-side .ic { width: 26px; height: 26px; }

/* ---------- results ---------- */
.done { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 24px 0; }
.done-tick { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--green-soft); color: var(--green); box-shadow: 0 0 0 8px rgba(31, 107, 69, 0.06); }
.done-tick .ic { width: 36px; height: 36px; stroke-width: 2.4; }
.done-tick.bad { background: var(--red-soft); color: var(--red); box-shadow: 0 0 0 8px rgba(179, 38, 30, 0.06); }
.done-time { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.note { padding: 10px 12px; border-radius: 10px; background: var(--blue-soft); border: 1px solid #d3e0ee; font-size: 0.9rem; }
.note.warn { background: #fffaf1; border-color: #efd9b0; color: #6d4409; }
.tips { margin: 0; padding-left: 20px; text-align: left; color: var(--muted); display: grid; gap: 4px; }
.checking { display: grid; justify-items: center; gap: 16px; padding: 30px 0; font-weight: 600; }
.checking-img { width: 160px; height: 160px; object-fit: cover; border-radius: 50%; }
.face-reg { display: grid; gap: 14px; justify-items: center; text-align: center; }
.face-ic { display: grid; place-items: center; width: 70px; height: 70px; border-radius: 20px; background: var(--amber-soft); color: var(--amber); }
.face-ic .ic { width: 40px; height: 40px; }
.face-shots { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.face-slot { display: grid; place-items: center; width: 80px; height: 80px; border-radius: 50%; border: 2px dashed #bdbbb0; color: var(--muted); font-weight: 700; font-size: 1.3rem; overflow: hidden; }
.face-slot.on { border: 3px solid var(--green); }
.face-slot img { width: 100%; height: 100%; object-fit: cover; }
.face-shots.small { justify-content: flex-end; gap: 4px; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; align-content: center; gap: 16px; max-width: 440px; margin: 0 auto; padding: 24px 16px; }
.login-head { display: grid; justify-items: center; gap: 6px; text-align: center; }
.login-head h1 { font-size: 1.5rem; }
.login-head p { color: var(--muted); }
.logo-big { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--green); color: #fff; }
.logo-big .ic { width: 42px; height: 42px; }
.login { display: grid; gap: 16px; }
.langs { display: flex; justify-content: center; gap: 8px; }

/* ---------- workers ---------- */
.wk-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.wk-row:last-child { border-bottom: 0; }
.wk-row.is-in { background: #f3faf5; }
.wk-name { font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.in-btn { background: var(--green); border-color: var(--green); color: #fff; min-width: 96px; min-height: 52px; }
.out-btn { background: var(--char); border-color: var(--char); color: #fff; min-width: 96px; min-height: 52px; }
.wk-left { color: var(--green); font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }

/* ---------- report view ---------- */
.entry-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
/* label | value rows: label column on the left, values left-aligned so long text reads normally */
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 4px 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; line-height: 1.45; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.total-kv b { font-size: 1rem; }
@media (max-width: 420px) { .kv { grid-template-columns: 1fr; } }
.card-title { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }

/* conversation about a report: compact chat bubbles, each only as wide as its text */
.talk { display: grid; gap: 6px; padding: 14px 16px; }
.talk .card-title { margin-bottom: 4px; }
.msg { max-width: 82%; width: fit-content; padding: 6px 11px 7px; border-radius: 12px; line-height: 1.4; }
.msg small { display: block; font-size: 0.72rem; color: var(--muted); }
.msg p { font-size: 0.92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.boss { background: var(--blue-soft); border-bottom-left-radius: 4px; justify-self: start; }
.msg.mine { background: var(--green-soft); border-bottom-right-radius: 4px; justify-self: end; }
.review { border-color: #d3e0ee; }

/* breakdowns */
.problem { font-size: 1.05rem; margin: 10px 0; white-space: pre-wrap; }
.steps { display: grid; gap: 8px; margin: 12px 0; }
.step { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: center; color: var(--muted); }
.step b { color: var(--ink); font-weight: 600; }
.step .dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid #cfcdc3; }
.step.on .dot { border-color: var(--green); background: var(--green); }
.timeline { display: grid; gap: 0; }
.tl { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.tl:last-child { border-bottom: 0; }
.tl-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tl p { white-space: pre-wrap; }

/* assets */
.check-card { display: grid; gap: 10px; }
.check-card.done { display: flex; align-items: center; gap: 8px; color: var(--green); font-weight: 700; }
.check-top { display: flex; gap: 12px; align-items: center; }
.check-top .thumb { width: 72px; height: 72px; flex: none; }

/* manager */
.day-nav { display: flex; gap: 8px; align-items: center; justify-content: center; }
.day-nav .input { flex: 0 1 auto; width: auto; min-height: 40px; font-size: 0.95rem; }
.missing { border-color: #f1d3cf; background: #fffafa; }
.missing ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.all-good { border-color: #cfe6d7; background: #f8fcf9; color: var(--green-dark); font-weight: 600; }
.att-row { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.att-row:last-child { border-bottom: 0; }
.att-name { display: flex; gap: 8px; align-items: baseline; }
.att-punches { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.att-p { display: flex; gap: 8px; align-items: center; }
.att-p small { display: block; color: var(--muted); font-size: 0.8rem; }
.att-p .badge { margin-top: 2px; margin-right: 3px; }
.worker-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.ws { display: grid; justify-items: center; gap: 2px; text-align: center; font-size: 0.85rem; }
.ws small { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; display: grid; gap: 4px; }
.stat small { color: var(--muted); font-size: 0.85rem; }
.stat b { font-size: 1.15rem; }
.stat.hi b { color: var(--green); }
.stat.bad b { color: var(--red); }
.stats.big .stat b { font-size: 1.4rem; }
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: #f7f6f1; font-weight: 700; color: var(--muted); }
tr.dim td { color: #a2a8a4; }
tr.sum td { font-weight: 800; }

/* admin */
.staff-card { display: grid; gap: 10px; }
.staff-card.off { opacity: 0.6; }
.staff-top { display: flex; gap: 12px; align-items: flex-start; }
.me { display: grid; justify-items: center; gap: 6px; text-align: center; }
.me-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.me-ic .ic { width: 34px; height: 34px; }

/* toast */
/* messages: a light card with a small coloured icon */
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 120; transform: translate(-50%, 12px); display: flex; align-items: flex-start; gap: 10px; width: max-content; max-width: min(440px, calc(100% - 32px)); padding: 12px 16px 12px 12px; border-radius: 12px; background: #fff; color: var(--ink); border: 1px solid var(--line); font-size: 0.92rem; font-weight: 500; line-height: 1.4; box-shadow: 0 12px 32px rgba(20, 30, 25, 0.16), 0 2px 6px rgba(20, 30, 25, 0.08); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none; margin-top: -1px; }
.toast-ic .ic { width: 15px; height: 15px; stroke-width: 2.4; }
.toast.error { border-color: #f1d3cf; }
.toast.error .toast-ic { background: var(--red-soft); color: var(--red); }
.toast.ok .toast-ic { background: var(--green-soft); color: var(--green); }
.toast.info .toast-ic { background: var(--blue-soft); color: var(--blue); }

@media (min-width: 700px) {
  .card { padding: 20px 24px; }
  .form { padding: 24px; gap: 22px; }
  .card.list { padding: 4px 0; }
}
@media (min-width: 900px) {
  body[data-mode='admin'] .page { max-width: 1040px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* Outside the work window: a calm locked card under the attendance card. */
.card.locked { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.card.locked strong { color: var(--ink); display: block; margin-bottom: 2px; }
.card.locked p { margin: 0; font-size: 0.92rem; }
.locked-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--hover); }
