@font-face { font-family: "Anton"; src: url("/fonts/anton.woff2") format("woff2"); font-display: swap; }

:root {
  --navy: #041543; --navy2: #0B2A6B; --or: #F26522; --or-ink: #A83B0C; --or-bg: #FFF1E9;
  --bg: #EEF1F8; --card: #FFFFFF; --ink: #0E1733; --muted: #5D6886; --line: #D9DFEC; --soft: #F5F7FB; --col: #E2E7F2;
  --ok: #14794A; --ok-bg: #E3F4EA; --bad: #B42318; --bad-bg: #FDE8E6; --warn: #9A5B00; --warn-bg: #FFF0D6; --chip: #E8EDF7;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--body); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: #1E3FA8; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

/* ---------- topo ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); padding-top: max(10px, env(safe-area-inset-top)); }
.logo { font-family: var(--display); font-size: 21px; letter-spacing: .02em; color: #fff; text-decoration: none; white-space: nowrap; }
.logo i { font-style: normal; color: var(--or); }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 7px 11px; border-radius: 7px; color: #B9C4E2; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tabs a.on { background: var(--navy2); color: #fff; }
.tabs a:hover { color: #fff; }
.grow { flex: 1; }
.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; padding: 7px 12px; border-radius: 8px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.btn:hover { border-color: #AEB9D3; }
.btn.pri { background: var(--or); border-color: var(--or); color: #fff; }
.btn.pri:hover { background: #E05514; }
.btn.dark { background: var(--navy2); border-color: var(--navy2); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; }
.btn.ghost { background: transparent; border-color: transparent; color: #1E3FA8; padding-inline: 4px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.av { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--navy2); flex: 0 0 auto; border: 0; padding: 0; }
.av.lg { width: 76px; height: 76px; font-size: 24px; }
.av.md { width: 40px; height: 40px; font-size: 13px; }
.menu-wrap { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(4,21,67,.18); padding: 6px; min-width: 200px; z-index: 40; }
.pop a, .pop button.item { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; background: none; border: 0; }
.pop a:hover, .pop button.item:hover { background: var(--soft); }
.pop .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop .who small { display: block; color: var(--muted); }

main { padding: 16px max(16px, env(safe-area-inset-right)) 90px max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 14px; }
h1.page { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 30px; color: var(--navy); margin: 0; letter-spacing: .01em; line-height: 1.05; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- filtros ---------- */
.fbar { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.frow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fsel { border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; display: inline-flex; gap: 6px; align-items: center; background: var(--card); white-space: nowrap; }
.fsel small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.fsel b { font-weight: 600; font-size: 12.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.fsel.set { border-color: var(--navy2); background: #EEF2FC; }
.search { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 160px; flex: 1 1 160px; max-width: 280px; background: var(--card); }
.achip { background: #E3E9F7; color: var(--navy); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; border: 0; }
.achip button { border: 0; background: none; color: var(--muted); padding: 0 4px; font-size: 14px; line-height: 1; }
.vchip { border: 1px dashed #B9C4DD; background: var(--soft); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.vchip > button:first-child { border: 0; background: none; padding: 0; font-weight: 600; color: var(--navy); }
.vchip .x { border: 0; background: none; color: var(--muted); padding: 0 5px; }
.fpop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 35; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(4,21,67,.16); padding: 8px; min-width: 230px; max-height: 340px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.fpop label { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.fpop label:hover { background: var(--soft); }
.fpop .sep { border-top: 1px solid var(--line); margin: 4px 0; }
.fpop .presets { display: flex; flex-wrap: wrap; gap: 4px; }
.fpop .grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-items: center; padding: 4px; }
.fpop input[type=date], .fpop select { border: 1px solid var(--line); border-radius: 6px; padding: 5px 6px; }
.rel { position: relative; }
.fbody { display: flex; flex-direction: column; gap: 8px; }
.fbar-toggle { display: none; align-self: flex-start; }
.kv input[type=checkbox], .kv input[type=radio] { width: auto; }

/* ---------- cartões e estados ---------- */
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.t { font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: var(--chip); color: #2A3A66; white-space: nowrap; }
.prj { font-size: 10.5px; font-weight: 600; color: #6B4FB8; }
.pri { font-size: 10.5px; font-weight: 700; color: var(--bad); }
.st { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.st.em_dia { background: var(--chip); color: #2A3A66; }
.st.vence_breve { background: var(--warn-bg); color: var(--warn); }
.st.atrasada, .st.com_atraso { background: var(--bad-bg); color: var(--bad); }
.st.no_prazo { background: var(--ok-bg); color: var(--ok); }
.flag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: var(--warn-bg); color: var(--warn); }

.card { background: var(--card); border-radius: 9px; padding: 9px 10px; display: flex; flex-direction: column; gap: 7px; border: 1px solid var(--line); cursor: pointer; user-select: none; }
.card:hover { border-color: #AEB9D3; }
.card.late { box-shadow: inset 3px 0 0 #D92D20; }
.card.dragging { opacity: .4; }
.card .ttl { font-weight: 600; font-size: 13px; line-height: 1.3; }
.card .meta { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.card .foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; }
.dt { font-family: var(--mono); font-size: 11px; display: flex; flex-direction: column; line-height: 1.35; }
.dt .lt { color: var(--bad); font-weight: 700; } .dt .ok { color: var(--ok); font-weight: 700; } .dt .wn { color: var(--warn); font-weight: 700; }
.mv { border: 1px solid var(--line); background: var(--soft); border-radius: 6px; font-size: 11px; padding: 2px 7px; color: var(--muted); }

/* ---------- kanban ---------- */
.sectabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.sectabs a { padding: 7px 12px; border-radius: 8px; font-weight: 700; display: inline-flex; gap: 7px; align-items: center; color: var(--muted); text-decoration: none; background: var(--card); border: 1px solid var(--line); white-space: nowrap; }
.sectabs a.on { color: var(--navy); border-color: var(--navy2); box-shadow: inset 0 -3px 0 var(--or); }
.sectabs .n { font-family: var(--mono); font-weight: 500; font-size: 11px; }
.boardwrap { overflow-x: auto; padding-bottom: 6px; }
.board { display: grid; grid-auto-columns: minmax(240px, 1fr); grid-auto-flow: column; gap: 10px; min-width: min-content; }
.col { background: var(--col); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 260px; min-width: 240px; }
.col.done { background: #E1F1E8; }
.col.over { outline: 2px dashed var(--navy2); outline-offset: -2px; }
.colh { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); padding: 2px 4px; }
.colh em { font-style: normal; font-family: var(--mono); font-weight: 500; color: var(--muted); font-size: 11px; text-transform: none; letter-spacing: 0; }
.col .empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 6px; border: 1px dashed #C3CCE0; border-radius: 8px; }
.lane { display: flex; flex-direction: column; gap: 8px; }
.lane h3 { margin: 6px 0 0; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.stagepick { display: none; }

/* ---------- painéis ---------- */
.grid { display: grid; gap: 12px; }
.kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.two { grid-template-columns: 1.3fr 1fr; }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.panel h2 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; text-align: left; }
button.kpi:hover { border-color: #AEB9D3; }
.kpi b { font-family: var(--display); font-weight: 400; font-size: 32px; color: var(--navy); line-height: 1.1; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi.red b { color: var(--bad); } .kpi.green b { color: var(--ok); } .kpi.amb b { color: var(--warn); }
.tblwrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: var(--soft); color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 9px; text-align: left; font-weight: 700; white-space: nowrap; }
.tbl th.sort { cursor: pointer; } .tbl th.sort:hover { color: var(--ink); }
.tbl td { padding: 8px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--soft); }
.tbl .num { font-family: var(--mono); text-align: right; white-space: nowrap; } .tbl th.num { text-align: right; }
.tbl tr.group td { background: #F1F4FA; font-weight: 700; color: var(--navy); }
.meter { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; min-width: 60px; }
.meter i { display: block; height: 100%; background: var(--navy2); border-radius: 4px; }
.meter i.lt { background: #D92D20; } .meter i.ok { background: var(--ok); }
.row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) 110px 56px 84px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.prow:last-child { border-bottom: 0; }
.prow small { display: block; color: var(--muted); font-size: 11px; }
.st.concluido { background: var(--chip); color: #2A3A66; } .st.atrasado { background: var(--bad-bg); color: var(--bad); }
.st.atencao { background: var(--warn-bg); color: var(--warn); }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; gap: 5px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.emptybox { text-align: center; color: var(--muted); padding: 26px 10px; }

/* ---------- gaveta e modal ---------- */
.veil { position: fixed; inset: 0; background: rgba(4,21,67,.35); z-index: 50; display: flex; justify-content: flex-end; }
.drawer { background: var(--bg); width: min(980px, 100%); height: 100%; overflow: auto; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(4,21,67,.25); }
.drawer-head { position: sticky; top: 0; z-index: 2; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
.drawer-head .code { color: #B9C4E2; }
.drawer-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; flex: 1; }
.dmain { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; background: var(--card); min-width: 0; }
.dside { padding: 16px; display: flex; flex-direction: column; gap: 12px; border-left: 1px solid var(--line); }
.title-in { font-size: 20px; font-weight: 700; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin: -4px -6px; width: calc(100% + 12px); background: transparent; }
.title-in:hover:not(:disabled), .title-in:focus { border-color: var(--line); background: var(--card); }
textarea.desc { width: 100%; min-height: 90px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; resize: vertical; background: var(--card); }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; align-items: center; font-size: 13px; }
.kv > label, .kv > dt { color: var(--muted); font-weight: 600; font-size: 12px; }
.kv dd { margin: 0; }
.in, .kv select, .kv input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: var(--card); width: 100%; min-width: 0; }
.datebox { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.datebox div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.datebox small { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.datebox b { font-family: var(--mono); font-weight: 600; font-size: 16px; }
.sub { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.feed { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.feed .it { display: flex; gap: 8px; }
.feed p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.feed time { color: var(--muted); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.hist { display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
.hist div { display: grid; grid-template-columns: 82px 1fr; gap: 8px; }
.hist time { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.att { display: flex; gap: 8px; flex-wrap: wrap; }
.att a { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12.5px; background: var(--soft); text-decoration: none; color: var(--ink); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose { display: flex; gap: 8px; align-items: flex-end; }
.compose textarea { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 40px; resize: vertical; }

.modal-veil { position: fixed; inset: 0; background: rgba(4,21,67,.4); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--card); border-radius: 14px; width: min(560px, 100%); max-height: calc(100% - 20px); overflow: auto; box-shadow: 0 20px 60px rgba(4,21,67,.3); display: flex; flex-direction: column; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; font-size: 17px; }
.modal .body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: var(--card); }
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld > label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fld .hint { font-size: 12px; color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; }
.chips button.on { border-color: var(--or); color: var(--or-ink); background: var(--or-bg); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.note { background: var(--warn-bg); color: #6B4200; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.okbox { background: var(--ok-bg); color: var(--ok); border-radius: 8px; padding: 8px 10px; font-size: 13px; overflow-wrap: anywhere; }

.sheet-veil { position: fixed; inset: 0; background: rgba(4,21,67,.35); z-index: 70; display: flex; align-items: flex-end; }
.sheet { background: var(--card); width: 100%; border-radius: 16px 16px 0 0; padding: 14px 14px max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; }
.sheet .opt { padding: 12px; border-radius: 9px; border: 1px solid var(--line); font-weight: 600; display: flex; justify-content: space-between; background: var(--card); text-align: left; }
.sheet .opt.cur { border-color: var(--navy2); background: #EEF2FC; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 90; box-shadow: 0 10px 30px rgba(4,21,67,.3); font-weight: 600; max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); }

/* ---------- perfil e ranking ---------- */
.prof { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 12px; }
.phead { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.phead b { font-size: 17px; }
.big { font-family: var(--display); font-size: 46px; color: var(--navy); line-height: 1; }
.badges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.badge { border: 1px solid var(--line); border-radius: 10px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.badge .ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; background: var(--or-bg); color: var(--or-ink); font-weight: 800; }
.badge.off { opacity: .55; } .badge.off .ic { background: var(--bg); color: #8A93AB; }
.badge b { font-size: 12.5px; } .badge small { font-size: 11px; color: var(--muted); }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end; }
.pod { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; cursor: pointer; }
.pod .pl { font-family: var(--display); font-size: 28px; line-height: 1; color: var(--or); }
.pod.first { padding-block: 22px; box-shadow: inset 0 3px 0 var(--or); }
.pod b { font-size: 14px; } .pod span { font-size: 12px; color: var(--muted); }
.pod .pts { font-family: var(--display); font-size: 26px; color: var(--navy); }
.role { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: #2A3A66; white-space: nowrap; }
.role.admin { background: var(--or-bg); color: var(--or-ink); } .role.guest { background: #F1EDFB; color: #5A3FB0; }

/* ---------- configurações ---------- */
.cfgtabs { display: flex; gap: 4px; flex-wrap: wrap; }
.cfgtabs a { padding: 7px 12px; border-radius: 8px; font-weight: 700; color: var(--muted); text-decoration: none; background: var(--card); border: 1px solid var(--line); }
.cfgtabs a.on { color: var(--navy); border-color: var(--navy2); box-shadow: inset 0 -3px 0 var(--or); }
.cfg { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 12px; align-items: start; }
.srow { display: flex; gap: 8px; align-items: center; padding: 9px 10px; border-radius: 8px; font-weight: 600; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.srow:hover { background: var(--soft); }
.srow.on { background: #EEF2FC; outline: 1px solid #C9D4EF; }
.srow small { margin-left: auto; font-family: var(--mono); font-weight: 500; color: var(--muted); font-size: 11px; }
.srow.arch { color: var(--muted); }
.stage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.stage .ord { display: flex; flex-direction: column; }
.stage .ord button { border: 0; background: none; color: var(--muted); padding: 0 4px; line-height: 1; font-size: 11px; }
.stage input[type=text] { border: 1px solid transparent; border-radius: 6px; padding: 5px 7px; }
.stage input[type=text]:hover, .stage input[type=text]:focus { border-color: var(--line); }
.stage label { font-size: 12px; display: inline-flex; gap: 5px; align-items: center; color: var(--muted); white-space: nowrap; }
.tog { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tog:last-child { border-bottom: 0; }
.tog small { display: block; color: var(--muted); }

/* ---------- entrada ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 20px; background: var(--navy); }
.login form { background: var(--card); border-radius: 16px; padding: 26px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login .logo { color: var(--navy); font-size: 30px; }
.login input { border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; font-size: 16px; width: 100%; }
.login .codein { letter-spacing: .4em; font-family: var(--mono); text-align: center; font-size: 22px; }

/* ---------- telemóvel ---------- */
.bnav { display: none; }
@media (max-width: 860px) {
  .top .tabs, .top .newbtn-label { display: none; }
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); padding: 6px 6px max(6px, env(safe-area-inset-bottom)); }
  .bnav a { flex: 1; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 6px 2px; border-radius: 8px; }
  .bnav a.on { color: var(--navy); background: #EEF2FC; }
  .bnav a .i { display: block; font-size: 17px; line-height: 1.1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi:first-child { grid-column: span 2; }
  .two, .three, .prof, .cfg { grid-template-columns: minmax(0, 1fr); }
  .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer-body { grid-template-columns: minmax(0, 1fr); }
  .dside { border-left: 0; border-top: 1px solid var(--line); }
  .podium { grid-template-columns: 1fr; } .pod.first { order: -1; }
  /* Kanban no telemóvel: uma etapa de cada vez. */
  .stagepick { display: flex; gap: 6px; overflow-x: auto; }
  .stagepick button { white-space: nowrap; padding: 6px 11px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 12.5px; }
  .stagepick button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
  .board.single { grid-auto-flow: row; grid-auto-columns: auto; min-width: 0; }
  .board.single .col { display: none; min-width: 0; }
  .board.single .col.show { display: flex; }
  .prow { grid-template-columns: minmax(0, 1fr) 84px; }
  .prow .meter, .prow .code { display: none; }
  .search { max-width: none; }
  /* Filtros recolhidos atrás de um botão, para o quadro aparecer logo. */
  .fbar-toggle { display: inline-flex; }
  .fbar:not(.open) .fbody { display: none; }
  .fbar:not(.open) { padding: 8px; }
  h1.page { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
