/* ============================================================
   Cores da marca — ajuste aqui para bater com o app de ponto
   ============================================================ */
:root {
  --navy: #0f2a47;
  --navy-2: #173c63;
  --accent: #f2a42b;
  --accent-ink: #3a2500;
  --bg: #eef2f6;
  --card: #ffffff;
  --ink: #1a2633;
  --muted: #687889;
  --line: #dce3eb;
  --danger: #d0453f;
  --ok: #2a9a68;
  --p-alta: #d0453f;
  --p-media: #e19b1c;
  --p-baixa: #3b89cf;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 42, 71, .06), 0 6px 18px rgba(15, 42, 71, .07);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); margin: 0; }

/* ---------------- Topo ---------------- */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 4px solid var(--accent);
}
.brand { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-family: var(--head); font-weight: 800; letter-spacing: .14em; font-size: 1.15rem; }
.brand span { font-size: .8rem; opacity: .75; letter-spacing: .04em; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.clock span { font-family: var(--head); font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.clock small { font-size: .74rem; opacity: .75; }

.user-chip { position: relative; }
.user-chip > button {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1); border: 0; color: #fff;
  padding: 6px 12px 6px 6px; border-radius: 999px; cursor: pointer;
}
.user-chip > button:hover { background: rgba(255,255,255,.18); }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  background: #fff; color: var(--ink); border-radius: 10px; box-shadow: var(--shadow);
  min-width: 180px; padding: 6px; display: none;
}
.user-menu.open { display: block; }
.user-menu button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
}
.user-menu button:hover { background: var(--bg); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  background: var(--accent); color: var(--accent-ink);
  font: 700 .72rem var(--head);
}
.avatar.sm { width: 22px; height: 22px; font-size: .62rem; }
.avatar.none { background: var(--line); color: var(--muted); }

main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px 20px 40px; }
.foot { text-align: center; color: var(--muted); font-size: .78rem; padding: 14px; }

