/* Ponto Famivita — protótipo.
   Tokens e shell copiados de "Operações Famivita" (operacoes-app.css):
   papel de livro-razão com acento teal; âmbar para avisos, vermelho para bloqueios. */
:root {
  --bg: #f6f7f5; --panel: #ffffff; --fg: #1d2422; --muted: #5d6966; --line: #d9dfdc;
  --accent: #17766b; --accent-soft: #e1f0ed; --warn: #9a5b00; --warn-soft: #fbefd9;
  --risk: #a2322b; --risk-soft: #f8e3e1; --ok: #2e7d4f; --ok-soft: #e3f3e8;
  --focus: #17766b66; --on-accent: #fff; --shadow: 0 8px 24px #0002;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --topbar: 48px; --sidebar: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141917; --panel: #1b2220; --fg: #e4ebe8; --muted: #9aa8a4; --line: #2e3835;
    --accent: #4fbfae; --accent-soft: #183531; --warn: #e8b25a; --warn-soft: #3a2d17;
    --risk: #ec8a82; --risk-soft: #3d1f1d; --ok: #7fd3a0; --ok-soft: #1a3324; --focus: #4fbfae66;
    --on-accent: #0f1513; --shadow: 0 8px 24px #0008;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141917; --panel: #1b2220; --fg: #e4ebe8; --muted: #9aa8a4; --line: #2e3835;
  --accent: #4fbfae; --accent-soft: #183531; --warn: #e8b25a; --warn-soft: #3a2d17;
  --risk: #ec8a82; --risk-soft: #3d1f1d; --ok: #7fd3a0; --ok-soft: #1a3324; --focus: #4fbfae66;
  --on-accent: #0f1513; --shadow: 0 8px 24px #0008;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); } .neg { color: var(--risk); font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { line-height: 1.25; }

/* ---------- Faixa do protótipo ---------- */
.proto-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 16px; font-size: 12px;
  background: var(--warn-soft); border-bottom: 1px solid var(--warn); color: var(--fg); }
.proto-bar strong { font: 600 11px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--warn); }
.proto-bar select { font-size: 12px; padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); max-width: 100%; }
.proto-bar label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }

