:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --ink: #16181d;
  --ink-2: #4a505c;
  --ink-3: #8a909c;
  --line: #e4e6eb;
  --line-2: #eef0f3;
  --accent: #b4232a;
  --accent-ink: #ffffff;
  --accent-soft: #fbeced;
  --green: #1d9a57;
  --green-soft: #e6f5ec;
  --yellow: #d49a00;
  --yellow-soft: #fdf4dc;
  --red: #d33b3b;
  --red-soft: #fcebeb;
  --none: #b9bec8;
  --today: #fff6d6;
  --weekend: #f1f2f5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.hide { display: none !important; }

/* ---------- Botões / campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { height: 30px; padding: 0 10px; font-size: 12px; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 36px; padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); outline: none; min-width: 0; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side { background: #16181d; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-side::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 56px solid var(--accent); opacity: .9; }
.login-side h1 { font-size: 40px; line-height: 1.05; letter-spacing: -.02em; margin: 0 0 12px; font-weight: 800; max-width: 420px; }
.login-side p { color: #aab0bc; max-width: 360px; margin: 0; }
.login-main { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.login-card h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.hint { font-size: 12px; color: var(--ink-3); }
.err { color: var(--red); font-size: 13px; min-height: 18px; }
@media (max-width: 820px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 28px 20px; min-height: 180px; }
  .login-side h1 { font-size: 28px; }
  .login-side::after { width: 200px; height: 200px; border-width: 34px; right: -70px; bottom: -90px; }
}

/* ---------- Shell ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: #16181d; color: #fff; }
.topbar-in { display: flex; align-items: center; gap: 12px; padding: 10px 20px; max-width: 1600px; margin: 0 auto; }
.topbar .brand small { display: block; font-weight: 500; color: #9aa1ad; font-size: 11px; letter-spacing: .02em; }
.topbar .spacer { flex: 1; }
.topbar .btn { background: transparent; border-color: #2c3038; color: #fff; }
.topbar .btn:hover { background: #22252c; }
.bell { position: relative; }
.badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #16181d; }
.user-chip { font-weight: 600; font-size: 13px; color: #d7dbe2; }
.nav { background: #16181d; border-top: 1px solid #23262d; }
.nav-in { display: flex; gap: 2px; padding: 0 12px; max-width: 1600px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.nav-in::-webkit-scrollbar { display: none; }
.nav button { background: none; border: 0; color: #9aa1ad; padding: 11px 12px; font-weight: 600; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; position: relative; }
.nav button.on { color: #fff; border-bottom-color: var(--accent); }
.nav .pill { background: var(--accent); color: #fff; border-radius: 9px; font-size: 10px; padding: 1px 6px; margin-left: 4px; }
main { max-width: 1600px; margin: 0 auto; padding: 18px 20px 60px; }
@media (max-width: 640px) { main { padding: 14px 12px 60px; } .topbar-in { padding: 10px 12px; } .user-chip { display: none; } }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--ink); color: #fff; }
.date-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.date-nav button { border: 0; background: none; width: 30px; height: 30px; border-radius: 7px; cursor: pointer; font-size: 16px; color: var(--ink-2); }
.date-nav button:hover { background: var(--surface-2); }
.date-nav .lbl { position: relative; min-width: 150px; text-align: center; font-weight: 700; font-size: 13px; padding: 0 6px; cursor: pointer; }
.date-nav input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.page-title { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 14px; flex-wrap: wrap; }
.page-title h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.page-title .sub { color: var(--ink-3); font-size: 13px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 15px; }
.card-b { padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; } }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .k-name { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.kpi .k-val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi .k-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); gap: 8px; }
.kpi .k-row b { color: var(--ink); font-weight: 700; }
.bar { position: relative; height: 8px; background: var(--line-2); border-radius: 4px; overflow: visible; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--ink); max-width: 100%; }
.bar .clock { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }
.bar .clock::after { content: ''; position: absolute; top: -4px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.fill.s-green { background: var(--green); } .fill.s-yellow { background: var(--yellow); } .fill.s-red { background: var(--red); } .fill.s-none { background: var(--none); }
.status-mix { display: flex; gap: 6px; flex-wrap: wrap; }
.mix { flex: 1; min-width: 70px; border-radius: 10px; padding: 8px 10px; }
.mix b { display: block; font-size: 22px; line-height: 1.1; }
.mix span { font-size: 11px; font-weight: 600; }
.mix.g { background: var(--green-soft); color: var(--green); } .mix.y { background: var(--yellow-soft); color: #9a6f00; } .mix.r { background: var(--red-soft); color: var(--red); }

/* ---------- Status ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.chip.s-green { background: var(--green-soft); color: var(--green); }
.chip.s-yellow { background: var(--yellow-soft); color: #9a6f00; }
.chip.s-red { background: var(--red-soft); color: var(--red); }
.chip.s-none { background: var(--line-2); color: var(--ink-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.s-green { background: var(--green); } .dot.s-yellow { background: var(--yellow); } .dot.s-red { background: var(--red); } .dot.s-none { background: var(--none); }

/* ---------- Grade ---------- */
.grid-wrap { overflow: auto; max-height: calc(100vh - 210px); border-radius: 0 0 var(--radius) var(--radius); }
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
.grid th, .grid td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 0; height: 36px; background: var(--surface); }
.grid thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); font-size: 11px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; padding: 0 8px; height: 44px; }
.grid .c-prod { position: sticky; left: 0; z-index: 2; min-width: 230px; max-width: 230px; text-align: left; padding: 0 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--line); }
.grid thead .c-prod { z-index: 5; }
.grid .c-sum { padding: 0 10px; text-align: right; white-space: nowrap; min-width: 92px; }
.grid .c-sum.last { box-shadow: inset -2px 0 0 var(--line); }
.grid td.c-day, .grid th.c-day { min-width: 118px; width: 118px; text-align: right; }
.grid th.c-day { text-align: center; line-height: 1.15; }
.grid th.c-day small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-3); }
.grid .wk { background: var(--weekend); }
.grid thead th.wk { background: #eaecf0; }
.grid .td { background: var(--today); }
.grid thead th.td { background: #ffeeb0; color: var(--ink); }
.grid td.c-day input { width: 100%; height: 35px; border: 0; background: transparent; text-align: right; padding: 0 8px; outline: none; font-variant-numeric: tabular-nums; }
.grid td.c-day input:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--accent); }
.grid td.c-day input.saving { color: var(--ink-3); }
.grid td.c-day input.err { box-shadow: inset 0 0 0 2px var(--red); }
.grid td.c-day .ro { padding: 0 8px; display: block; line-height: 35px; }
.grid tr.blk td { background: var(--surface-2); height: 30px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.grid tr.blk td.c-prod { background: var(--surface-2); }
.grid tr.lv2 td { font-weight: 800; background: #fbf3f3; }
.grid tr.lv1 td { font-weight: 700; background: #fcf8f8; }
.grid tr.lv2 td.c-prod, .grid tr.lv1 td.c-prod { color: var(--accent); }
.grid .ind1 { padding-left: 26px !important; font-weight: 500 !important; }
.grid .tag { font-size: 10px; color: var(--ink-3); font-weight: 600; margin-left: 4px; }
.grid tr:hover td { background-image: linear-gradient(rgba(0,0,0,.018), rgba(0,0,0,.018)); }
@media (min-width: 1000px) {
  .grid .c-sum.stk { position: sticky; z-index: 2; }
  .grid thead .c-sum.stk { z-index: 5; }
}

/* ---------- Tabelas gerais ---------- */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl .r { text-align: right; } .tbl .c { text-align: center; }
.tbl tr.tot td { font-weight: 800; background: var(--surface-2); }
.rank-pos { width: 28px; height: 28px; border-radius: 8px; background: var(--line-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.rank-pos.p1 { background: var(--accent); color: #fff; } .rank-pos.p2 { background: #3a3f4a; color: #fff; } .rank-pos.p3 { background: #8a909c; color: #fff; }
.mini-bar { height: 6px; background: var(--line-2); border-radius: 3px; position: relative; min-width: 80px; }
.mini-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }

/* matriz relógio */
table.matrix { border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.matrix th { font-size: 10px; font-weight: 700; color: var(--ink-2); padding: 4px; vertical-align: bottom; }
.matrix th.v { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; height: 130px; text-align: left; }
.matrix td.name { font-weight: 600; white-space: nowrap; padding-right: 8px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.matrix td.cell { width: 46px; min-width: 46px; height: 30px; border-radius: 6px; text-align: center; font-weight: 700; font-size: 11px; }
.cell.s-green { background: var(--green-soft); color: var(--green); }
.cell.s-yellow { background: var(--yellow-soft); color: #9a6f00; }
.cell.s-red { background: var(--red-soft); color: var(--red); }
.cell.s-none { background: var(--surface-2); color: var(--ink-3); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chk { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 16px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; background: var(--surface); user-select: none; }
.chk input { display: none; }
.chk.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.name-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--red-soft); color: var(--red); border-radius: 14px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.ok-chip { background: var(--green-soft); color: var(--green); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > * { min-width: 0; }
.card-b { min-width: 0; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
.empty { padding: 36px 16px; text-align: center; color: var(--ink-3); }

/* metas */
table.goals input { width: 132px; height: 32px; border: 1px solid var(--line); border-radius: 7px; text-align: right; padding: 0 8px; background: var(--surface); }
table.goals input.dirty { border-color: var(--yellow); background: var(--yellow-soft); }
table.goals td.sticky, table.goals th.sticky { position: sticky; left: 0; background: var(--surface); z-index: 2; box-shadow: 1px 0 0 var(--line); }
table.goals th.sticky { z-index: 3; background: var(--surface-2); }
table.goals tr.blk td { background: var(--surface-2); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); padding: 7px 12px; }

/* ---------- Mensagens ---------- */
.inbox-list { display: flex; flex-direction: column; }
.thr { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; align-items: flex-start; }
.thr:hover { background: var(--surface-2); }
.thr .t-main { flex: 1; min-width: 0; }
.thr .t-sub { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thr.unread .t-sub { font-weight: 800; }
.thr .t-prev { color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thr .t-meta { font-size: 11px; color: var(--ink-3); text-align: right; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; }
.read-dot { width: 10px; flex: none; }
.ticks { font-size: 11px; font-weight: 700; color: var(--ink-3); }
.ticks.read { color: #2a7de1; }
.batch { border-bottom: 1px solid var(--line); }
.batch-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.batch-h:hover { background: var(--surface-2); }
.batch-body { background: var(--surface-2); }
.batch-body .thr { padding-left: 34px; background: transparent; }
.prog { font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow: auto; padding: 4px 2px 10px; }
.msg { max-width: 82%; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); white-space: pre-wrap; word-wrap: break-word; }
.msg.mine { align-self: flex-end; background: #1f232b; color: #fff; border-color: #1f232b; }
.msg .m-meta { font-size: 11px; margin-top: 6px; opacity: .7; display: flex; gap: 8px; justify-content: flex-end; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); font-weight: 600; margin-bottom: 16px; cursor: pointer; border: 1px solid #f3cfd1; }

/* ---------- Modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 17, 21, .45); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 720px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line-2); gap: 10px; }
.modal-h h3 { margin: 0; font-size: 16px; }
.modal-b { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line-2); }
#toast-root { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #16181d; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.bad { background: var(--red); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.note { font-size: 12px; color: var(--ink-3); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  .grid .c-prod { min-width: 140px; max-width: 140px; font-size: 12px; padding: 0 8px; }
  .grid .ind1 { padding-left: 16px !important; }
  .grid .tag { display: none; }
  .grid td.c-day, .grid th.c-day { min-width: 108px; width: 108px; }
  .grid-wrap { max-height: calc(100vh - 150px); }
  .kpi .k-val { font-size: 22px; }
  .page-title h1 { font-size: 19px; }
  .date-nav .lbl { min-width: 110px; }
}

/* =========================================================
 * v1.1 — experiência de app no celular
 * ========================================================= */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
.boot .brand-mark { width: 56px; height: 56px; border-radius: 14px; font-size: 20px; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.remember input { width: 18px; height: 18px; accent-color: var(--accent); }
.tabbar { display: none; }
.tap { cursor: pointer; }
.tap:active { opacity: .7; }

/* faixa de instalação */
.install-bar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px 10px 12px; margin: 12px 12px 0; box-shadow: var(--shadow); }
.install-bar .ib-t { flex: 1; min-width: 0; }
.install-bar b { display: block; font-size: 14px; }
.install-bar small { color: var(--ink-3); font-size: 12px; }
.install-bar .brand-mark { flex: none; }

/* menu (Mais / Conta) */
.menu-list { display: flex; flex-direction: column; margin: -18px -18px 0; }
.menu-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 18px; border: 0; border-bottom: 1px solid var(--line-2); background: none; text-align: left; font-size: 15px; cursor: pointer; }
.menu-item:active { background: var(--surface-2); }
.menu-item small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 500; margin-top: 1px; }
.menu-item .chev { color: var(--ink-3); font-size: 20px; }
.menu-item.danger b { color: var(--red); }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.45; }

/* painel em lista */
.slist { display: flex; flex-direction: column; }
.sl-blk { padding: 10px 16px 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); background: var(--surface-2); border-top: 1px solid var(--line-2); }
.sl-row { padding: 12px 16px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; }
.sl-row.ind { padding-left: 28px; }
.sl-row.lv2 { background: #fbf3f3; }
.sl-row.lv1 { background: #fcf8f8; }
.sl-row.lv2 .sl-name, .sl-row.lv1 .sl-name { color: var(--accent); font-weight: 800; }
.sl-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sl-name { font-weight: 600; font-size: 14px; }
.sl-nums { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; font-size: 12px; color: var(--ink-3); }
.sl-nums span:nth-child(2) { text-align: center; } .sl-nums span:nth-child(3) { text-align: right; }
.sl-nums b { color: var(--ink); font-weight: 700; display: block; font-size: 13px; }

/* Lançar */
.lz-head { position: sticky; top: var(--tbh, 56px); z-index: 20; background: var(--bg); padding: 4px 0 10px; margin-bottom: 4px; }
.lz-month { display: flex; align-items: center; gap: 8px; }
.lz-month b { font-size: 16px; min-width: 128px; text-align: center; }
.lz-month .grow { flex: 1; }
.lz-nav { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; line-height: 1; color: var(--ink-2); cursor: pointer; }
.lz-strip { display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px 2px; scrollbar-width: none; scroll-behavior: smooth; }
.lz-strip::-webkit-scrollbar { display: none; }
.lz-day { flex: 0 0 46px; height: 60px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; position: relative; cursor: pointer; padding: 0; }
.lz-day small { font-size: 10px; color: var(--ink-3); text-transform: uppercase; font-weight: 700; }
.lz-day b { font-size: 17px; font-weight: 800; }
.lz-day.off { background: transparent; border-style: dashed; color: var(--ink-3); }
.lz-day.today b { color: var(--accent); }
.lz-day.on { background: var(--ink); border-color: var(--ink); border-style: solid; color: #fff; }
.lz-day.on small { color: #c9cdd4; } .lz-day.on.today b { color: #fff; }
.lz-day i { position: absolute; bottom: 6px; width: 5px; height: 5px; border-radius: 50%; }
.lz-day i.has { background: var(--green); }
.lz-day.on i.has { background: #7ee2a8; }
.lz-dayinfo { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 8px; }
.lz-sum { display: flex; gap: 14px; padding: 12px 14px; margin-bottom: 12px; align-items: stretch; }
.lz-sum .k-name { font-size: 11px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.lz-sum-a { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lz-sum-b { flex: none; border-left: 1px solid var(--line-2); padding-left: 14px; }
.lz-big { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.lz-mix { display: flex; gap: 4px; margin-top: 6px; }
.lz-mix .chip { min-width: 30px; justify-content: center; height: 26px; font-size: 13px; }
.lz-block { overflow: hidden; }
.lz-bh { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px; background: none; border: 0; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); cursor: pointer; text-align: left; }
.lz-bh > span:first-child { flex: 1; }
.lz-bt { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink-3); font-size: 12px; }
.lz-chev { transition: transform .2s; font-size: 18px; transform: rotate(90deg); display: inline-block; width: 14px; text-align: center; }
.lz-block.closed .lz-chev { transform: rotate(0deg); }
.lz-block.closed .lz-bb { display: none; }
.lz-row { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line-2); min-height: 64px; cursor: text; }
.lz-row.ind { padding-left: 22px; }
.lz-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lz-name { font-weight: 600; font-size: 15px; }
.lz-meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; display: block; line-height: 1.35; }
.lz-meta .dot { width: 7px; height: 7px; margin-right: 5px; vertical-align: 1px; }
.nw { white-space: nowrap; }
.lz-in { flex: none; width: 44%; max-width: 190px; height: 46px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); text-align: right; padding: 0 12px; font-size: 17px; font-weight: 700; outline: none; transition: border-color .15s, box-shadow .15s; }
.lz-in::placeholder { color: #c3c7cf; font-weight: 500; }
.lz-in:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lz-in.ok { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.lz-in.saving { color: var(--ink-3); }
.grid td.c-day input.ok { box-shadow: inset 0 0 0 2px var(--green); }
.lz-sub { display: flex; justify-content: space-between; gap: 10px; padding: 9px 14px; background: #fcf6f6; color: var(--accent); font-weight: 800; font-size: 12px; border-top: 1px solid var(--line-2); }

@keyframes sheet-up { from { transform: translateY(48px); opacity: .5; } to { transform: none; opacity: 1; } }

@media (max-width: 760px) {
  .nav, .tb-desk { display: none !important; }
  .hm { display: none !important; }
  .tbl th, .tbl td { padding: 9px 8px; }
  .install-bar { padding: 8px 6px 8px 10px; }
  .install-bar small { display: none; }
  .mini-bar { display: none; }
  .topbar-in { padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); }
  main { padding: 14px 12px calc(88px + env(safe-area-inset-bottom)); }

  /* abas inferiores */
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; border: 0; background: none; color: #8a909c; font-size: 10.5px; font-weight: 600; position: relative; cursor: pointer; }
  .tab svg { width: 24px; height: 24px; }
  .tab.on { color: var(--accent); }
  .tab:active { opacity: .6; }
  .tab-badge { position: absolute; top: 3px; left: calc(50% + 5px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; font-style: normal; display: grid; place-items: center; border: 2px solid #fff; }
  #toast-root { bottom: calc(84px + env(safe-area-inset-bottom)); width: calc(100% - 32px); }
  .toast { text-align: center; }

  /* campos sem zoom no iPhone e alvos de toque maiores */
  .input, select.input, textarea.input { font-size: 16px; height: 44px; }
  textarea.input { height: auto; }
  .grid td.c-day input, table.goals input { font-size: 16px; }
  .grid td.c-day, .grid th.c-day { min-width: 124px; width: 124px; }
  .btn { height: 40px; }
  .btn.small { height: 34px; }
  .seg button { padding: 8px 12px; }
  .date-nav button { width: 38px; height: 38px; }

  /* barra de filtros */
  .toolbar { gap: 8px; }
  .toolbar > select.input { max-width: none !important; width: 100%; }
  .toolbar > .seg { flex: 1; } .toolbar > .seg button { flex: 1; }
  .toolbar > .date-nav { flex: 1 1 100%; justify-content: space-between; }
  .page-title { margin-bottom: 10px; }
  .card-h { padding: 12px 14px; }

  /* cartões de indicadores deslizam para o lado */
  .kpis { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -12px 14px; padding: 0 12px 4px; scrollbar-width: none; }
  .kpis::-webkit-scrollbar { display: none; }
  .kpis > .kpi { flex: 0 0 86%; scroll-snap-align: center; }

  /* janelas sobem de baixo */
  .modal-bg { place-items: end center; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); animation: sheet-up .22s ease-out; }
  .modal-h { position: relative; padding-top: 22px; }
  .modal-h::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 38px; height: 4px; border-radius: 2px; background: var(--line); }
  .modal-f .btn { flex: 1; height: 46px; }
  .msg { max-width: 90%; }

  /* login */
  .login-side { min-height: 0; padding: 22px 20px 26px; }
  .login-side h1 { font-size: 24px; margin-top: 18px; }
  .login-side p { font-size: 13px; }
  .login-main { place-items: start center; padding-top: 24px; }
  .login-card .input { height: 48px; }
}

@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
}

/* janela de instalação */
.install-sheet .modal { max-width: 440px; }
.is-hero { display: flex; gap: 14px; align-items: center; }
.is-hero img { border-radius: 14px; flex: none; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.is-hero b { display: block; font-size: 17px; margin-bottom: 3px; }
.is-hero span { color: var(--ink-2); font-size: 14px; line-height: 1.4; }
.is-actions { display: flex; flex-direction: column; gap: 8px; }
.btn.big { height: 50px; font-size: 15px; border-radius: 12px; text-decoration: none; }
.btn.ghost.big { color: var(--ink-3); }
.ios-arrow { position: fixed; left: 50%; bottom: calc(6px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 150; color: #fff; background: var(--accent); width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(180,35,42,.45); animation: bob 1.1s ease-in-out infinite; pointer-events: none; }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }
.install-sheet.with-arrow .modal { margin-bottom: calc(76px + env(safe-area-inset-bottom)); border-radius: 20px; }