/* ---------------- Botões ---------------- */
.btn {
  border: 0; border-radius: 10px; cursor: pointer;
  padding: 11px 18px; font-family: var(--head); font-weight: 700;
  font-size: .82rem; letter-spacing: .06em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .06s, filter .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid #f0c9c7; }
.btn-danger:hover { background: #fdf0ef; }
.btn-sm { padding: 7px 11px; font-size: .7rem; border-radius: 8px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--navy); cursor: pointer; font-weight: 600; padding: 0; }

/* ---------------- Formulários ---------------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15,42,71,.1); }
textarea.input { resize: vertical; min-height: 90px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------------- Painéis centrais (login / unidade) ---------------- */
.panel {
  max-width: 440px; margin: 4vh auto 0; background: var(--card);
  border-radius: 18px; box-shadow: var(--shadow); padding: 34px 30px;
}
.panel h2 { font-size: 1.35rem; color: var(--navy); margin-bottom: 6px; }
.panel .lead { color: var(--muted); margin: 0 0 24px; font-size: .92rem; }
.err { color: var(--danger); font-size: .85rem; min-height: 1.2em; margin: 0 0 10px; }

.unit-list { display: grid; gap: 12px; }
.unit-btn {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border: 2px solid transparent; border-radius: 12px;
  padding: 18px 20px; cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s;
}
.unit-btn:hover { border-color: var(--navy); background: #fff; }
.unit-btn strong { font-family: var(--head); font-size: 1.1rem; letter-spacing: .08em; color: var(--navy); }
.unit-btn .tag { font-size: .7rem; color: var(--muted); display: block; margin-top: 2px; letter-spacing: 0; font-family: var(--body); }
.count {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px;
  display: inline-grid; place-items: center; background: var(--navy); color: #fff;
  font: 700 .8rem var(--head);
}
.count.zero { background: var(--line); color: var(--muted); }
.mine-shortcut { margin-top: 18px; }

/* ---------------- Quadro ---------------- */
.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.crumb { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.board-head h1 { font-size: 1.7rem; color: var(--navy); letter-spacing: .02em; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 8px; font-size: .7rem; }

.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.tabs { display: inline-flex; background: #fff; border-radius: 10px; padding: 4px; box-shadow: var(--shadow); }
.tabs button {
  border: 0; background: none; padding: 8px 16px; border-radius: 7px; cursor: pointer;
  font-weight: 600; color: var(--muted); font-size: .88rem;
}
.tabs button.on { background: var(--navy); color: #fff; }
.search { max-width: 280px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.empty {
  grid-column: 1 / -1; text-align: center; color: var(--muted);
  padding: 50px 20px; border: 2px dashed var(--line); border-radius: var(--radius);
}

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 16px 14px; cursor: pointer; position: relative;
  border-left: 5px solid var(--p-media); display: flex; flex-direction: column; gap: 10px;
  transition: transform .12s, box-shadow .12s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(15,42,71,.08), 0 14px 28px rgba(15,42,71,.1); }
.card.p-alta { border-left-color: var(--p-alta); }
.card.p-baixa { border-left-color: var(--p-baixa); }
.card.done { border-left-color: var(--ok); opacity: .92; }
.card h3 { font-family: var(--body); font-size: 1rem; font-weight: 600; line-height: 1.35; word-break: break-word; }
.card.done h3 { text-decoration: line-through; color: var(--muted); }
.card .desc { color: var(--muted); font-size: .85rem; margin: -4px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .75rem; }
.pill { padding: 3px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); font-weight: 600; white-space: nowrap; }
.pill.alta { background: #fbe6e5; color: var(--p-alta); }
.pill.media { background: #fdf1d9; color: #a5700b; }
.pill.baixa { background: #e3effa; color: var(--p-baixa); }
.pill.late { background: var(--danger); color: #fff; }
.pill.unit { background: var(--navy); color: #fff; }
.pill.mine { background: #fdf1d9; color: #8a5c05; }

.progress { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.progress-label { font-size: .72rem; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 4px; }

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.who { display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--ink); min-width: 0; }
.who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-actions { display: flex; gap: 6px; flex: none; }

/* ---------------- Modais ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(10, 25, 42, .55); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px; overflow-y: auto; animation: fade .15s;
}
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 560px;
  padding: 26px 26px 22px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: pop .18s ease-out;
}
.modal.wide { max-width: 720px; }
.modal h2 { font-size: 1.2rem; color: var(--navy); margin-bottom: 18px; padding-right: 30px; }
.modal .x {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: var(--bg); cursor: pointer; font-size: 1.2rem; line-height: 1;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.modal-actions .spacer { flex: 1; }
.alert-icon {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 12px;
  display: grid; place-items: center; background: #fdf1d9; color: #a5700b;
  font: 800 1.5rem var(--head);
}
.center { text-align: center; }

.section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 18px; }
.section h4 { margin: 0 0 10px; font: 700 .78rem var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.assign-row { display: flex; gap: 8px; }
.assign-row select { flex: 1; }

.subs { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.sub {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--bg); border-radius: 10px;
}
.sub input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ok); flex: none; cursor: pointer; }
.sub .t { flex: 1; font-size: .9rem; word-break: break-word; }
.sub.done .t { text-decoration: line-through; color: var(--muted); }
.sub select { max-width: 150px; padding: 4px 6px; font-size: .78rem; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.sub .del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 0 4px; }
.sub .del:hover { color: var(--danger); }
.sub-add { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; }

.log { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow-y: auto; font-size: .8rem; }
.log li { padding: 6px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.log b { color: var(--ink); font-weight: 600; }
.info-line { font-size: .8rem; color: var(--muted); margin: -10px 0 16px; }

/* ---------------- Toast ---------------- */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: .9rem; opacity: 0; pointer-events: none; transition: .2s; z-index: 80;
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.error { background: var(--danger); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------------- Celular ---------------- */
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .clock { display: none; }
  .brand strong { font-size: 1rem; }
  main { padding: 20px 16px 32px; }
  .panel { padding: 26px 20px; }
  .row, .sub-add { grid-template-columns: 1fr; }
  .search { max-width: none; width: 100%; }
  .board-head h1 { font-size: 1.4rem; }
  .modal { padding: 22px 18px 18px; }
  .user-chip .name { display: none; }
}

/* ============================================================
   v2 — gerais, alvos, repetição, comentários, relatório, usuários
   ============================================================ */
:root {
  --warn: #d98b0b;
  --warn-bg: #fdf1d9;
  --ok-bg: #e2f4ea;
  --pend-bg: #fbe6e5;
}
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.hint { font-size: .8rem; color: var(--muted); margin: 6px 0 10px; line-height: 1.45; }
.lead-sm { color: var(--muted); font-size: .88rem; margin: 0 0 14px; }
.ok-text { color: var(--ok); }
.link-btn.danger { color: var(--danger); }
.input.invalid { border-color: var(--danger); }
.btn-warn { background: var(--warn-bg); color: #8a5c05; }
.btn-warn:hover { background: #fbe6b8; }
.count.ok { background: var(--ok); }
.count.warn { background: var(--warn); }

/* início */
.unit-btn.mine { border-color: #c9d4e0; }
.unit-btn.geral { background: var(--navy); margin-top: 6px; }
.unit-btn.geral strong { color: #fff; }
.unit-btn.geral .tag { color: rgba(255,255,255,.7); }
.unit-btn.geral .count { background: var(--accent); color: var(--accent-ink); }
.unit-btn.geral .count.zero { background: rgba(255,255,255,.15); color: rgba(255,255,255,.7); }
.unit-btn.geral:hover { background: var(--navy-2); border-color: var(--accent); }
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.home-actions .btn { padding: 11px 10px; letter-spacing: .03em; white-space: nowrap; }
.home-actions .count { min-width: 24px; height: 24px; font-size: .72rem; }
.users-link { display: block; margin: 16px auto 0; font-size: .85rem; }

/* filtro de funcionários (admin) */
.staff-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow);
  padding: 10px 12px; margin-bottom: 16px;
}
.staff-label { font-size: .78rem; color: var(--muted); font-weight: 600; margin-right: 4px; }
.staff-bar button {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line);
  background: #fff; border-radius: 999px; padding: 5px 12px 5px 6px; cursor: pointer; font-size: .85rem;
}
.staff-bar button:first-of-type { padding-left: 12px; }
.staff-bar button.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* pills extras */
.pill.scope-pessoas { background: #ece9f8; color: #5b4bb1; }
.pill.scope-unidade { background: #e3effa; color: #2f6fa8; }
.pill.scope-geral { background: var(--navy); color: #fff; }
.pill.repeat { background: #e6f4f1; color: #23806b; }

.partial-note {
  background: var(--warn-bg); color: #6b4700; border-radius: 8px;
  padding: 7px 10px; font-size: .8rem; line-height: 1.4;
}

/* responsáveis no card */
.people { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.person {
  display: inline-flex; align-items: center; gap: 5px; font-size: .78rem;
  background: var(--bg); border-radius: 999px; padding: 2px 9px 2px 2px;
}
.person.st-concluida { background: var(--ok-bg); color: #1d6e4a; }
.person.st-concluida .avatar { background: var(--ok); color: #fff; }
.people-count { font-size: .72rem; color: var(--muted); }
.units-status { display: flex; flex-wrap: wrap; gap: 6px; }
.ustat { font-size: .74rem; border-radius: 8px; padding: 4px 8px; border: 1.5px solid transparent; }
.ustat b { font-weight: 700; }
.ustat.st-pendente { background: var(--pend-bg); color: #9b302b; }
.ustat.st-parcial { background: var(--warn-bg); color: #8a5c05; }
.ustat.st-concluida { background: var(--ok-bg); color: #1d6e4a; }
.ustat.hl { border-color: currentColor; }
.foot-info { font-size: .78rem; color: var(--muted); }
.card-actions { flex-wrap: wrap; justify-content: flex-end; }

/* formulário: quem */
.flabel { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; border-radius: 7px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg input:focus-visible + span { outline: 2px solid var(--navy); }
.picker { display: grid; gap: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; }
.picker-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.picker-items { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span {
  display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: .85rem;
  border: 1.5px solid var(--line); background: #fff; transition: .12s;
}
.chip-check input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-check input:checked + span::before { content: '✓ '; }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); }
[hidden] { display: none !important; }

/* detalhe */
.repeat-box {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #e6f4f1; color: #1d6656; border-radius: 10px; padding: 9px 12px; font-size: .85rem; margin-bottom: 4px;
}
.section.first { border-top: 0; margin-top: 4px; padding-top: 4px; }
.section-head { display: flex; justify-content: space-between; align-items: center; }
.section-head h4 { margin-bottom: 10px; }
.section-head .link-btn { font-size: .85rem; margin-bottom: 10px; }
.tlist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.trow { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.trow.st-concluida { background: var(--ok-bg); }
.trow.st-concluida .avatar { background: var(--ok); color: #fff; }
.trow.st-parcial { background: var(--warn-bg); }
.trow-main { flex: 1; min-width: 0; font-size: .9rem; }
.trow-main small { display: block; color: var(--muted); font-size: .76rem; margin-top: 2px; }
.trow-note { margin-top: 5px; font-size: .82rem; background: rgba(255,255,255,.7); border-radius: 7px; padding: 5px 8px; }
.trow-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.st-badge { font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #fff; color: var(--muted); white-space: nowrap; }
.st-concluida .st-badge { color: var(--ok); }
.st-parcial .st-badge { color: #8a5c05; }
.st-pendente .st-badge { color: #9b302b; }
#retarget { margin-top: 10px; display: grid; gap: 10px; }

.comments { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 10px; }
.comments li[data-id] { display: flex; gap: 10px; }
.c-body { flex: 1; background: var(--bg); border-radius: 0 12px 12px 12px; padding: 8px 12px; min-width: 0; }
.c-head { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.c-head small { color: var(--muted); }
.c-head .del { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.c-head .del:hover { color: var(--danger); }
.c-text { font-size: .9rem; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.comment-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.comment-add textarea { min-height: 44px; }
details.section summary { cursor: pointer; list-style: none; }
details.section summary::-webkit-details-marker { display: none; }
details.section summary h4 { display: inline; margin: 0; }
details.section summary::after { content: ' ›'; color: var(--muted); }
details[open].section summary::after { content: ' ⌄'; }
details .log { margin-top: 10px; }
.overlay.stack { z-index: 60; background: rgba(10, 25, 42, .35); }

/* relatório */
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav .input { width: auto; padding: 8px 10px; }
.report-date { font: 700 .95rem var(--head); color: var(--muted); margin: 0 0 12px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.report-unit { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.report-unit header {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--muted);
}
.report-unit header h3 { color: var(--navy); font-size: 1rem; letter-spacing: .08em; }
.report-unit header .count { min-width: 22px; height: 22px; font-size: .7rem; }
.report-unit ul { list-style: none; margin: 0; padding: 6px; }
.rrow { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.rrow:hover { background: var(--bg); }
.rtime { font: 700 .8rem var(--head); color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.rmain { flex: 1; min-width: 0; font-size: .88rem; }
.rmain small { display: block; color: var(--muted); font-size: .75rem; margin-top: 2px; }
.rrow.st-parcial .trow-note { background: var(--warn-bg); }
.rrow .st-badge { background: var(--ok-bg); }
.rrow.st-parcial .st-badge { background: var(--warn-bg); }

/* usuários */
.table-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.users-table th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.users-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.uname { display: inline-flex; align-items: center; gap: 8px; }
.users-table td { vertical-align: middle; }
.users-table tr.inactive td { color: var(--muted); }
.users-table tr:last-child td { border-bottom: 0; }
.tactions { text-align: right; }
.tactions .btn { margin-left: 4px; }
.check-line { display: flex; gap: 8px; align-items: center; font-size: .9rem; margin: 4px 0 10px; }

@media (max-width: 640px) {
  .home-actions { grid-template-columns: 1fr; }
  .comment-add { grid-template-columns: 1fr; }
  .trow { flex-wrap: wrap; }
  .trow-actions { width: 100%; justify-content: flex-start; padding-left: 32px; }
}

@media print {
  .topbar, .foot, .no-print, .crumb, #modal-root, #toast { display: none !important; }
  body { background: #fff; }
  .report-unit { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}

/* ============================================================
   IDENTIDADE VISUAL SMART IDIOMAS (igual ao app de ponto)
   ============================================================ */
:root {
  --head: 'Arial Black', 'Arial Bold', Gadget, Arial, sans-serif;
  --body: Arial, Helvetica, sans-serif;
  --navy: #032861;
  --navy-2: #143566;
  --navy-deep: #001f50;
  --red: #df1019;
  --red-1: #ec1620;
  --red-2: #d10811;
  --accent: var(--red);
  --accent-ink: #fff;
  --on-navy: #c6cfdb;
  --on-navy-muted: #5b7294;
  --line: #e2e6eb;
  --radius: 18px;
  --shadow: 0 2px 4px rgba(0, 15, 45, .12), 0 12px 32px rgba(0, 15, 45, .22);
}

body {
  background: linear-gradient(160deg, #052b66 0%, #032861 45%, #001f50 100%) fixed;
  color: var(--ink);
}
h1, h2, h3 { font-family: var(--head); font-weight: 900; }

/* topo */
.topbar { background: transparent; border-bottom: 1px solid rgba(255,255,255,.08); padding: 16px 28px; }
.brand strong { font-family: var(--head); font-weight: 900; letter-spacing: .06em; font-size: 1.35rem; }
.brand span { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; color: var(--on-navy); opacity: 1; }
.clock span { font-family: var(--head); font-weight: 900; }
.clock small { color: var(--on-navy); opacity: 1; }
.user-chip > button { background: var(--navy-2); border: 1px solid rgba(255,255,255,.15); }
.user-chip > button:hover { background: #1b417a; }
.avatar { background: var(--red); color: #fff; font-family: var(--body); font-weight: 700; }
.foot { color: var(--on-navy-muted); }

/* tela de login igual ao ponto */
.logged-out .topbar { display: none; }
.hero { text-align: center; color: #fff; margin: 6vh auto 28px; }
.hero-brand { font-size: clamp(2.2rem, 6vw, 4rem); letter-spacing: .06em; line-height: 1; }
.hero-sub { margin: 10px 0 0; letter-spacing: .14em; color: var(--on-navy); font-size: clamp(.85rem, 1.6vw, 1.3rem); }
.hero-clock { font-family: var(--head); font-weight: 900; font-size: clamp(3.5rem, 11vw, 7.5rem); line-height: 1; margin-top: 4vh; font-variant-numeric: tabular-nums; }
.hero-date { color: var(--on-navy); font-size: clamp(1rem, 2vw, 1.6rem); margin: 14px 0 0; }
.hero-title { font-size: clamp(1.4rem, 3vw, 2.4rem); margin-top: 5vh; font-family: var(--body); font-weight: 700; }
.panel { border-radius: 24px; }
.login-panel { max-width: 560px; margin-top: 0; padding: 30px; }

/* botões no padrão do ponto */
.btn { font-family: var(--body); font-weight: 900; letter-spacing: .06em; border-radius: 12px; }
.btn-primary, .btn-accent {
  background: linear-gradient(135deg, var(--red-1), var(--red-2));
  color: #fff;
  box-shadow: 0 8px 22px rgba(223, 16, 25, .28);
}
.btn-primary:hover, .btn-accent:hover { background: linear-gradient(135deg, #f42a33, var(--red-2)); filter: none; }
.btn-block { padding: 18px; font-size: 1.05rem; }
.btn-sm { box-shadow: none; }
.btn-ghost { color: var(--navy); }
.btn-ghost:hover { border-color: var(--navy); }

/* elementos sobre o fundo azul */
.board-head h1 { color: #fff; letter-spacing: .04em; }
.subtitle, .report-date { color: var(--on-navy); }
.crumb .link-btn { color: var(--on-navy); }
.crumb .link-btn:hover { color: #fff; }
.board-head .btn-ghost {
  background: var(--navy-2); color: #dce6f5; border: 1px solid rgba(255,255,255,.18);
}
.board-head .btn-ghost:hover { background: #1b417a; border-color: rgba(255,255,255,.35); }
.empty { color: var(--on-navy); border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.03); }
.users-link { color: var(--navy); }

/* abas, busca e filtro */
.tabs { border-radius: 12px; }
.tabs button.on { background: var(--navy); }
.search { border-color: transparent; }
.staff-bar button.on { background: var(--red); border-color: var(--red); }
.staff-bar button.on .avatar { background: #fff; color: var(--red); }

/* início */
.unit-btn { border-radius: 14px; }
.unit-btn strong { font-family: var(--head); font-weight: 900; }
.unit-btn:hover { border-color: var(--red); }
.unit-btn.geral { background: linear-gradient(135deg, var(--navy-2), var(--navy)); }
.unit-btn.geral .count { background: var(--red); color: #fff; }
.count { background: var(--navy); font-family: var(--body); font-weight: 700; }
.badge-count { background: var(--red); color: #fff; }

/* cards e janelas */
.card, .report-unit, .table-wrap, .staff-bar { border-radius: var(--radius); }
.card h3 { font-family: var(--body); font-weight: 700; }
.modal { border-radius: 24px; }
.modal h2 { color: var(--navy); }
.overlay { background: rgba(0, 18, 48, .7); }
.overlay.stack { background: rgba(0, 18, 48, .45); }
.input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(3, 40, 97, .12); }
.alert-icon { background: #fde7e8; color: var(--red); }
.chip-check input:checked + span { background: var(--navy); border-color: var(--navy); }

/* toast visível sobre o azul */
#toast { background: #fff; color: var(--navy); font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
#toast.error { background: var(--red); color: #fff; }

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .hero { margin-top: 4vh; }
  .login-panel { padding: 22px 18px; }
}

/* ============================================================
   v3 — login simples, horário, notificações
   ============================================================ */
.hero { margin: 12vh auto 34px; }
.hero-sub { font-size: clamp(1rem, 2vw, 1.5rem); letter-spacing: .3em; margin-top: 14px; }

/* horário */
.time-pick { display: flex; gap: 8px; align-items: center; }
.time-pick .input { flex: 1; min-width: 0; }
.time-pick .input:disabled { background: var(--bg); color: var(--muted); }
.time-pick .chip-check span { padding: 10px 14px; white-space: nowrap; }
.pill.due.today { background: #e3effa; color: var(--navy); }
.due-line { margin: -10px 0 14px; font-size: .88rem; font-weight: 700; color: var(--navy); }
.due-line.late { color: var(--red); }

/* sino */
.topbar-right { gap: 14px; }
#user-area { display: flex; align-items: center; gap: 10px; }
.bell-wrap { position: relative; }
.bell {
  position: relative; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: #fff;
  background: var(--navy-2); border: 1px solid rgba(255,255,255,.15);
}
.bell:hover { background: #1b417a; }
.bell-badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: #f2a42b; color: #2a1a00; font: 700 .7rem var(--body);
  display: grid; place-items: center; border: 2px solid var(--navy);
}
.bell-badge.urgent { background: var(--red); color: #fff; }
.bell-panel {
  position: absolute; right: -60px; top: calc(100% + 10px); z-index: 40; width: 360px; max-width: calc(100vw - 24px);
  background: #fff; color: var(--ink); border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.3);
  display: none; overflow: hidden;
}
.bell-panel.open { display: block; }
.np-head { padding: 14px 16px; border-bottom: 1px solid var(--line); font-family: var(--head); color: var(--navy); }
.np-body { max-height: 70vh; overflow-y: auto; padding: 8px; display: grid; gap: 6px; }
.np-body > .btn, .np-body > .hint { margin: 6px 8px; width: auto; }
.np-empty { text-align: center; color: var(--muted); padding: 24px 10px; margin: 0; }
.ns h5 {
  margin: 8px 8px 4px; font: 700 .7rem var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  display: flex; gap: 6px; align-items: center;
}
.ns h5 span { background: var(--bg); border-radius: 999px; padding: 1px 7px; }
.ns.late h5 { color: var(--red); }
.ns.fresh h5 { color: var(--navy); }
.ns ul { list-style: none; margin: 0; padding: 0; }
.ns li { padding: 9px 10px; border-radius: 10px; cursor: pointer; display: grid; gap: 2px; }
.ns li:hover { background: var(--bg); }
.ns li b { font-size: .9rem; font-weight: 700; }
.ns li small { font-size: .74rem; color: var(--muted); }
.ni-time { font-size: .72rem; font-weight: 700; color: var(--navy); }
.ni-time.late { color: var(--red); }

#toast { max-width: calc(100vw - 32px); text-align: center; }

@media (max-width: 640px) {
  .bell-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
  .time-pick { flex-wrap: wrap; }
}

/* ============================================================
   v4 — anexos, modelos, painel, modo TV, instalar
   ============================================================ */
.muted { color: var(--muted); display: block; font-size: .74rem; margin-left: 30px; }
.home-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 18px; }
.home-links .link-btn { font-size: .88rem; padding: 4px 2px; }
.home-links .link-btn:hover { color: var(--red); }

/* anexos */
.files { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.files li { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: 12px; padding: 8px 10px; }
.files img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; background: #fff; }
.ficon {
  width: 44px; height: 44px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--navy); color: #fff; font: 700 .7rem var(--body); letter-spacing: .04em;
}
.fmain { flex: 1; min-width: 0; }
.fmain a { color: var(--navy); font-weight: 700; font-size: .9rem; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmain a:hover { text-decoration: underline; }
.fmain small { color: var(--muted); font-size: .74rem; }
.files .del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; }
.files .del:hover { color: var(--red); }
.upload-btn {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer;
  border: 2px dashed var(--line); border-radius: 12px; padding: 12px 14px; color: var(--navy);
}
.upload-btn:hover { border-color: var(--navy); }
.upload-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.upload-btn span { font-weight: 700; }
.upload-btn small { color: var(--muted); }
a.btn { text-decoration: none; }

/* modelos */
.tpl-subs { margin: 0; padding-left: 18px; font-size: .84rem; color: var(--muted); display: grid; gap: 2px; }

/* painel */
.date-range { display: flex; align-items: center; gap: 8px; color: var(--on-navy); font-size: .85rem; }
.date-range .input { width: auto; padding: 9px 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi span { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi b { font: 900 2.2rem var(--head); color: var(--navy); line-height: 1.15; }
.kpi.bad b { color: var(--red); }
.panel-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; overflow-x: auto; }
.panel-box h3 { color: var(--navy); font-size: 1rem; margin-bottom: 12px; letter-spacing: .04em; }
.stat-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.stat-table th { text-align: left; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stat-table td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-table tr:last-child td { border-bottom: 0; }
.stat-table .wide { width: 45%; min-width: 180px; }
.stat-table td.bad { color: var(--red); font-weight: 700; }
.barcell { display: flex; align-items: center; gap: 10px; }
.barcell span { min-width: 2ch; font-weight: 700; color: var(--ink); }
.hbar { flex: 1; height: 10px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--navy); border-radius: 0 4px 4px 0; }
.vchart { display: grid; grid-template-columns: repeat(var(--n), minmax(18px, 1fr)); gap: 4px; height: 180px; align-items: end; min-width: calc(var(--n) * 22px); }
.vcol { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.vbar { width: 70%; max-width: 34px; background: var(--navy); border-radius: 4px 4px 0 0; min-height: 0; }
.vcol:hover .vbar { background: var(--red); }
.vval { font-size: .72rem; font-weight: 700; color: var(--ink); }
.vlab { font-size: .64rem; color: var(--muted); white-space: nowrap; }

/* modo TV */
.tv-mode .topbar, .tv-mode .foot { display: none; }
.tv-mode main { max-width: none; padding: 0; }
.tv { min-height: 100vh; padding: 24px 28px; color: #fff; display: flex; flex-direction: column; gap: 20px; }
.tv-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.tv-brand { display: flex; flex-direction: column; }
.tv-brand b { font: 900 clamp(1.4rem, 2.4vw, 2.2rem) var(--head); letter-spacing: .05em; }
.tv-brand span { color: var(--on-navy); letter-spacing: .2em; font-size: .9rem; }
.tv-clock { text-align: center; }
.tv-clock b { display: block; font: 900 clamp(2.6rem, 6vw, 5rem) var(--head); line-height: 1; font-variant-numeric: tabular-nums; }
.tv-clock span { color: var(--on-navy); font-size: 1.05rem; }
.tv-actions { justify-self: end; display: flex; gap: 8px; opacity: .35; transition: opacity .2s; }
.tv-actions:hover { opacity: 1; }
.tv-actions .btn-ghost { background: var(--navy-2); color: #dce6f5; border: 1px solid rgba(255,255,255,.2); }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; flex: 1; align-items: start; }
.tv-col { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 22px; padding: 18px; }
.tv-col h2 { font-size: clamp(1.3rem, 2vw, 1.9rem); letter-spacing: .06em; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.tv-count { font: 400 .95rem var(--body); color: var(--on-navy); letter-spacing: 0; }
.tv-count b { color: #7ee2b0; }
.tv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tv-list li { display: flex; gap: 14px; align-items: center; background: #fff; color: var(--ink); border-radius: 14px; padding: 12px 14px; border-left: 6px solid var(--navy-2); }
.tv-list li.partial { border-left-color: var(--warn); }
.tv-list li.late { border-left-color: var(--red); }
.tv-list li.late .tv-time { color: var(--red); }
.tv-time { font: 900 1.15rem var(--head); color: var(--navy); min-width: 78px; }
.tv-list b { display: block; font-size: 1.12rem; line-height: 1.25; }
.tv-list small { color: var(--muted); font-size: .9rem; }
.tv-list .tv-empty { justify-content: center; color: var(--ok); font-weight: 700; border-left-color: var(--ok); }
.tv-done { margin-top: 14px; }
.tv-done h3 { font: 700 .8rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--on-navy); margin-bottom: 6px; }
.tv-done p { margin: 4px 0; color: #b9f0d3; font-size: 1rem; }
.tv-done small { color: var(--on-navy); }
.tv-more { margin: 12px 0 0; color: var(--on-navy); font-size: .9rem; }

@media (max-width: 640px) {
  .date-range { width: 100%; }
  .date-range .input { flex: 1; }
  .tv-head { grid-template-columns: 1fr; text-align: center; }
  .tv-brand { align-items: center; }
  .tv-actions { justify-self: center; opacity: 1; }
}

/* correções */
html { background: var(--navy-deep); }
.date-range .input, .search, .toolbar .input { color: var(--ink); }