/* ---------- Shell (igual Operações) ---------- */
.app { display: flex; flex-direction: column; height: 100%; }
.topbar { flex: 0 0 var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.brand { font-weight: 600; text-decoration: none; color: var(--fg); white-space: nowrap; }
.brand span { color: var(--accent); }
.topbar-status { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.user .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.role { font: 500 11px/1.6 var(--mono); padding: 0 6px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.link-button { background: none; border: 0; padding: 4px; color: var(--accent); cursor: pointer; text-decoration: underline; }
.icon-button { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer; min-width: 28px; min-height: 28px; color: var(--fg); }
.icon-button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.icon-button:disabled { opacity: .4; cursor: not-allowed; }
.icon-button svg, .button svg { width: 16px; height: 16px; flex: none; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 12px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--fg); white-space: nowrap; }
.button:hover:not(:disabled) { border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button.danger { color: var(--risk); border-color: var(--risk); }
.button.danger.solid { background: var(--risk); color: var(--on-accent); }
.button.small { padding: 2px 8px; font-size: 12px; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.block { width: 100%; }

.layout { flex: 1; display: flex; min-height: 0; }
.sidebar { flex: 0 0 var(--sidebar); overflow-y: auto; border-right: 1px solid var(--line); background: var(--panel); padding: 8px 0 24px; }
.sidebar h2 { font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 16px 6px; }
.sidebar a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 16px; color: var(--fg); text-decoration: none; border-left: 3px solid transparent; }
.sidebar a:hover { background: var(--bg); }
.sidebar a[aria-current="page"] { border-left-color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.sidebar a .count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.sidebar a .count.alert { color: var(--risk); font-weight: 600; }
.main { flex: 1; min-width: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; }
#content { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; min-width: 0; }
.panel > h2:first-child:not(.section-title), .panel-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.panel.tight { padding: 12px; }
.view-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.view-header h1 { margin: 0; font-size: 18px; font-weight: 600; }
.view-header .spacer { flex: 1; }
.view-meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.breadcrumb { font-size: 12px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.banner { padding: 8px 12px; border-radius: 6px; background: var(--warn-soft); color: var(--fg); border: 1px solid var(--warn); font-size: 13px;
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.banner.info { background: var(--accent-soft); border-color: var(--accent); }
.banner.error { background: var(--risk-soft); border-color: var(--risk); }
.banner.ok { background: var(--ok-soft); border-color: var(--ok); }
.banner svg { width: 16px; height: 16px; flex: none; }
.banner .grow { flex: 1; min-width: 12ch; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.only-narrow { display: none; }
@media (max-width: 760px) {
  .only-narrow { display: inline-flex; }
  .sidebar { position: fixed; top: var(--topbar); bottom: 0; left: 0; z-index: 20; width: min(85vw, 320px);
    transform: translateX(-102%); transition: transform .15s ease; box-shadow: var(--shadow); }
  .app.has-proto .sidebar { top: calc(var(--topbar) + var(--proto-h, 26px)); }
  .app.menu-open .sidebar { transform: none; }
  .main { padding: 12px 16px; }
  .user .email, .topbar-status { display: none; }
}

/* ---------- Pílulas, chips, contadores ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; font: 600 11px/1.7 var(--mono); padding: 0 8px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.risk { background: var(--risk-soft); color: var(--risk); }
.pill.neutral { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px;
  background: var(--panel); cursor: pointer; font-size: 13px; }
.chip b { font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.occ { display: inline-block; font-size: 12px; padding: 1px 6px; border-radius: 4px; margin: 0 4px 4px 0; background: var(--bg);
  border: 1px solid var(--line); color: var(--muted); }
.occ.feriado, .occ.afast { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.occ.impar, .occ.falta { background: var(--risk-soft); border-color: transparent; color: var(--risk); font-weight: 500; }
.occ.atraso, .occ.fora, .occ.inter { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.occ.extra { background: var(--ok-soft); border-color: transparent; color: var(--ok); }

/* ---------- Cartões de indicadores ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
  text-decoration: none; color: var(--fg); min-width: 0; }
a.stat:hover { border-color: var(--accent); }
.stat .label { font: 600 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .value small { font-size: 15px; color: var(--muted); font-weight: 500; }
.stat .hint { font-size: 12px; color: var(--muted); }
.stat.risk { border-color: var(--risk); } .stat.risk .value { color: var(--risk); }
.stat.warn { border-color: var(--warn); } .stat.warn .value { color: var(--warn); }
.stat .pair { display: flex; gap: 16px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.stat .pair span b { font-size: 20px; }

/* ---------- Tabelas: simples, compactas, tabular-nums ---------- */
.table-wrap { min-width: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover { background: color-mix(in srgb, var(--bg) 70%, transparent); }
.table .right { text-align: right; }
.table .center { text-align: center; }
.table .nowrap { white-space: nowrap; }
.table tr.row-risk td { background: var(--risk-soft); }
.table tr.row-muted td { color: var(--muted); }
.table tr.row-today td { background: var(--accent-soft); }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions .icon-button { margin-left: 2px; }
.table input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
@media (max-width: 760px) {
  .rt thead { display: none; }
  .rt, .rt tbody, .rt tr, .rt td { display: block; width: 100%; }
  .rt tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; padding: 6px 4px; background: var(--panel); }
  .rt td { border: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 3px 8px; text-align: right; }
  .rt td > * { min-width: 0; }
  .rt td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; max-width: 45%; }
  .rt td[data-label=""]::before { content: none; }
  .rt td.right, .rt td.center, .rt .actions { text-align: right; }
  .rt td.empty { justify-content: center; }
  .rt tr.row-risk { background: var(--risk-soft); }
  .rt tr.row-risk td, .rt tr.row-today td { background: transparent; }
  .rt tr.row-today { background: var(--accent-soft); }
}

/* ---------- Formulários ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label, .field > .label, fieldset > legend { font-size: 12px; font-weight: 600; color: var(--muted); }
.field .help { font-size: 12px; color: var(--muted); }
input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], select, textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--panel); min-width: 0; width: 100%; max-width: 100%; }
textarea { min-height: 72px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--accent); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--risk); }
input[readonly] { background: var(--bg); color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0; min-width: 0; }
.radio-row, .check-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.radio-row label, .check-row label, .check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); }
.form-error { color: var(--risk); font-size: 13px; margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.filters .field { min-width: 150px; flex: 1 1 150px; max-width: 260px; }
.section-title { font: 600 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.check-list { max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; display: grid; gap: 4px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* Interruptor (toggle) */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 34px; height: 20px; margin: 0; cursor: pointer; }
.switch .track { width: 34px; height: 20px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--panel);
  box-shadow: 0 1px 2px #0003; transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Diálogos (modal e gaveta lateral) ---------- */
dialog.modal { border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--panel); color: var(--fg);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow); }
dialog.modal.wide { width: min(900px, calc(100vw - 24px)); }
dialog::backdrop { background: #0006; }
.modal-inner { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.modal-inner > header, .drawer-inner > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-inner h2, .drawer-inner h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-inner > footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(440px, 100vw); border: 0; border-left: 1px solid var(--line);
  padding: 0; background: var(--panel); color: var(--fg); box-shadow: var(--shadow); }
.drawer-inner { display: flex; flex-direction: column; height: 100%; }
.drawer-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }

/* Lista de definições compacta */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 0; margin: 0; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { padding-left: 16px; margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.dl .total { font-weight: 600; border-top: 1px solid var(--line); padding-top: 6px; }

/* Toast */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100;
  width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 6px; font-size: 13px; box-shadow: var(--shadow); animation: toast-in .15s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Batidas (apuração) ---------- */
.punches { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.punch { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel);
  font: 500 13px/1.5 var(--mono); font-variant-numeric: tabular-nums; cursor: pointer; color: var(--fg); }
.punch:hover { border-color: var(--accent); }
.punch .k { font-size: 10px; font-weight: 600; color: var(--muted); }
.punch svg { width: 12px; height: 12px; color: var(--muted); }
.punch .tag { font: 500 10px/1 var(--font); color: var(--accent); }
.punch.adj { border-style: dashed; border-color: var(--accent); }
.punch.fora { border-color: var(--warn); background: var(--warn-soft); }
.punch.fora svg.pin { color: var(--warn); }
.punch.desc { text-decoration: line-through; opacity: .55; border-style: dotted; }
.punch.missing { border-style: dashed; border-color: var(--risk); color: var(--risk); cursor: default; background: transparent; }
.res { display: grid; grid-template-columns: auto auto; gap: 0 10px; font-size: 12px; font-variant-numeric: tabular-nums; justify-content: start; }
.res dt { color: var(--muted); } .res dd { margin: 0; text-align: right; }
.apur-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; align-items: start; }
.apur-layout aside { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
@media (max-width: 1100px) { .apur-layout { grid-template-columns: minmax(0, 1fr); } .apur-layout aside { position: static; order: -1; } }
.emp-picker { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.emp-picker select { flex: 1; min-width: 0; max-width: 420px; }
.emp-picker input { flex: 1 1 140px; max-width: 220px; }
.comp-sel { display: inline-flex; align-items: center; gap: 8px; }
.comp-label { display: flex; flex-direction: column; line-height: 1.2; text-align: center; min-width: 150px; }
.comp-label span { font-size: 11px; font-variant-numeric: tabular-nums; }
.espelho-bar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.espelho-bar .who { display: flex; flex-direction: column; gap: 4px; }
.reasons { margin: 4px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); }

/* Mapa (placeholder) */
.map { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.map svg { display: block; width: 100%; height: auto; }
.map .map-caption { position: absolute; left: 8px; bottom: 6px; font: 11px var(--mono); color: var(--muted); }
.photo { width: 120px; height: 150px; border-radius: 50% / 45%; overflow: hidden; background: var(--accent-soft); display: grid; place-items: center; border: 1px solid var(--line); flex: none; }
.photo svg { width: 100%; height: 100%; }
.drawer-photo { display: flex; gap: 16px; align-items: center; }

/* Grade de escalas */
.week-grid { display: grid; grid-template-columns: 90px minmax(0, 1fr) 70px; gap: 6px 12px; align-items: center; }
.week-grid .h { font-size: 12px; color: var(--muted); font-weight: 600; }
.interval-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.interval-row input { width: 120px; }

/* Impressão do espelho */
.espelho-doc { font-size: 12px; }
.espelho-doc h3 { margin: 0 0 4px; font-size: 15px; }
.espelho-doc .head { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 16px; margin-bottom: 10px; }
.espelho-doc .sign { display: flex; gap: 32px; margin-top: 24px; flex-wrap: wrap; }
.espelho-doc .sign div { flex: 1; min-width: 160px; border-top: 1px solid var(--fg); padding-top: 4px; text-align: center; }
@media print {
  body.printing > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; padding: 0; color: #000; background: #fff; }
}

/* ---------- App do funcionário (celular) ---------- */
.app-body { display: flex; flex-direction: column; align-items: center; min-height: 100%; height: auto; }
.app-body .proto-bar { width: 100%; justify-content: center; }
.phone-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px; width: 100%; }
.phone { position: relative; width: 390px; height: 844px; max-height: calc(100vh - 72px); min-height: 560px; border: 1px solid var(--line);
  border-radius: 28px; overflow: hidden; display: flex; flex-direction: column; background: var(--bg); box-shadow: var(--shadow); }
@media (max-width: 480px) {
  .app-body { height: 100vh; height: 100dvh; }
  .phone-wrap { padding: 0; align-items: stretch; min-height: 0; }
  .phone { width: 100%; height: 100%; max-height: none; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .app-body .proto-bar { padding: 2px 8px; gap: 2px 8px; }
}
.phone-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.phone-top .title { font-weight: 600; font-size: 15px; }
.screen { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.screen.center { justify-content: center; text-align: center; }
.bottom-nav { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--panel); border-top: 1px solid var(--line); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 10px; font-size: 11px; color: var(--muted); text-decoration: none; position: relative; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.bottom-nav .badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 99px; background: var(--risk);
  color: #fff; font: 600 10px/16px var(--mono); padding: 0 4px; }
.company { text-align: center; font-size: 12px; color: var(--muted); letter-spacing: .02em; margin: 0; }
.clock { width: 230px; height: 230px; border-radius: 50%; border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 4px auto; background: var(--panel); }
.clock .time { font: 600 44px/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.clock .date { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center; padding: 0 16px; }
.loc-chip { display: inline-flex; align-items: center; gap: 6px; align-self: center; font-size: 12px; padding: 4px 10px; border-radius: 99px;
  background: var(--ok-soft); color: var(--ok); border: 1px solid transparent; text-align: left; }
.loc-chip.fora { background: var(--warn-soft); color: var(--warn); }
.loc-chip.ext { background: var(--accent-soft); color: var(--accent); }
.loc-chip svg { width: 14px; height: 14px; flex: none; }
.big-button { width: 100%; padding: 16px; font-size: 16px; font-weight: 600; border-radius: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.card h2, .card h3 { margin: 0; font-size: 14px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.list li:last-child { border-bottom: 0; }
.list .t { font: 600 15px var(--mono); font-variant-numeric: tabular-nums; }
.camera { position: relative; flex: 1; min-height: 380px; border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #6d7774 0%, #3b4341 55%, #1e2422 100%); display: grid; place-items: center; }
.camera svg.overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.camera .hint { position: absolute; top: 14px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; text-shadow: 0 1px 2px #000a; padding: 0 16px; }
.success-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: var(--on-accent); display: grid; place-items: center; margin: 0 auto; }
.success-icon svg { width: 40px; height: 40px; }
.receipt { font-size: 13px; }
.receipt .dl dd { word-break: break-all; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } .sidebar { transition: none; } }
.sheet-backdrop { position: absolute; inset: 0; background: #0006; display: flex; align-items: flex-end; z-index: 30; }
.sheet { width: 100%; background: var(--panel); border-radius: 16px 16px 0 0; padding: 16px; display: flex; flex-direction: column; gap: 12px; max-height: 90%; overflow-y: auto; }
.sheet h2 { margin: 0; font-size: 16px; }
.tips { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.tips li { display: flex; gap: 12px; align-items: flex-start; }
.tips .ic { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.tips .ic svg { width: 18px; height: 18px; }
.logo { display: flex; align-items: center; gap: 8px; justify-content: center; font-weight: 600; font-size: 20px; }
.logo > div span { color: var(--accent); }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.logo-mark svg { width: 22px; height: 22px; }
.day-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.day-row.odd { background: var(--risk-soft); margin: 0 -14px; padding: 8px 14px; }
.day-row .d { font-variant-numeric: tabular-nums; }
.day-row .d small { display: block; color: var(--muted); font-size: 11px; }
.day-row .p { font: 12px var(--mono); color: var(--fg); word-spacing: 2px; }
.day-row .s { font-variant-numeric: tabular-nums; text-align: right; font-weight: 500; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.seg label { border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 13px; display: flex; gap: 6px; align-items: center; cursor: pointer; background: var(--panel); }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Landing ---------- */
.landing { max-width: 720px; margin: 0 auto; padding: 48px 16px; display: flex; flex-direction: column; gap: 16px; }
.landing h1 { margin: 0; font-size: 24px; }
.landing .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.landing .cards a { text-decoration: none; color: var(--fg); }
.landing .cards a:hover { border-color: var(--accent); }
.landing .cards h2 { margin: 0 0 4px; font-size: 16px; color: var(--accent); }
.landing .cards p { margin: 0; color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
  .rt td .punches { justify-content: flex-end; }
  .rt td .res { justify-content: end; }
  .apur-layout .rt td:first-child { font-size: 15px; }
}
@media (min-width: 761px) {
  .apur-layout .table td:nth-child(3) { min-width: 210px; }
  .apur-layout .table td:nth-child(2) { max-width: 160px; }
}
@media (max-width: 760px) {
  .emp-picker input { flex: 1 1 100%; max-width: none; }
  .emp-picker select { flex: 1 1 0; min-width: 120px; }
  .proto-bar .proto-note { display: none; }
}
@media (max-width: 760px) {
  .rt td .cv { min-width: 0; flex: 1; text-align: right; }
  .rt td[data-label=""] .cv { text-align: left; }
  .rt td .cv .res { margin-left: auto; }
}
