:root {
  --navy: #14213d; --navy2: #1d2d50; --accent: #fca311; --bg: #f4f5f7; --card: #fff;
  --ink: #1b1f24; --muted: #6b7280; --line: #e5e7eb; --ok: #16a34a; --warn: #dc2626; --wait: #7c3aed;
  --radius: 14px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--navy2); }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin: 4px 0 10px; color: var(--ink); }
textarea { resize: vertical; }
label { display: block; font-size: 14px; color: var(--muted); }
label input, label select, label textarea { color: var(--ink); }
.splash, .loading { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; } .pad { padding: 4px 2px; }
.pre { white-space: pre-wrap; }

/* Topo e navegação */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; background: var(--navy); color: #fff; }
.top h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .brand { color: var(--accent); font-size: 20px; }
.top .back { color: #fff; text-decoration: none; font-size: 30px; line-height: 1; padding: 0 6px 4px 0; }
.top .who { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--navy); display: grid; place-items: center; font-weight: 700; text-decoration: none; }
.main { padding: 14px 12px calc(150px + var(--safe-b)); max-width: 760px; margin: 0 auto; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); z-index: 6; }
.tabs a { flex: 1; text-align: center; padding: 14px 0; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; }
.tabs a.on { color: var(--navy); font-weight: 700; box-shadow: inset 0 3px 0 var(--accent); }
.fab { position: fixed; right: 18px; bottom: calc(68px + var(--safe-b)); width: 66px; height: 66px; border-radius: 50%; border: 0; background: var(--accent); color: var(--navy); box-shadow: 0 6px 20px rgba(0,0,0,.25); display: grid; place-items: center; z-index: 7; cursor: pointer; }

/* Cartões e listas */
.greet { font-size: 20px; font-weight: 600; margin: 4px 4px 12px; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.card h2 { margin: 0 0 8px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.card h3 { font-size: 14px; color: var(--muted); margin: 14px 0 6px; }
.card.warn h2 { color: var(--warn); } .card.wait h2 { color: var(--wait); }
.card.subtle { background: transparent; box-shadow: none; display: flex; gap: 8px; flex-wrap: wrap; }
.card.empty { text-align: center; }
.count { background: var(--bg); color: var(--ink); border-radius: 20px; padding: 0 8px; font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.row:first-of-type { border-top: 0; }
.row small, .task small, .dec small { display: block; color: var(--muted); font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.pill { background: var(--navy); color: #fff; border-radius: 20px; padding: 1px 9px; font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--navy2); flex: none; }
.dot.t-pendencia { background: var(--wait); } .dot.t-decisao { background: var(--ok); }
.due { font-size: 13px; padding: 2px 8px; border-radius: 8px; background: var(--bg); white-space: nowrap; }
.due.late { background: #fee2e2; color: var(--warn); font-weight: 600; }
.due.today { background: #fef3c7; color: #92400e; font-weight: 600; }

/* Job */
.head .meta { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.notice { margin-top: 10px; padding: 10px; background: #fef3c7; border-radius: 10px; font-size: 14px; }
.task { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); }
.task .grow { cursor: pointer; }
.task.concluido b, .task.cancelado b { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.chk { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); background: #fff; color: #fff; flex: none; cursor: pointer; font-weight: 700; }
.task.concluido .chk { background: var(--ok); border-color: var(--ok); }
.st { font-size: 12px; background: var(--bg); padding: 1px 6px; border-radius: 6px; }
.st-aguardando_cliente { background: #ede9fe; color: var(--wait); } .st-em_andamento { background: #dbeafe; color: #1e40af; }
.src { color: var(--accent); }
.dec { padding: 8px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.quick { display: flex; gap: 6px; margin-top: 8px; }
.quick input { margin: 0; } .quick input[type=date] { width: 150px; flex: none; }
details summary { cursor: pointer; color: var(--muted); padding: 8px 0; font-size: 14px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 12px 10px; }
.timeline li::before { content: ''; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline li.ev-relato::before { background: var(--accent); } .timeline li.ev-prazo::before { background: var(--warn); } .timeline li.ev-decisao::before { background: var(--ok); }
.timeline p { margin: 2px 0 0; font-size: 14px; } .timeline small { color: var(--muted); font-size: 12px; }
blockquote { margin: 0 0 12px; padding: 10px 12px; background: var(--bg); border-left: 3px solid var(--accent); border-radius: 6px; font-style: italic; }
blockquote small { display: block; font-style: normal; color: var(--muted); margin-top: 6px; font-size: 12px; }
.versions { padding-left: 18px; font-size: 14px; } .versions li { margin-bottom: 6px; }

/* Botões */
.btn { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 600; cursor: pointer; background: var(--bg); color: var(--ink); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.full { width: 100%; margin-top: 8px; } .btn.big { padding: 14px 18px; font-size: 17px; }
.btn:disabled { opacity: .5; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* Folhas (modais) */
.sheet-bg { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); animation: up .2s ease-out; }
.sheet h2 { margin: 0 0 6px; font-size: 19px; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 18px; } }

/* Gravação */
.rec { text-align: center; padding: 14px 0 6px; }
.mic { width: 110px; height: 110px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; cursor: pointer; display: inline-grid; place-items: center; box-shadow: 0 8px 24px rgba(20,33,61,.35); }
.mic.on { background: var(--warn); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 16px rgba(220,38,38,.15); } }
.meter { height: 6px; background: var(--bg); border-radius: 6px; margin: 16px auto 6px; max-width: 240px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s; }
.time { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; }
.hint { color: var(--muted); font-size: 14px; min-height: 20px; }
.thinking { text-align: center; padding: 40px 10px; }
.spinner { width: 46px; height: 46px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 14px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Revisão */
.op { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.op.crit { border-color: var(--accent); background: #fffbeb; }
.op.off { opacity: .45; }
.op input.ed, .op select.ed, .op textarea.ed { margin: 6px 0 4px; }
.op .row2 { display: flex; gap: 6px; }
.optop { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.optop input { width: 20px; height: 20px; margin: 0; }
.tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 6px; background: #e0e7ff; color: #3730a3; }
.tag.t-concluir { background: #dcfce7; color: #166534; } .tag.t-pendencia { background: #ede9fe; color: var(--wait); }
.tag.t-decisao { background: #dcfce7; color: #166534; } .tag.t-alterar_prazo, .tag.t-alterar_status { background: #fef3c7; color: #92400e; }
.critlbl { font-size: 12px; color: #92400e; margin-left: auto; }
.change { margin: 4px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.change input { width: auto; margin: 0; }
.trecho { display: block; color: var(--muted); font-style: italic; font-size: 13px; margin-top: 4px; }
.confirmbar { position: fixed; left: 0; right: 0; bottom: calc(49px + var(--safe-b)); display: flex; gap: 8px; padding: 10px 12px; background: rgba(244,245,247,.95); border-top: 1px solid var(--line); z-index: 6; justify-content: center; }
.confirmbar .primary { flex: 1; max-width: 480px; }

/* Login */
.login { max-width: 360px; margin: 0 auto; padding: 18vh 22px 40px; text-align: center; }
.login .logo { font-size: 42px; color: var(--accent); }
.login h1 { margin: 6px 0 2px; color: var(--navy); }
.login form { margin-top: 24px; } .login .btn { width: 100%; }
.err { color: var(--warn); min-height: 22px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + var(--safe-b)); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 30; max-width: 90vw; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
