/* Consertado — painel e página do cliente. A página inicial tem o seu próprio landing.css. */
:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --ink: #131a26;
  --muted: #5f6b7c;
  --line: #dbe2ec;
  --line-soft: #ebeff5;
  --brand: #1d4fd7;
  --brand-dark: #163fae;
  --brand-soft: #e6eefc;
  --ok: #15803d;
  --ok-bg: #dcf5e4;
  --warn: #92600a;
  --warn-bg: #fdefc8;
  --bad: #b3261e;
  --bad-bg: #fbe3e1;
  --info-bg: #e6eefc;
  --whats: #128c4b;
  --radius: 10px;
  --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --gutter: clamp(14px, 3vw, 32px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--brand); }
strong, b { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 0.93em; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.fine { color: var(--muted); font-size: 13px; }
.pre { white-space: pre-line; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* --- botões ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
  padding: 8px 14px; border-radius: var(--radius); border: 1px solid transparent;
  font: 600 14px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not([disabled]) { background: var(--brand-dark); }
.btn-quiet { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover:not([disabled]) { background: #f6f7f9; border-color: #aab1bb; }
.btn-whats { background: var(--whats); color: #fff; }
.btn-whats:hover { background: #0d7039; }
.btn-lg { min-height: 48px; padding: 12px 20px; font-size: 16px; }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.btn.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.link-btn { all: unset; cursor: pointer; color: var(--muted); font-size: 13px; text-decoration: underline; }
.link-btn:hover { color: var(--ink); }
.link-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* --- marca e barra do painel -------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: inherit; text-decoration: none; }
.brand-mark { width: 18px; height: 18px; border-radius: 3px; background: var(--brand); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.25); flex: none; }
.nav-app { display: flex; align-items: center; gap: 20px; padding: 0 var(--gutter); background: var(--ink); color: #fff; min-height: 50px; }
.nav-app .brand { font-size: 15px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-app .brand-mark { display: none; }
.nav-links { display: flex; gap: 2px; margin-right: auto; }
.nav-links a { color: #c3cad3; text-decoration: none; padding: 15px 10px; font-size: 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.nav-links a:hover { color: #fff; }
.nav-links a[aria-current] { color: #fff; border-bottom-color: #fff; font-weight: 600; }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.who { color: #c3cad3; font-size: 13px; }
.nav-app .btn-quiet { background: transparent; color: #fff; border-color: #56606c; }
.nav-app .btn-quiet:hover { background: #2c333c; border-color: #7a8490; }
.banner { padding: 8px var(--gutter); background: var(--info-bg); font-size: 14px; border-bottom: 1px solid var(--line); }
.banner-warn { background: var(--warn-bg); }
.subnav { display: flex; gap: 0; margin-bottom: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subnav a { padding: 8px 14px; text-decoration: none; color: var(--muted); font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }

/* --- estrutura do painel ------------------------------------------------ */
.content { padding: 20px var(--gutter) 64px; max-width: 1240px; margin: 0 auto; }
.crumb { margin-bottom: 8px; font-size: 13px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; margin-bottom: 16px; }
.page-head h1 { font-size: 22px; }
.page-head p { margin-top: 3px; }
.head-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.os-num { font: 600 0.7em/1 var(--mono); background: var(--ink); color: #fff; padding: 4px 7px; border-radius: 3px; vertical-align: middle; margin-right: 6px; white-space: nowrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card h2 { font-size: 15px; margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.table-card { padding: 4px 16px; }
.stack { display: grid; gap: 14px; align-content: start; min-width: 0; }
.narrow { max-width: 760px; }
.narrow-wide { max-width: 900px; }
.content > .card + .card, .content > .stats + .card, .content > .two-cards + .card { margin-top: 14px; }
.order-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.two-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.table-scroll { overflow-x: auto; }
.after-table { margin-top: 12px; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 3px; background: var(--line-soft); color: var(--muted); white-space: nowrap; }
.count { margin-left: auto; font: 600 12px/1 var(--mono); background: var(--line-soft); padding: 3px 6px; border-radius: 3px; }

/* --- formulários -------------------------------------------------------- */
label, legend, .field-label { font-size: 13px; font-weight: 600; color: #3c444e; }
label { display: block; min-width: 0; }
label > input, label > select, label > textarea { display: block; margin-top: 4px; }
.optional { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 10px; border-radius: var(--radius); border: 1px solid #b4bbc5;
  background: #fff; color: var(--ink); font: 400 15px/1.3 var(--font);
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form, .form > fieldset { display: grid; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.notice { padding: 10px 12px; border-radius: var(--radius); background: var(--info-bg); border-left: 4px solid var(--brand); font-size: 14px; margin-bottom: 14px; }
.notice-error { background: var(--bad-bg); border-left-color: var(--bad); }
.notice-ok { background: var(--ok-bg); border-left-color: var(--ok); }
.notice-warn { background: var(--warn-bg); border-left-color: #c98a00; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; display: grid; gap: 8px; justify-items: center; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty strong { color: var(--ink); font-size: 16px; }
.seg { display: flex; border: 1px solid #b4bbc5; border-radius: var(--radius); overflow: hidden; background: #fff; }
.seg-wide { width: 100%; }
.seg-wide .seg-opt { flex: 1; text-align: center; }
.seg-opt { display: block; position: relative; cursor: pointer; }
.seg-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg-opt span { display: block; padding: 9px 12px; font-size: 14px; font-weight: 400; color: var(--ink); white-space: nowrap; }
.seg-opt + .seg-opt span { border-left: 1px solid #b4bbc5; }
.seg-opt input:checked + span { background: var(--ink); color: #fff; font-weight: 600; }
.seg-ok input:checked + span { background: var(--ok); }
.seg-defeito input:checked + span { background: var(--bad); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }

/* --- lista de OS, clientes, peças --------------------------------------- */
.counters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.counter { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; text-decoration: none; color: var(--muted); font-size: 13px; border-left: 1px solid var(--line-soft); }
.counter:first-child { border-left: 0; }
.counter strong { font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
.counter:hover { background: #f6f7f9; }
.counter[aria-current] { background: var(--ink); color: #fff; }
.counter[aria-current] strong { color: #fff; }
.counter.is-warn:not([aria-current]) strong { color: var(--bad); }
.search { display: flex; gap: 6px; margin-bottom: 12px; }
.search input { flex: 1; min-width: 0; }
.orders { list-style: none; padding: 0; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.orders > li + li { border-top: 1px solid var(--line-soft); }
.order-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 14px; text-decoration: none; color: var(--ink); }
.order-row.row-3 { grid-template-columns: minmax(0, 1fr) auto auto; }
.order-row:hover { background: #f6f7f9; }
.order-num { font: 600 13px/1 var(--mono); color: var(--muted); min-width: 34px; }
.order-num.is-low { color: var(--bad); }
.order-main { display: grid; gap: 1px; min-width: 0; }
.order-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-main .muted { font-size: 13px; }
.order-side { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.order-total { font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; font-size: 14px; }
.row-with-action { display: flex; align-items: center; gap: 8px; padding-right: 10px; }
.row-with-action .order-row { flex: 1; min-width: 0; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 3px; white-space: nowrap; background: var(--line-soft); color: var(--ink); text-decoration: none; }
.chip-orcamento { background: var(--warn-bg); color: var(--warn); }
.chip-aprovado, .chip-reparo, .chip-analise { background: var(--info-bg); color: var(--brand-dark); }
.chip-pronto { background: var(--ok-bg); color: var(--ok); }
.chip-entregue { color: var(--muted); }
.chip-recusado, .chip-late { background: var(--bad-bg); color: var(--bad); }

/* --- tela da OS --------------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form select { min-height: 32px; padding: 4px 8px; font-size: 13px; width: auto; }
.push { margin-left: auto; }
.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 8px 6px 0; border-bottom: 1px solid var(--line); }
.lines td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.lines tbody tr:last-child td { border-bottom: 0; }
.lines td:last-child, .lines th:last-child { padding-right: 0; }
.lines .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lines tfoot td { border-bottom: 0; padding-top: 3px; padding-bottom: 3px; color: var(--muted); }
.lines tfoot tr:first-child td { border-top: 1px solid var(--line); padding-top: 8px; }
.lines tfoot .total td { color: var(--ink); font-weight: 700; font-size: 16px; }
.add-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 14px; }
.add-line label { flex: 0 1 150px; }
.add-line .grow { flex: 1 1 200px; }
.add-line .tiny { flex: 0 0 70px; }
.add-line .small-field { flex: 0 1 130px; }
.from-stock { border-top: 1px dashed var(--line); padding-top: 12px; }
.facts { margin: 0; display: grid; gap: 8px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 1px 0 0; overflow-wrap: anywhere; white-space: pre-line; }
.check-summary { list-style: none; padding: 0; margin: 14px 0 0; font-size: 13px; }
.check-summary li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line-soft); }
.check-summary li span:last-child { color: var(--muted); white-space: nowrap; }
.check-summary .check-ok span:last-child { color: var(--ok); }
.check-summary .check-defeito span:last-child { color: var(--bad); font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14px; }
.timeline li { display: grid; gap: 0; padding-left: 10px; border-left: 2px solid var(--line); }
.check-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.check-row legend { float: left; padding: 0; color: var(--ink); font-size: 14px; font-weight: 400; }
.signed { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.signed img { border-bottom: 1px solid var(--ink); max-width: 100%; height: auto; background: #fff; }

/* --- números, contas, equipe -------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
.stat { padding: 12px 14px; display: grid; gap: 3px; border-left: 1px solid var(--line-soft); border-top: 1px solid var(--line-soft); margin: -1px 0 0 -1px; text-decoration: none; color: inherit; }
.stat span { font-size: 13px; color: var(--muted); }
.stat strong { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.is-warn strong { color: var(--bad); }
.stat-main { background: #f6f7f9; }
a.stat:hover { background: #f6f7f9; }
.explain { margin: -4px 0 14px; max-width: 62em; }
.bills { list-style: none; padding: 0; margin: 0; }
.bills li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.bills li:first-child { border-top: 0; padding-top: 0; }
.bill-main { display: grid; gap: 1px; flex: 1 1 200px; min-width: 0; }
.bill-amount { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bills .is-overdue .bill-amount { color: var(--bad); }
.rows { display: grid; gap: 8px; margin-top: 10px; }
.row-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.row-line label { flex: 0 1 150px; }
.row-line .grow { flex: 1 1 200px; }
.row-line .tiny { flex: 0 0 70px; }
.row-line .small-field { flex: 0 1 130px; }
.pay-choice { display: grid; gap: 12px; }
.pay-choice legend { margin-bottom: 6px; padding: 0; }
.team { list-style: none; padding: 0; margin: 0 0 8px; }
.team li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.team li:first-child { border-top: 0; padding-top: 0; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 620px; margin: 12px 0; }
.plan { display: grid; gap: 6px; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.plan h3 { font-size: 15px; }
.plan-featured { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.price { font-size: 24px; font-weight: 700; }
.price span { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 3px; }

/* --- venda de balcão ---------------------------------------------------- */
.sale-form { max-width: 620px; display: grid; gap: 12px; }
.sale-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sale-row[hidden], .sale-pick[hidden], .sale-loose[hidden] { display: none; }
.sale-pick { flex: 1 1 260px; min-width: 0; }
.sale-loose { flex: 1 1 260px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px; gap: 8px; }
.sale-qty { flex: 0 0 66px; width: 66px !important; text-align: center; }
.sale-more summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.sale-more[open] summary { margin-bottom: 10px; }
.sale-total { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.sale-total p { display: flex; gap: 16px; color: var(--muted); font-size: 14px; }
.sale-total p b { color: var(--ink); }
.sale-total .btn { margin-left: auto; }

/* --- agenda ------------------------------------------------------------- */
.ag-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.ag-day { min-height: 260px; padding: 0 6px 8px; border-left: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ag-day:first-child { border-left: 0; }
.ag-day h2 { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 400; color: var(--muted); padding: 8px 2px 7px; border-bottom: 1px solid var(--line-soft); margin: 0 -6px 2px; padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.ag-day h2 b { color: var(--ink); }
.ag-day.is-today { background: #f4f7ff; }
.ag-day.is-today h2 { border-bottom: 2px solid var(--brand); color: var(--brand-dark); }
.ag-day.is-past:not(.is-today) { background: #f7f8f9; }
.ag-day.is-over, .ag-strip.is-over { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--info-bg); }
.ag-empty { color: #b9c0c9; text-align: center; margin: auto 0; }
.ag-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 4px; font-size: 13px; cursor: grab; min-width: 0; }
.ag-card.is-late { border-left-color: var(--bad); }
.ag-card.is-dragging { opacity: 0.4; }
.ag-card a { display: grid; gap: 1px; padding: 6px 8px 4px; color: var(--ink); text-decoration: none; }
.ag-card a:hover strong { text-decoration: underline; }
.ag-card strong, .ag-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-top { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ag-top b { font-family: var(--mono); color: var(--muted); }
.ag-top .chip { font-size: 11px; padding: 1px 5px; }
.ag-who { color: var(--muted); }
.ag-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px 6px; border-top: 1px solid var(--line-soft); }
.ag-tech { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-tech.is-none { color: var(--muted); font-style: italic; }
.ag-move input { min-height: 0; width: 22px; padding: 0; border: 0; background: transparent; color: transparent; cursor: pointer; }
.ag-move input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.6; }
.ag-strip { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px; }
.ag-strip h2 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.ag-strip.is-late { border-left: 4px solid var(--bad); }
.ag-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }

/* --- login e textos ----------------------------------------------------- */
.centered, .plain { background: var(--panel); }
.auth { min-height: 100vh; display: grid; place-content: center; justify-items: start; gap: 18px; padding: 32px 16px; }
.auth-form { width: min(400px, calc(100vw - 32px)); display: grid; gap: 12px; padding: 22px; }
.auth-form h1 { font-size: 20px; }
.auth-form .notice { margin: 0; }
.prose { max-width: 680px; margin: 0 auto; padding: 32px 16px 72px; display: grid; gap: 10px; }
.prose h1 { font-size: 26px; margin-top: 12px; }
.prose h2 { font-size: 16px; margin-top: 14px; }

/* --- página do cliente -------------------------------------------------- */
.public { background: var(--bg); }
.track { max-width: 540px; margin: 0 auto; padding: 18px 14px 48px; display: grid; gap: 12px; }
.track .card h2 { font-size: 16px; }
.track-shop { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.track-head h1 { font-size: 24px; margin-bottom: 4px; }
.track .notice { margin: 0; }
.stepper { list-style: none; padding: 0; margin: 2px 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; font-size: 11px; color: var(--muted); text-align: center; }
.stepper li { display: flex; flex-direction: column; align-items: center; gap: 5px; line-height: 1.2; white-space: nowrap; font-size: 10px; min-width: 0; }
.stepper li::before { content: ""; height: 5px; width: 100%; background: #c9ced6; }
.stepper .done::before { background: var(--ok); }
.stepper .now { color: var(--ink); font-weight: 700; font-size: 11px; }
.stepper .now::before { background: var(--brand); }
/* Em tela estreita só o nome da etapa atual cabe; as barras continuam mostrando o caminho. */
@media (max-width: 420px) { .stepper li:not(.now) { font-size: 0; } }
.status-card h2 { font-size: 19px !important; margin-bottom: 6px; }
.status-card p + p { margin-top: 6px; }
.decide { display: grid; gap: 8px; margin-top: 14px; }
.decide .btn { white-space: normal; text-align: center; }
.track .lines + p { margin-top: 10px; }
.terms { font-size: 14px; margin-bottom: 14px; }
.sign-pad { display: block; width: 100%; height: auto; aspect-ratio: 600 / 220; background: #fff; border: 1px solid #b4bbc5; border-bottom: 2px solid var(--ink); border-radius: var(--radius); touch-action: none; cursor: crosshair; margin-top: 4px; }
.sign-tools { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.track-foot { text-align: center; display: grid; gap: 10px; justify-items: center; margin-top: 10px; font-size: 14px; }

/* --- impressão ---------------------------------------------------------- */
.print-page { background: #c9ced6; }
.print-bar { display: flex; gap: 8px; justify-content: center; padding: 14px; }
.sheet { background: #fff; color: #000; width: min(210mm, 100%); margin: 0 auto 32px; padding: 14mm; font-size: 13px; line-height: 1.45; }
.sheet h1 { font-size: 20px; }
.sheet h2 { font-size: 12px; text-transform: uppercase; margin: 14px 0 5px; border-bottom: 1px solid #000; padding-bottom: 2px; }
.sheet p { margin: 5px 0; }
.sheet-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 8px; }
.sheet-num { text-align: right; display: grid; white-space: nowrap; }
.sheet-num strong { font-size: 20px; }
.sheet-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 24px; margin: 10px 0 0; }
.sheet-facts div { display: flex; gap: 8px; border-bottom: 1px dotted #999; padding-bottom: 2px; }
.sheet-facts dt { color: #555; flex: none; }
.sheet-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.sheet-check { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 24px; }
.sheet-check li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted #999; }
.signatures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 28px; text-align: center; font-size: 12px; align-items: end; }
.signatures span { display: block; border-top: 1px solid #000; margin-bottom: 3px; }
.signatures img { display: block; margin: 0 auto; max-width: 100%; height: auto; }
@media print {
  .no-print { display: none !important; }
  .print-page { background: #fff; }
  .sheet { width: auto; margin: 0; padding: 0; }
  @page { size: A4; margin: 14mm; }
}

/* --- telas menores ------------------------------------------------------ */
@media (max-width: 1000px) {
  .ag-week { grid-template-columns: minmax(0, 1fr); }
  .ag-day { min-height: 0; border-left: 0; border-top: 1px solid var(--line-soft); padding-bottom: 10px; }
  .ag-day:first-child { border-top: 0; }
  .ag-empty { display: none; }
  .ag-day .ag-card { max-width: 420px; }
}
@media (max-width: 900px) {
  .order-grid, .two-cards { grid-template-columns: minmax(0, 1fr); }
  .push { margin-left: 0; }
}
@media (max-width: 640px) {
  .nav-app { flex-wrap: wrap; gap: 0 12px; padding-top: 8px; }
  .nav-app .nav-links { order: 3; width: 100%; margin: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .nav-app .nav-cta { margin-left: auto; }
  .nav-links a { padding: 10px 9px; }
  .who { display: none; }
  .counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counter { border-top: 1px solid var(--line-soft); }
  .stats, .stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .plans { grid-template-columns: minmax(0, 1fr); }
  .search { flex-wrap: wrap; }
  .order-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .order-row.row-3 { grid-template-columns: minmax(0, 1fr) auto; }
  .order-side { grid-column: 2 / -1; justify-content: flex-start; }
  .order-total { grid-row: 1; grid-column: 3; min-width: 0; }
  .row-3 .order-total { grid-column: 2; }
  .actions .btn, .actions form:not(.inline-form), .actions form:not(.inline-form) .btn { width: 100%; }
  .inline-form { width: 100%; }
  .inline-form select { flex: 1; }
  .row-line { padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
  .sale-loose { grid-template-columns: minmax(0, 1fr) 1fr 1fr; }
  .sale-loose input:first-of-type { grid-column: 1 / -1; }
  .sale-total .btn { width: 100%; }
  .sheet { padding: 16px; }
  .sheet-facts, .sheet-check, .signatures { grid-template-columns: minmax(0, 1fr); }
}


/* ============================================================================
   Acabamento do painel: mesma família visual da página inicial.
   ========================================================================== */
body { font-size: 16px; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; }
.btn { border-radius: 10px; font-weight: 700; min-height: 42px; transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease; }
.btn:hover:not([disabled]) { transform: translateY(-1px); }
.btn-lg { min-height: 50px; }
.card { border-radius: 14px; padding: 20px; box-shadow: 0 1px 2px rgba(19, 26, 38, 0.04); }
.card h2 { font-size: 17px; }
.card-lead { margin: -6px 0 14px; }
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.icon { flex: none; vertical-align: -0.2em; }

/* barra do topo */
.nav-app { background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--line); min-height: 60px; gap: 24px; }
.nav-app .brand { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.nav-app .brand-mark, .brand-mark { display: block; width: 26px; height: 26px; border-radius: 7px; background: var(--brand); box-shadow: none; position: relative; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; left: 6px; right: 6px; height: 3px; border-radius: 2px; background: #fff; }
.brand-mark::before { top: 8px; }
.brand-mark::after { top: 15px; right: 11px; }
.nav-links { gap: 4px; }
.nav-links a { color: var(--muted); padding: 8px 12px; border-radius: 999px; border-bottom: 0; margin: 0; font-weight: 600; font-size: 15px; }
.nav-links a:hover { color: var(--ink); background: var(--line-soft); }
.nav-links a[aria-current] { color: var(--brand-dark); background: var(--brand-soft); border-bottom: 0; font-weight: 700; }
.nav-app .btn-quiet { background: var(--panel); color: var(--ink); border-color: var(--line); }
.nav-app .btn-quiet:hover { background: var(--line-soft); border-color: var(--line); }
.me { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.who { color: var(--ink); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: 14px; }
.banner { background: var(--brand-soft); border-bottom: 0; color: var(--brand-dark); font-weight: 500; }
.banner-warn { background: var(--warn-bg); color: var(--warn); }
.subnav { gap: 4px; border-bottom: 0; }
.subnav a { border-radius: 999px; border-bottom: 0; margin: 0; font-weight: 600; }
.subnav a[aria-current] { background: var(--ink); color: #fff; border-bottom: 0; }

/* cabeçalhos e lista de OS */
.content { padding-top: 26px; }
.page-head h1 { font-size: clamp(24px, 3vw, 30px); }
.hello { color: var(--muted); font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.os-num { border-radius: 8px; padding: 5px 9px; background: var(--brand); }
.counters { background: transparent; border: 0; border-radius: 0; overflow: visible; gap: 10px; }
.counter { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; flex-direction: column; align-items: flex-start; gap: 2px; display: flex; position: relative; }
.counter:first-child { border-left: 1px solid var(--line); }
.counter::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); position: absolute; top: 14px; right: 14px; }
.counter-aprovacao::before { background: #d99a06; }
.counter-prontas::before { background: var(--ok); }
.counter-atrasadas::before { background: var(--bad); }
.counter-entregues::before { background: #9aa5b5; }
.counter strong { font-size: 26px; font-weight: 800; line-height: 1.1; }
.counter:hover { background: var(--panel); border-color: var(--brand); }
.counter[aria-current] { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.counter[aria-current] strong { color: var(--brand-dark); }
.orders { border-radius: 14px; }
.order-row { padding: 14px 16px; gap: 14px; }
.order-row:hover { background: #f7f9fd; }
.order-num { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 12px; background: var(--line-soft); color: var(--ink); font: 700 14px/1 var(--mono); }
.order-num.status-orcamento { background: var(--warn-bg); color: var(--warn); }
.order-num.status-aprovado, .order-num.status-reparo, .order-num.status-analise { background: var(--brand-soft); color: var(--brand-dark); }
.order-num.status-pronto { background: var(--ok-bg); color: var(--ok); }
.order-num.status-recusado { background: var(--bad-bg); color: var(--bad); }
.order-num.is-low { background: var(--bad-bg); color: var(--bad); }
.order-main strong { font-size: 16px; }
.chip { border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.chip-aprovado, .chip-reparo, .chip-analise { background: var(--brand-soft); color: var(--brand-dark); }
.stats { border-radius: 14px; }
.stat strong { font-size: 22px; font-weight: 800; }
.empty { border-radius: 14px; padding: 44px 16px; }
.notice { border-left: 0; border-radius: 12px; padding: 12px 16px; }
.ag-week, .ag-strip { border-radius: 14px; }
.ag-card { border-radius: 8px; }
.seg { border-radius: 10px; }
.seg-opt input:checked + span { background: var(--brand); }
.seg-ok input:checked + span { background: var(--ok); }
.seg-defeito input:checked + span { background: var(--bad); }

/* primeiros passos */
.ob-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; border-radius: 14px; background: var(--ink); color: #fff; text-decoration: none; }
.ob-card:hover { background: #1d2738; }
.ob-ring { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 3px solid #5b8bff; font-weight: 800; font-size: 14px; flex: none; }
.ob-card-text { display: grid; gap: 1px; flex: 1; min-width: 0; }
.ob-card-text span { color: #b9c4d6; font-size: 14px; }
.ob-card .btn { background: #fff; border-color: #fff; }
.ob { max-width: 760px; margin: 0 auto; padding: 12px 0 24px; }
.ob-kicker { display: inline-block; font-weight: 700; font-size: 13px; color: var(--brand-dark); background: var(--brand-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 14px; }
.ob h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.1; }
.ob-sub { margin-top: 10px; color: var(--muted); font-size: 17px; }
.ob-progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 22px; }
.ob-progress span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--brand); transition: width 0.6s ease; }
.ob-count { font-size: 14px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.ob-steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.ob-step { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.ob-step.is-next { border-color: var(--brand); box-shadow: 0 10px 30px -18px rgba(29, 79, 215, 0.6), inset 0 0 0 1px var(--brand); }
.ob-step.is-done { background: #f7faf8; }
.ob-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--line-soft); color: var(--muted); font-weight: 800; font-size: 17px; flex: none; }
.is-next .ob-mark { background: var(--brand); color: #fff; }
.is-done .ob-mark { background: var(--ok); color: #fff; }
.ob-text { flex: 1; min-width: 0; }
.ob-text h2 { font-size: 18px; }
.ob-text p { color: var(--muted); font-size: 15px; margin-top: 3px; }
.is-done .ob-text h2 { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.ob-done-tag { font-weight: 700; font-size: 14px; color: var(--ok); }
.ob-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 24px; }

/* etapas da OS */
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin-bottom: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px; }
.stage { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; min-width: 0; }
.stage:hover { background: var(--line-soft); }
.stage-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--line-soft); color: var(--muted); font-weight: 800; font-size: 13px; flex: none; }
.stage-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage.is-done .stage-n { background: var(--ok-bg); color: var(--ok); }
.stage.is-now { color: var(--ink); }
.stage.is-now .stage-n { background: var(--brand); color: #fff; }
.stage[aria-current] { background: var(--brand-soft); color: var(--brand-dark); }
.stage-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 4px; }
.side-actions { display: grid; gap: 8px; }
.side-actions .btn { width: 100%; }
.fix-status { margin-top: 14px; font-size: 14px; }
.fix-status summary { cursor: pointer; color: var(--muted); }
.fix-status[open] summary { margin-bottom: 8px; }
.approval h2 { font-size: 21px; }
.approval-orcamento { border-color: #e7c66a; background: #fffaf0; }
.approval-recusado { border-color: #e3a29c; background: #fff6f5; }
.signed img { border-radius: 4px; }

/* fotos */
.photo-grid { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photo-grid li { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line-soft); }
.photo-grid a, .photo-grid img { display: block; width: 100%; height: 100%; }
.photo-grid img { object-fit: cover; }
.photo-del { all: unset; position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(19, 26, 38, 0.75); color: #fff; font-size: 18px; line-height: 26px; text-align: center; cursor: pointer; }
.photo-del:hover { background: var(--bad); }
.photo-del:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.photo-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.photo-drop { flex: 1 1 240px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 2px dashed #b9c6da; border-radius: 12px; background: #f8fafd; cursor: pointer; position: relative; }
.photo-drop:hover { border-color: var(--brand); background: var(--brand-soft); }
.photo-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.photo-drop:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.photo-drop-text { display: grid; gap: 1px; color: var(--ink); font-size: 15px; font-weight: 400; }
.photo-drop-text small { color: var(--muted); font-size: 13px; }
.js-photos [data-photo-submit] { display: none; }

/* página do cliente */
.public { background: var(--bg); }
.tk { max-width: 560px; margin: 0 auto; padding: 0 0 56px; display: grid; gap: 14px; }
.tk > .card, .tk > .tk-status, .tk > .tk-foot, .tk > .tk-demo { margin-inline: 14px; }
.tk-demo { margin-top: 14px; margin-bottom: 0; }
.tk-hero { background: var(--brand); color: #fff; padding: 26px 22px 22px; border-radius: 0 0 26px 26px; }
.tk-shop { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; opacity: 0.92; }
.tk-hello { margin-top: 18px; font-size: 17px; opacity: 0.9; }
.tk-hero h1 { font-size: clamp(28px, 8vw, 36px); color: #fff; line-height: 1.08; margin-top: 2px; }
.tk-meta { font-size: 14px; opacity: 0.85; margin-top: 6px; }
.tk-steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: relative; }
.tk-steps::before { content: ""; position: absolute; top: 17px; left: 8%; right: 8%; height: 3px; background: rgba(255, 255, 255, 0.28); border-radius: 2px; }
.tk-steps li { display: flex; flex-direction: column; align-items: center; gap: 7px; position: relative; font-size: 11px; color: rgba(255, 255, 255, 0.75); text-align: center; white-space: nowrap; }
.tk-dot { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #3f68de; color: rgba(255, 255, 255, 0.7); border: 2px solid rgba(255, 255, 255, 0.28); }
.tk-steps .done .tk-dot { background: #fff; color: var(--brand); border-color: #fff; }
.tk-steps .now .tk-dot { background: #fff; color: var(--brand); border-color: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.28); }
.tk-steps .now { color: #fff; font-weight: 700; font-size: 12px; }
.tk-status { margin-top: -2px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 30px -22px rgba(19, 26, 38, 0.5); border-left: 0; }
.tk-status h2 { font-size: 22px !important; margin-bottom: 6px; }
.tk-status.status-pronto, .tk-status.status-aprovado { background: var(--ok-bg); border-color: #a7dfb9; }
.tk-status.status-orcamento { background: #fffaf0; border-color: #e7c66a; }
.tk-status.status-recusado { background: #fff6f5; border-color: #e3a29c; }
.tk-due { margin-top: 10px; }
.tk-staff { margin-top: 6px; color: var(--muted); font-size: 14px; }
.tk-card { border-radius: 16px; }
.tk-card h2 { font-size: 17px; }
.tk-sub { font-size: 14px; color: var(--muted); font-weight: 700; margin: 4px 0 8px; }
.tk .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sign-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.signed-box { margin: 0; display: grid; gap: 6px; align-content: end; }
.signed-box img, .signed-blank { display: block; width: 100%; height: auto; aspect-ratio: 300 / 110; border-bottom: 1.5px solid var(--ink); }
.signed-box figcaption { font-size: 14px; line-height: 1.35; }
.tk-foot { text-align: center; display: grid; gap: 12px; justify-items: center; margin-top: 8px; }
.tk-foot .btn { width: 100%; }
@media (max-width: 420px) { .tk-steps li:not(.now) .tk-step-name { visibility: hidden; } }

@media (max-width: 900px) {
  .stages { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .stage { flex-direction: column; gap: 4px; padding: 8px 2px; font-size: 11px; text-align: center; }
  .stage-name { white-space: normal; line-height: 1.15; }
}
@media (max-width: 640px) {
  .nav-app { padding-top: 10px; min-height: 0; }
  .nav-app .nav-links { padding: 6px 0 8px; }
  .nav-links a { padding: 7px 11px; }
  .counter { padding: 12px 14px; }
  .ob-step { flex-wrap: wrap; }
  .ob-step .btn { width: 100%; }
  .ob-card .btn { display: none; }
  .stage-actions { justify-content: stretch; }
  .stage-actions > *, .stage-actions .btn { width: 100%; }
  .sign-pair { grid-template-columns: minmax(0, 1fr); }
  .stage:not([aria-current]):not(.is-now) .stage-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .ob-progress span { transition: none; }
  .btn:hover:not([disabled]) { transform: none; }
}


/* ============================================================================
   Estrutura com menu lateral escuro
   ========================================================================== */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: #0f1624; color: #c6d0e0; display: flex; flex-direction: column; gap: 6px; padding: 18px 12px 14px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: #fff; text-decoration: none; font-weight: 800; font-size: 16px; letter-spacing: -0.02em; min-width: 0; }
.side-shop { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-new { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 0 4px 10px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; }
.side-new:hover { background: #2b62f0; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #b3bfd2; text-decoration: none; font-weight: 600; font-size: 15px; }
.side-nav a:hover { background: #1a2436; color: #fff; }
.side-nav a[aria-current] { background: #1e2c47; color: #fff; box-shadow: inset 3px 0 0 #5b8bff; }
.side-nav a[aria-current] .icon { color: #7ea4ff; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 12px 6px 0; border-top: 1px solid #1f2a3d; }
.side-me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; color: #fff; padding: 6px; border-radius: 10px; }
.side-me:hover { background: #1a2436; }
.side-me-text { display: grid; line-height: 1.2; min-width: 0; }
.side-me-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.side-me-text small { color: #8c9ab0; font-size: 12px; }
.side-out { all: unset; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #8c9ab0; cursor: pointer; }
.side-out:hover { background: #1a2436; color: #fff; }
.side :focus-visible { outline: 2px solid #7ea4ff; outline-offset: 2px; }
.main { min-width: 0; }
.content { max-width: 1280px; padding: 28px clamp(16px, 3vw, 36px) 72px; margin: 0; }
.avatar-sm { width: 22px; height: 22px; font-size: 11px; display: inline-grid; vertical-align: middle; }

/* controles de período e segmentos com link */
.seg-link { display: block; padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.seg-link + .seg-link { border-left: 1px solid #b4bbc5; }
.seg-link:hover { background: var(--line-soft); }
.seg-link[aria-current] { background: var(--brand); color: #fff; }
.period { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.period-nav { display: flex; align-items: center; gap: 8px; }
.period-nav strong { min-width: 9em; text-align: center; text-transform: capitalize; }
.period-day input { min-height: 34px; padding: 4px 8px; font-size: 14px; width: auto; }
.period-note { margin: -4px 0 16px; }

/* cartões de números */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.kpi { display: grid; gap: 2px; align-content: start; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; position: relative; min-width: 0; }
a.kpi:hover { border-color: var(--brand); transform: translateY(-1px); }
.kpi { transition: transform 0.15s ease, border-color 0.15s ease; }
.kpi strong { font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--ink); letter-spacing: -0.02em; }
.kpi-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); margin-bottom: 10px; }
.kpi-aprovacao .kpi-icon { background: var(--warn-bg); color: var(--warn); }
.kpi-prontas .kpi-icon { background: var(--ok-bg); color: var(--ok); }
.kpi-atrasadas .kpi-icon { background: var(--bad-bg); color: var(--bad); }
.kpi-entregues .kpi-icon { background: #e9e5fb; color: #5b3fc4; }
.kpi[aria-current] { border-color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); background: #f7faff; }
.kpi.is-warn strong { color: var(--bad); }
.fin-mini .kpi strong { font-size: 22px; }
.order-num { min-width: 62px; }

/* agenda: mês e semana */
.ag-techs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ag-techs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.ag-techs a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.ag-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.ag-main { min-width: 0; }
.ag-side { display: grid; gap: 12px; }
.ag-side .ag-strip { margin: 0; }
.ag-list { display: grid; gap: 8px; }
.ag-strip h2 { font-size: 15px; }
.cal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.cal-head, .cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head span { padding: 10px 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--line); }
.cal-head abbr { text-decoration: none; }
.cal-day { min-height: 112px; padding: 6px; border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; }
.cal-row:first-of-type .cal-day { border-top: 0; }
.cal-day:first-child { border-left: 0; }
.cal-day.is-out { background: #f7f9fc; }
.cal-day.is-out .cal-num { color: #a9b3c2; }
.cal-day.is-past:not(.is-today) .cal-num { color: var(--muted); }
.cal-day.is-over { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--brand-soft); }
.cal-num { align-self: flex-start; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--ink); text-decoration: none; }
.cal-num:hover { background: var(--line-soft); }
.cal-day.is-today .cal-num { background: var(--brand); color: #fff; }
.cal-day.is-today { background: #f5f8ff; }
.cal-more { font-size: 12px; font-weight: 600; }
.cal-count { display: none; }
.ag-pill { display: block; padding: 3px 7px; border-radius: 6px; border-left: 3px solid var(--brand); background: var(--brand-soft); color: var(--ink); text-decoration: none; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; }
.ag-pill b { font-family: var(--mono); font-weight: 700; font-size: 11px; }
.ag-pill:hover { filter: brightness(0.96); }
.ag-pill.st-recebido, .ag-pill.st-analise { border-left-color: #8a96a8; background: var(--line-soft); }
.ag-pill.st-orcamento { border-left-color: #d99a06; background: var(--warn-bg); }
.ag-pill.st-pronto { border-left-color: var(--ok); background: var(--ok-bg); }
.ag-pill.is-late, .ag-pill.st-recusado { border-left-color: var(--bad); background: var(--bad-bg); }
.ag-pill.is-dragging { opacity: 0.4; }
.ag-card.st-recebido, .ag-card.st-analise { border-left-color: #8a96a8; }
.ag-card.st-orcamento { border-left-color: #d99a06; }
.ag-card.st-pronto { border-left-color: var(--ok); }
.ag-tech { display: inline-flex; align-items: center; gap: 5px; }
.ag-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--brand); }
.lg.st-recebido::before { background: #8a96a8; }
.lg.st-orcamento::before { background: #d99a06; }
.lg.st-pronto::before, .lg-in::before { background: var(--ok); }
.lg.is-late::before, .lg-out::before { background: #e2685f; }

/* financeiro */
.fin-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.fin-card { display: grid; gap: 4px; padding: 20px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.fin-card strong { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.fin-label { font-weight: 600; color: var(--muted); font-size: 14px; }
.fin-in .kpi-icon { background: var(--ok-bg); color: var(--ok); }
.fin-out .kpi-icon { background: var(--bad-bg); color: var(--bad); }
.fin-balance { background: #0f1624; border-color: #0f1624; color: #fff; }
.fin-balance .fin-label, .fin-balance .delta { color: #a9b6cc; }
.fin-balance .kpi-icon { background: #1e2c47; color: #7ea4ff; }
.fin-balance.is-neg strong { color: #ff9c94; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.delta-good { color: var(--ok); }
.delta-bad { color: var(--bad); }
.delta-flat { color: var(--muted); font-weight: 500; }
.chart { display: block; width: 100%; height: auto; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.bar-in { fill: var(--ok); }
.bar-out { fill: #e2685f; }
.bar-day { fill: #9db8f5; }
.bar-day.is-best { fill: var(--brand); }
.chart-label { font: 500 10px var(--font); fill: var(--muted); }
.chart-label.is-now { fill: var(--ink); font-weight: 800; }
.chart-legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.chart-table { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.hbars { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; font-size: 15px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hbar-value { font-variant-numeric: tabular-nums; font-weight: 700; }
.hbar-track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.hbar-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--brand); transition: width 0.6s ease; }
.fill-top { background: #5b3fc4; }
.watch { list-style: none; padding: 0; margin: 0 0 14px; }
.watch li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.watch li:first-child { border-top: 0; padding-top: 0; }
.watch .is-warn strong { color: var(--bad); }

/* ============================================================================
   Link do cliente: rastreio estilo entrega
   ========================================================================== */
.tr { max-width: 560px; margin: 0 auto; padding: 0 0 56px; display: grid; gap: 14px; }
.tr > .card, .tr > .tr-now, .tr > .tr-foot, .tr > .tr-demo { margin-inline: 14px; }
.tr-demo { margin-top: 14px; margin-bottom: 0; }
.tr-top { background: #0f1624; color: #fff; padding: 22px 22px 64px; border-radius: 0 0 28px 28px; }
.tr-shop { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.tr-shop-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); font-weight: 800; }
.tr-hello { margin-top: 22px; font-size: 17px; color: #b9c4d6; }
.tr-top h1 { color: #fff; font-size: clamp(28px, 8vw, 38px); line-height: 1.08; margin-top: 2px; }
.tr-meta { font-size: 14px; color: #9aa8bf; margin-top: 8px; }
.tr-progress { margin-top: 20px; display: grid; gap: 8px; }
.tr-bar { height: 10px; border-radius: 999px; background: #243149; overflow: hidden; }
.tr-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #5b8bff, #41d39a); transition: width 0.9s ease; }
.tr-percent { font-size: 13px; font-weight: 700; color: #b9c4d6; }
.tr-now { margin-top: -50px; display: flex; gap: 16px; align-items: flex-start; padding: 20px; background: var(--panel); border-radius: 20px; box-shadow: 0 18px 40px -22px rgba(15, 22, 36, 0.55); border: 1px solid var(--line); }
.tr-now-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--brand); color: #fff; flex: none; }
.tr-orcamento .tr-now-icon { background: #d99a06; }
.tr-pronto .tr-now-icon, .tr-entregue .tr-now-icon, .tr-aprovado .tr-now-icon { background: var(--ok); }
.tr-recusado .tr-now-icon { background: var(--bad); }
.tr-now-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.tr-now h2 { font-size: 23px; margin: 1px 0 4px; }
.tr-facts { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.tr-facts li { display: flex; align-items: center; gap: 7px; }
.tr-facts strong { color: var(--ink); }
.tr-card { border-radius: 18px; }
.tr-card h2 { font-size: 17px; }
.tr-quote-open { border-color: #e7c66a; box-shadow: 0 0 0 3px #fdefc8; }
.tr-sub { font-size: 14px; color: var(--muted); font-weight: 700; margin: 4px 0 8px; }
.tr .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tl { list-style: none; padding: 0; margin: 4px 0 0; }
.tl li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 20px; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl-done::before { background: var(--ok) !important; }
.tl-dot { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--line-soft); color: #9aa5b5; position: relative; z-index: 1; }
.tl-done .tl-dot { background: var(--ok); color: #fff; }
.tl-now .tl-dot { background: var(--brand); color: #fff; box-shadow: 0 0 0 6px var(--brand-soft); animation: tl-pulse 2s ease-in-out infinite; }
@keyframes tl-pulse { 50% { box-shadow: 0 0 0 10px rgba(29, 79, 215, 0.08); } }
.tl-body { padding-top: 5px; min-width: 0; }
.tl-title { font-weight: 700; }
.tl-todo .tl-title { color: #9aa5b5; font-weight: 600; }
.tl-now .tl-title { font-size: 17px; font-weight: 800; }
.tl-time { font-size: 13px; color: var(--muted); }
.tl-todo .tl-time { color: #b3bcc9; }
.tl-text { margin-top: 4px; font-size: 14px; color: var(--muted); }
.tr-foot { text-align: center; display: grid; gap: 12px; justify-items: center; margin-top: 8px; }
.tr-foot .btn { width: 100%; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ag-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px 0; }
  .side-brand { padding: 0; flex: 1; }
  .side-new { display: none; }  /* no celular o botao fica no topo da pagina */
  .side-foot { order: 3; margin: 0; padding: 0; border: 0; }
  .side-me-text { display: none; }
  .side-nav { order: 4; width: 100%; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
  .side-nav a { flex-direction: column; gap: 3px; padding: 8px 12px; font-size: 12px; white-space: nowrap; }
  .side-nav a[aria-current] { box-shadow: inset 0 -3px 0 #5b8bff; }
  .fin-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .kpis, .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 12px; }
  .kpi strong { font-size: 24px; }
  .kpi-icon { width: 32px; height: 32px; margin-bottom: 6px; }
  .period-nav strong { min-width: 0; }
  .cal-day { min-height: 58px; padding: 4px 2px; align-items: center; }
  .cal-day .ag-pill, .cal-more { display: none; }
  .cal-count { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; }
  .cal-num { align-self: center; }
  .cal-head span { padding: 8px 2px; text-align: center; font-size: 11px; }
  .tr-now { flex-direction: row; }
  .tr-now-icon { width: 50px; height: 50px; border-radius: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-now .tl-dot { animation: none; }
  .tr-bar span, .hbar-fill, .kpi { transition: none; }
}
