:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --card-2: #f0f2f4;
  --text: #15191d;
  --muted: #677079;
  --line: #e2e5e9;
  --teal: #0d9488;
  --teal-soft: #d8f3ef;
  --orange: #c2560c;
  --orange-soft: #fdebdc;
  --red: #c62828;
  --red-soft: #fbe2e2;
  --toast-bg: rgba(255, 255, 255, 0.96);
  --blue: #2563eb;
  --blue-soft: #dfe8fd;
  --green: #15803d;
  --green-soft: #dcf2e3;
  --whatsapp: #128c4a;
  --radius: 14px;
  /* Cores por significado (as mesmas do Mac): ok, atenção, perigo, informação e marca */
  --ok: var(--green); --ok-soft: var(--green-soft);
  --warn: var(--orange); --warn-soft: var(--orange-soft);
  --danger: var(--red); --danger-soft: var(--red-soft);
  --info: var(--blue); --info-soft: var(--blue-soft);
  --brand: var(--teal); --brand-soft: var(--teal-soft);
  /* Texto: 6 níveis em rem; 1rem = corpo do sistema (Dynamic Type) */
  --t-xs: 0.7059rem; --t-sm: 0.7647rem; --t-md: 0.8824rem; --t-base: 1rem; --t-lg: 1.1765rem; --t-xl: 1.647rem;
  /* Espaçamento */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1215;
    --card: #181c20;
    --card-2: #20252a;
    --text: #eef1f3;
    --muted: #9aa3ab;
    --line: #2a3036;
    --teal: #2dd4bf;
    --teal-soft: #11312d;
    --orange: #fb923c;
    --orange-soft: #3a2414;
    --red: #f87171;
    --red-soft: #3a1818;
    --toast-bg: rgba(42, 49, 56, 0.96);
    --blue: #7aa2ff;
    --blue-soft: #18233d;
    --green: #4ade80;
    --green-soft: #13301e;
    --whatsapp: #25d366;
  }
}
html { font-size: 106.25%; }
@supports (font: -apple-system-body) {
  html { font: -apple-system-body; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: var(--t-base); line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

/* Estrutura */
.topbar {
  position: sticky; top: 0; z-index: 10;
  padding: var(--safe-top) 16px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.18s ease;
}
.topbar.compact { border-bottom-color: var(--line); }
.nav-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; height: 48px; gap: 8px; }
.nav-side { display: flex; align-items: center; min-width: 0; }
.nav-side.end { justify-content: flex-end; }
.nav-title { pointer-events: none; font-size: var(--t-base); font-weight: 700; text-align: center; opacity: 0; transform: translateY(4px); transition: opacity 0.18s ease, transform 0.18s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar.compact .nav-title { opacity: 1; transform: none; }
.topbar.compact .edit-btn { display: none; }
.large-head { padding: 0 16px 6px; max-width: 720px; margin: 0 auto; }
.title-line { display: flex; align-items: center; gap: 10px; }
.large-head h1 { margin: 0; font-size: calc(var(--t-xl) * 1.14); line-height: 1.15; letter-spacing: -0.02em; }
.large-head .sub { color: var(--muted); font-size: var(--t-sm); margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.sync-dot { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; background: none; padding: 0; margin-top: 4px; }
.back { margin: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.dot.stale { background: var(--orange); }
main { padding: 12px 16px calc(var(--safe-bottom) + 96px); max-width: 720px; margin: 0 auto; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(var(--safe-bottom) + 6px);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  border: 0; background: none; padding: 6px 0 2px; display: grid; justify-items: center; gap: 2px;
  font-size: var(--t-xs); color: var(--muted);
}
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button[aria-current="page"] { color: var(--teal); font-weight: 600; }
.badge-count {
  position: absolute; margin-left: 18px; margin-top: -4px; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: var(--t-xs); font-weight: 700; line-height: 17px; text-align: center;
}

/* Blocos */
.section-title { font-size: var(--t-sm); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 22px 4px 8px; }
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.card + .card { margin-top: 10px; }
.headline { padding: 14px 16px; font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.metric .label { color: var(--muted); font-size: var(--t-sm); }
.metric .value { font-size: var(--t-lg); font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.metric.warn .value { color: var(--orange); }
.list > * { border-top: 1px solid var(--line); }
.list > *:first-child { border-top: 0; }
.row-item {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; width: 100%;
  background: none; border: 0; text-align: left;
}
.row-item:active { background: var(--card-2); }
.row-item .main { flex: 1; min-width: 0; }
.row-item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .meta { color: var(--muted); font-size: var(--t-sm); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .side { text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.row-item .side .small { font-size: var(--t-xs); color: var(--muted); }
.chev { color: var(--muted); flex: none; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); flex: none; }

.pill { display: inline-block; font-size: var(--t-xs); font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill.red { color: var(--red); background: var(--red-soft); }
.pill.orange { color: var(--orange); background: var(--orange-soft); }
.pill.teal { color: var(--teal); background: var(--teal-soft); }
.pill.blue { color: var(--blue); background: var(--blue-soft); }
.pill.green { color: var(--green); background: var(--green-soft); }
.pill.gray { color: var(--muted); background: var(--card-2); }

.segmented { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 13px; font-size: var(--t-md); font-weight: 600;
}
.segmented button { position: relative; }
.segmented button::after { content: ""; position: absolute; inset: -6px -2px; }
.segmented button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
/* Controle segmentado do iOS: abas internas de uma tela (Resumo, A pagar...) */
.seg { display: flex; gap: 2px; padding: 2px; margin: var(--sp-1) 0 var(--sp-3); background: var(--card-2); border-radius: 11px; }
.seg button {
  flex: 1 1 0; min-width: 0; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--text);
  font-size: var(--t-md); font-weight: 600; padding: 0 var(--sp-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.seg button[aria-pressed="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.06); font-weight: 700; }
@media (prefers-color-scheme: dark) { .seg button[aria-pressed="true"] { background: #3a4249; box-shadow: none; } }
.search {
  width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 12px; margin: 4px 0 8px; font-size: var(--t-base);
}

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 14px; font-weight: 600; text-decoration: none;
}
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.whatsapp { background: var(--whatsapp); border-color: var(--whatsapp); color: #fff; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.actions { display: grid; gap: 8px; padding: 12px 14px; }
.actions.two { grid-template-columns: 1fr 1fr; }

/* Detalhe */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 30; }
.sheet-backdrop.enter { animation: fade 0.18s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  background: var(--bg); border-radius: 18px 18px 0 0; padding: 8px 16px calc(var(--safe-bottom) + 18px);
  /* No fim da folha o iPhone passava a rolagem para a página de trás e a folha "travava". */
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
/* Com uma folha aberta, a página de trás não rola (nem pelo fundo escuro). */
body:has(.sheet) { overflow: hidden; }
.sheet-backdrop { touch-action: none; overscroll-behavior: contain; }
.sheet-done { margin-top: 18px; }
.sheet.enter { animation: rise 0.22s ease; }
.sheet .grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet h2 { margin: 2px 0 2px; font-size: var(--t-lg); letter-spacing: -0.01em; }
.sheet .sub { color: var(--muted); margin-bottom: 12px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.kv.total .v { font-size: var(--t-lg); }
.due { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--orange-soft); color: var(--orange); font-weight: 700; }
.due.paid { background: var(--green-soft); color: var(--green); }
.close::after { content: ""; position: absolute; inset: -8px; }
.close { position: absolute; right: 14px; top: 12px; border: 0; background: var(--card-2); border-radius: 50%; width: 30px; height: 30px; font-size: var(--t-lg); line-height: 30px; }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-bottom) + 92px); z-index: 50;
  max-width: 420px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px 12px 12px; border-radius: 16px;
  background: var(--toast-bg); border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--line)); color: var(--text);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  animation: toast-in 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.toast.leaving { animation: toast-out 0.2s ease forwards; }
.toast-icon { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); }
.toast-icon svg { width: 17px; height: 17px; }
.toast.warn { border-color: color-mix(in srgb, var(--orange) 40%, var(--line)); }
.toast.warn .toast-icon { background: var(--orange-soft); color: var(--orange); }
.toast-text { display: grid; gap: 2px; min-width: 0; }
.toast-text strong { font-size: var(--t-md); font-weight: 650; line-height: 1.25; }
.toast-text small { font-size: var(--t-sm); color: var(--muted); line-height: 1.3; }
.toast-text { flex: 1; }
.toast-undo { flex: none; border: 0; background: var(--teal-soft); color: var(--teal); font-weight: 700; font-size: var(--t-md); padding: 8px 12px; border-radius: 10px; }
.toast-undo:active { opacity: 0.7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.leaving { animation-duration: 0.01s; } }

/* Login: entrar, esqueci a senha e criar nova senha */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: calc(var(--sp-5) + var(--safe-top)) calc(var(--sp-4) + env(safe-area-inset-right, 0px)) calc(var(--sp-5) + var(--safe-bottom)) calc(var(--sp-4) + env(safe-area-inset-left, 0px));
  background: radial-gradient(120% 60% at 50% 0%, var(--teal-soft), transparent 70%), var(--bg); }
.login-form { width: 100%; max-width: 380px; display: grid; gap: var(--sp-3); }
.login-brand { display: grid; justify-items: center; gap: var(--sp-2); text-align: center; margin-bottom: var(--sp-3); }
.login-brand img { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); }
.login-brand h1 { margin: var(--sp-2) 0 0; font-size: var(--t-xl); line-height: 1.15; }
.login-brand p { margin: 0; color: var(--muted); font-size: var(--t-md); line-height: 1.4; max-width: 30ch; text-wrap: balance; }
.login p { text-align: center; color: var(--muted); margin: 0 0 8px; }
.login-seal { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); }
.login-seal svg { width: 34px; height: 34px; }
.login-field { display: grid; gap: 6px; }
.login-field label { font-size: var(--t-md); font-weight: 600; color: var(--text); }
.login input[type="email"], .login input[type="password"], .login input[type="text"] { width: 100%; min-height: 48px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 12px; padding: 12px 14px; font-size: max(16px, var(--t-base)); font-family: inherit; box-sizing: border-box; }
.login input:focus-visible, .login button:focus-visible, .login .login-switch input:focus-visible + .track { outline: 3px solid var(--teal); outline-offset: 2px; }
.login input:focus { border-color: var(--teal); }
.login-pass { position: relative; }
.login-pass input { padding-right: 52px !important; }
.login-peek { position: absolute; top: 0; right: 0; width: 48px; height: 48px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: 12px; cursor: pointer; }
.login-peek svg { width: 22px; height: 22px; }
.login-peek[aria-pressed="true"] { color: var(--teal); }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.login-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: var(--t-md); }
.login-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.login-switch .track { position: relative; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--line); transition: background 0.2s ease; }
.login-switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s ease; }
.login-switch input:checked + .track { background: var(--teal); }
.login-switch input:checked + .track::after { transform: translateX(18px); }
.login-link { border: 0; background: none; color: var(--teal); font: inherit; font-size: var(--t-md); font-weight: 600; min-height: 44px; padding: 0 var(--sp-2); cursor: pointer; border-radius: 10px; }
.login-link.center { justify-self: center; }
.login-error { color: var(--danger); font-size: var(--t-md); text-align: center; line-height: 1.4; }
.login-error:empty { display: none; }
.login-note { color: var(--warn); background: var(--warn-soft); border-radius: 12px; padding: 10px 12px; font-size: var(--t-md); text-align: center; line-height: 1.4; }
.login-submit { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; font-size: var(--t-base); }
.login-submit:disabled { opacity: 0.65; }
.login-spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: login-spin-kf 0.8s linear infinite; }
@keyframes login-spin-kf { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .login-spin { animation-duration: 2.4s; } .login-switch .track, .login-switch .track::after { transition: none; } }
.error { color: var(--red); font-size: var(--t-md); text-align: center; }

.install-hint { margin-top: 14px; padding: 12px 14px; font-size: var(--t-md); color: var(--muted); }
.lane-job { padding: 10px 14px; }
.lane-job .title { font-weight: 600; }
.progress { height: 6px; border-radius: 3px; background: var(--card-2); overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--teal); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
.btn:disabled { opacity: 0.45; cursor: default; }
select.search { appearance: auto; }

/* Cores das etapas e das impressoras: as cores do sistema usadas no Mac. */
:root {
  --c-pink: #ff2d55; --c-orange: #ff9500; --c-blue: #007aff; --c-purple: #af52de;
  --c-cyan: #30b0c7; --c-yellow: #ffcc00; --c-green: #34c759; --c-gray: #8e8e93;
}
@media (prefers-color-scheme: dark) {
  :root {
    --c-pink: #ff375f; --c-orange: #ff9f0a; --c-blue: #0a84ff; --c-purple: #bf5af2;
    --c-cyan: #40c8e0; --c-yellow: #ffd60a; --c-green: #30d158; --c-gray: #98989d;
  }
}
.c-pink { --c: var(--c-pink); } .c-orange { --c: var(--c-orange); } .c-blue { --c: var(--c-blue); } .c-purple { --c: var(--c-purple); }
.c-cyan { --c: var(--c-cyan); } .c-yellow { --c: var(--c-yellow); } .c-green { --c: var(--c-green); } .c-gray { --c: var(--c-gray); }
/* No claro o texto escurece um pouco para ser legível sobre o fundo tingido. */
.tint { --c-text: color-mix(in srgb, var(--c) 70%, #000); }
@media (prefers-color-scheme: dark) { .tint { --c-text: var(--c); } }
.pill.tint { color: var(--c-text); background: color-mix(in srgb, var(--c) 18%, transparent); display: inline-flex; align-items: center; gap: 4px; }
.pill svg { width: 12px; height: 12px; flex: none; }
.row-item .meta { display: flex; align-items: center; gap: 5px; }
.meta.wrap { white-space: normal; }

.stage-section { margin-top: 14px; }
.stage-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 8px; border-radius: 10px;
  color: var(--c-text); font-weight: 700; font-size: var(--t-md);
  background: color-mix(in srgb, var(--c) 16%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.stage-head svg { width: 17px; height: 17px; flex: none; }
.stage-head .count, .lane-head .count {
  margin-left: auto; font-size: var(--t-xs); font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 22%, transparent);
}

.metric .hint { color: var(--muted); font-size: var(--t-xs); margin-top: 1px; }

/* Agenda: cada impressora com o fundo na cor dela, como na agenda do Mac. */
.lane {
  margin-top: 14px; border-radius: var(--radius); overflow: hidden;
  background: color-mix(in srgb, var(--c) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
}
.lane-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 700; color: var(--c-text);
  background: color-mix(in srgb, var(--c) 22%, var(--card));
}
.lane-head svg { width: 18px; height: 18px; flex: none; }
.lane .list > * { border-top-color: color-mix(in srgb, var(--c) 22%, transparent); }
.lane .lane-job { border-left: 4px solid var(--c); }
.lane .progress span { background: var(--c); }

/* Estoque */
.group-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.group-title .pill { text-transform: none; letter-spacing: 0; }
.spool { width: 28px; height: 28px; flex: none; }
.supply { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--card-2); color: var(--muted); }
.supply svg { width: 16px; height: 16px; }
.kv .k .item-price { display: block; font-size: var(--t-xs); margin-top: 1px; }

/* Navegação: Mais e voltar */
.tabbar button { position: relative; }
.back { border: 0; background: none; color: var(--teal); font-weight: 600; padding: 0 0 4px; font-size: var(--t-md); }
.menu-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); flex: none; }
.menu-icon svg { width: 19px; height: 19px; }

/* Financeiro */
.metric.danger .value { color: var(--red); }
.metric.good .value { color: var(--green); }
button.metric { text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.metric:active { background: var(--card-2); }
.flow-row { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1.15fr; gap: 6px; padding: 9px 14px; font-size: var(--t-md); font-variant-numeric: tabular-nums; }
.flow-row span:not(:first-child) { text-align: right; }
.flow-head { color: var(--muted); font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.flow-row .in, .side.in { color: var(--green); }
.flow-row .out, .side.out { color: var(--red); }
.flow-row .bal { font-weight: 700; }
.flow-row.negative { background: var(--red-soft); }
.flow-row.negative .bal { color: var(--red); }
.flow-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; background: var(--card-2); color: var(--muted); }
.flow-dot.in { background: var(--green-soft); color: var(--green); }
.flow-dot.out { background: var(--red-soft); color: var(--red); }
.segmented.wrap { flex-wrap: wrap; overflow: visible; }
.segmented.wrap button { flex: 1 1 auto; white-space: normal; }
.flow-row { font-size: var(--t-sm); padding: 9px 12px; }

/* Financeiro › A receber por cliente */
button.metric.selected { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.recv-count { font-size: var(--t-sm); font-weight: 700; color: var(--muted); margin: 2px 2px 8px; font-variant-numeric: tabular-nums; }
.recv-list { overflow: hidden; }
.recv-client + .recv-client { border-top: 1px solid var(--line); }
.recv-client.open { background: color-mix(in srgb, var(--card-2) 55%, transparent); }
.recv-head { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 0; }
.recv-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 0 12px 14px; border: 0; background: none; text-align: left; }
.recv-toggle .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.recv-toggle .title, .recv-order .title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recv-toggle .meta, .recv-order .meta { color: var(--muted); font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recv-toggle .side, .recv-order .side { display: flex; flex-direction: column; align-items: flex-end; flex: none; font-variant-numeric: tabular-nums; }
.recv-toggle .small, .recv-order .small { font-size: var(--t-xs); color: var(--muted); }
.recv-client .amount { font-weight: 800; font-size: var(--t-base); }
.recv-client .amount.orange { color: var(--orange); }
.recv-client .amount.red { color: var(--red); }
.recv-client .amount.inline { display: none; }
.recv-pay { flex: none; padding: 9px 14px; border-radius: 999px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; font-size: var(--t-md); }
.avatar.orange { color: var(--orange); background: var(--orange-soft); }
.avatar.red { color: var(--red); background: var(--red-soft); }
.pay-progress { height: 4px; border-radius: 999px; background: var(--card-2); overflow: hidden; max-width: 220px; margin-top: 3px; }
.pay-progress span { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.recv-orders { padding: 0 12px 12px 64px; display: flex; flex-direction: column; gap: 8px; }
.recv-order { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.recv-order .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; border: 0; background: none; text-align: left; padding: 0; }
.recv-order .amount { font-size: var(--t-md); }
@media (max-width: 480px) {
  .recv-orders { padding-left: 12px; }
  .recv-order { flex-wrap: wrap; }
  .recv-order .main { flex-basis: 100%; }
  .recv-order .side { flex: 1; align-items: flex-start; }
  .recv-toggle .side { display: none; }
  .recv-client .amount.inline { display: block; font-size: var(--t-base); }
  .recv-pay { padding: 8px 12px; font-size: var(--t-md); }
  .avatar { width: 34px; height: 34px; font-size: var(--t-sm); }
}

/* Vendas */
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small { padding: 7px 10px; border-radius: 10px; flex: none; }
.stepper { display: inline-flex; align-items: center; gap: 2px; flex: none; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { border: 0; background: var(--card-2); width: 34px; height: 32px; font-size: var(--t-lg); font-weight: 700; }
.stepper button:disabled { opacity: 0.35; }
.stepper span { min-width: 26px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.settle-head, .settle-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 10px 14px; }
.settle-head { color: var(--muted); font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; padding-bottom: 0; }
.settle-head span:nth-child(2), .settle-head span:nth-child(3) { width: 96px; text-align: center; }
.settle-row .main { min-width: 0; }
.settle-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settle-row .meta { color: var(--muted); font-size: var(--t-xs); }

/* Produção */
.radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.radio.on { border: 6px solid var(--teal); }
.row-item:disabled { opacity: 0.55; }
.roll { padding: 12px 14px; }
.roll .progress { margin-top: 6px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.two-fields label { display: block; margin-bottom: 4px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: var(--t-md); color: var(--muted); }
.check input { margin-top: 2px; width: 18px; height: 18px; }
.lane-meta { padding: 6px 14px; font-size: var(--t-sm); color: var(--c-text); background: color-mix(in srgb, var(--c) 12%, var(--card)); }
.lane-meta b { color: var(--red); }

/* Painel do mês */
.hero { padding: 14px 16px; }
.hero .label { color: var(--muted); font-size: var(--t-sm); }
.hero .value { font-size: var(--t-xl); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero .hint, .metric .hint { color: var(--muted); font-size: var(--t-xs); }
.delta { font-weight: 700; font-size: var(--t-xs); }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.chart-card { padding: 20px; border-radius: 16px; }
.chart-card [hidden] { display: none !important; }
.chart-heading, .chart-inspector { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.chart-heading h3 { margin: 0 0 5px; font-size: var(--t-md); }
.chart-subtitle { color: var(--muted); font-size: var(--t-xs); }
.chart-legend { display: flex; align-items: center; gap: 6px; color: var(--teal); font-size: var(--t-xs); white-space: nowrap; }
.chart-legend::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chart-inspector strong { display: block; font-size: var(--t-xl); font-weight: 650; letter-spacing: -.5px; margin-top: 5px; font-variant-numeric: tabular-nums; }
.day-chart { width: 100%; height: auto; display: block; border-radius: 8px; }
.day-chart:focus-visible { outline: 2px solid var(--teal); outline-offset: 5px; }
.day-chart .bar { fill: url(#day-bar-fill); }
.day-chart .bar.negative { fill: var(--red); }
.day-chart .bar-hit { cursor: pointer; }
.day-chart .bar-hit.dimmed { opacity: .35; }
.day-chart .bar-hit.selected .bar { stroke: var(--text); stroke-width: .6; }
.day-chart .bar-hit:hover .bar { filter: brightness(1.15); }
.day-chart .chart-grid { stroke: var(--line); stroke-width: .6; stroke-dasharray: 3 5; }
.day-chart .chart-zero { stroke: var(--red); stroke-width: .7; stroke-dasharray: 4 4; }
.day-chart .chart-axis-label { fill: var(--muted); font-size: 9px; text-anchor: end; }
.day-chart .tick { fill: var(--muted); font-size: 10px; text-anchor: middle; }
.chart-day-control { display: flex; gap: 12px; align-items: center; margin-top: 10px; color: var(--muted); font-size: var(--t-xs); }
.chart-day-control select { flex: 1; min-height: 44px; }
.chart-note { color: var(--muted); font-size: var(--t-xs); text-align: left; margin-top: 12px; }

.alert-card { border-color: var(--red); background: var(--red-soft); margin-bottom: 10px; }

/* Resumo do período (BI do Servidor) */
.summary { padding: 14px; }
.summary-title { font-weight: 700; font-size: var(--t-base); }
.summary-sub { color: var(--muted); font-size: var(--t-xs); margin: 2px 0 12px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.summary-tile { border-radius: 12px; padding: 10px 11px; background: color-mix(in srgb, var(--c) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); min-width: 0; }
.tile-head { display: flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.tile-head svg { width: 18px; height: 18px; flex: none; padding: 3px; border-radius: 6px; color: var(--c-text); background: color-mix(in srgb, var(--c) 22%, transparent); }
.tile-value { font-size: var(--t-lg); font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tile-hint { color: var(--muted); font-size: var(--t-xs); margin-top: 2px; }
.summary-foot { color: var(--muted); font-size: var(--t-xs); margin-top: 10px; }
.summary-foot.warn { color: var(--orange); }
@media (min-width: 700px) { .summary-grid { grid-template-columns: repeat(4, 1fr); } }

/* Movimentado hoje (Financeiro › Resumo) */
.today-moves { padding: 12px 0 0; }
.moves-head { display: flex; justify-content: space-between; align-items: center; padding: 0 14px; font-weight: 700; }
.link-btn { border: 0; background: none; color: var(--teal); font-weight: 600; font-size: var(--t-md); padding: 0; }
.moves-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 14px 12px; }
.moves-grid .label { color: var(--muted); font-size: var(--t-xs); }
.moves-grid .amount { font-size: var(--t-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.moves-grid .amount.in { color: var(--green); }
.moves-grid .amount.out { color: var(--red); }
.today-moves .list { border-top: 1px solid var(--line); }
.row-item.more { color: var(--teal); font-weight: 600; font-size: var(--t-md); justify-content: center; border-top: 1px solid var(--line); }
.flow-start { color: var(--muted); }
.flow-done { grid-column: 1 / -1; color: var(--muted); font-size: var(--t-xs); text-align: left !important; margin-top: -4px; }

/* Nota abaixo de uma lista (ex.: estimativa da lista de compras). */
.list-note { color: var(--muted); font-size: var(--t-xs); margin: 6px 4px 0; }
.row-item .side .pill { margin-top: 4px; display: inline-block; }
.with-spool { display: flex; align-items: center; gap: 10px; }
/* Rolos do pedido, como as etiquetas de rolo do Servidor. */
.roll-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.roll-chip { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-sm); padding: 3px 9px 3px 4px; border-radius: 999px; background: var(--card-2); }
.roll-chip .spool { width: 16px; height: 16px; }
/* Leitor do QR do cupom. */
.scan-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 7px 12px; background: var(--teal-soft); color: var(--teal); font: inherit; font-size: var(--t-md); font-weight: 600; }
.scan-btn svg { width: 18px; height: 18px; }
.top-actions { display: inline-flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 999px; background: var(--card-2); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.count-note { color: var(--muted); font-weight: 600; margin-left: 4px; }
.scanner { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; }
.scanner video { flex: 1; width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; left: 50%; top: 42%; width: 62vw; max-width: 280px; aspect-ratio: 1; transform: translate(-50%, -50%); border: 3px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
.scanner-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.85) 35%); display: grid; gap: 12px; }
.scanner-msg { color: #fff; text-align: center; font-size: var(--t-md); }
.credit { color: var(--green, #34c759); font-weight: 600; }
.compose-text { width: 100%; min-height: 200px; font: inherit; line-height: 1.4; resize: vertical; margin: 10px 0; }
.compose-backdrop { z-index: 59; }
.sheet.compose { z-index: 60; }
.warn-line { color: var(--orange); font-size: var(--t-xs); font-weight: 600; padding: 6px 0 0; }
.actions.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* Botão ＋ no centro da barra: o atalho para as ações do dia, ao alcance do polegar. */
.tabbar .fab { align-content: center; padding: 0; }
.fab-dot {
  width: 50px; height: 50px; margin-top: -18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--teal); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--teal) 40%, transparent);
  border: 4px solid var(--bg);
}
.tabbar .fab svg { width: 24px; height: 24px; }
.tabbar .fab:active .fab-dot { transform: scale(0.94); }

/* Agora: o que fazer em seguida no Hoje. */
.now { margin-bottom: 14px; }
.now-head { display: flex; align-items: baseline; gap: 8px; margin: 4px 4px 8px; font-size: var(--t-lg); font-weight: 700; }
.now-count { font-size: var(--t-sm); font-weight: 700; color: var(--teal); }
.now-item { gap: 10px; }
.now-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c-dot, var(--teal)); }
.now-item.c-blue { --c-dot: var(--blue); } .now-item.c-green { --c-dot: var(--green); }
.now-item.c-orange { --c-dot: var(--orange); } .now-item.c-teal { --c-dot: var(--teal); }

/* Folha de ações rápidas. */
.sheet.quick h2 { margin-bottom: 12px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick-tile {
  display: grid; justify-items: center; align-content: start; gap: 6px; padding: 12px 4px 10px; min-height: 100px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card-2); color: var(--text); font: inherit;
}
.quick-tile:active { background: var(--teal-soft); }
.quick-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); }
.quick-icon svg { width: 24px; height: 24px; }
.quick-label { font-weight: 700; font-size: var(--t-sm); text-align: center; line-height: 1.2; }
.more-search { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; color: var(--muted); margin-bottom: 4px; }
.more-search svg { width: 18px; height: 18px; flex: none; }
.quick-hint { font-size: var(--t-xs); color: var(--muted); text-align: center; }
.big-input { font-size: var(--t-xl); font-weight: 700; text-align: center; margin: 4px 0 10px; }
.btn.big { padding: 16px; font-size: var(--t-base); }
.link-back { border: 0; background: none; color: var(--teal); font: inherit; font-weight: 600; padding: 0 0 8px; }
.kv.check { cursor: pointer; }

/* Resumo do dia numa faixa só: três números, toque para o Painel. */
.day-strip {
  width: 100%; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 6px; margin: 10px 0 0; padding: 14px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); font: inherit; text-align: left;
}
.day-strip span { display: grid; gap: 2px; }
.day-strip span + span { border-left: 1px solid var(--line); padding-left: 10px; }
.day-strip b { font-size: var(--t-lg); font-weight: 700; }
.day-strip small { font-size: var(--t-xs); color: var(--muted); }

/* Blocos recolhidos do Hoje. */
.folds .fold + .fold { border-top: 1px solid var(--line); }
.fold-head .chev { transition: transform .15s ease; }
.fold.open .fold-head .chev { transform: rotate(90deg); }
.fold-body { padding: 0 10px 10px; }
.fold-body > .card { box-shadow: none; }
.more-row .title { color: var(--teal); font-weight: 600; }
.notice { margin-bottom: 10px; }
@media (prefers-reduced-motion: reduce) { .fold-head .chev { transition: none; } }

/* Receber agrupado por cliente. */
.recv-total { display: flex; gap: 10px; margin: 0 0 10px; }
.recv-total span { flex: 1; display: grid; gap: 2px; padding: 12px; border-radius: var(--radius); background: var(--card-2); }
.recv-total b { font-size: var(--t-lg); }
.recv-total small { font-size: var(--t-xs); color: var(--muted); }
.recv-total .late b, .side .late { color: var(--orange); }
.recv-group + .recv-group { border-top: 1px solid var(--line); }
.recv-group > .row-item .chev { transition: transform .15s ease; }
.recv-group.open > .row-item .chev { transform: rotate(90deg); }
.recv-orders { padding: 0 0 8px 14px; border-left: 3px solid var(--teal-soft); margin: 0 0 6px 14px; }
.recv-orders .actions { padding: 8px 10px 0 0; }

/* Listas com busca (Receber, Venda…): a folha fica com altura fixa, para o campo de busca não descer quando a lista encolhe. */
.sheet.quick:has([data-quick-list]) { height: 92vh; height: 92dvh; }

/* Ações recusadas: cada uma leva ao ajuste e pode ser reenviada ou dispensada. */
.rejection { border-top: 1px solid var(--line); }
.rejection .row-item { border-top: 0; }
.rejection .meta.fix { color: var(--teal); margin-top: 2px; }
.rejection .actions { padding-top: 0; }

/* Puxar para atualizar. */
.pull-refresh {
  position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; z-index: 40; opacity: 0; pointer-events: none;
  padding: 8px 14px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); color: var(--teal);
  font-size: var(--t-md); font-weight: 600; transition: opacity 0.15s ease; transform: translate(-50%, -40px);
}

/* Modelos: busca de preços da biblioteca */
.model-count { color: var(--muted); font-size: var(--t-sm); margin: 2px 4px 8px; }
.model-row { gap: 12px; }
.model-thumb { flex: none; width: 54px; height: 54px; border-radius: 10px; overflow: hidden; background: var(--teal-soft); display: grid; place-items: center; }
.model-thumb img, .model-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.model-fallback { font-size: var(--t-xs); font-weight: 700; color: var(--teal); }
.model-price { font-weight: 700; font-size: var(--t-base); }
.model-star { color: var(--orange); }
.model-photo { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--teal-soft); margin-bottom: 10px; }
.model-photo .model-fallback { font-size: var(--t-lg); }
.model-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.metric.prominent .value { color: var(--teal); font-size: var(--t-xl); }
.metric .extra { color: var(--muted); font-size: var(--t-xs); margin-top: 2px; font-variant-numeric: tabular-nums; }
.model-row .title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.row-item .meta.buy { white-space: normal; color: var(--teal); }
/* Alça: sempre visível no topo da folha e só para arrastar (o iPhone não começa a rolar por ela). */
.sheet .grabber { position: sticky; top: 0; z-index: 3; touch-action: none; box-shadow: 0 0 0 5px var(--bg); }
.sheet .grabber::after { content: ""; position: absolute; inset: -16px -70px; touch-action: none; } /* área maior para pegar com o dedo */
/* Prazo de entrega editável na folha do pedido */
.deadline-edit { padding: 12px 14px; display: grid; gap: 10px; background: var(--teal-soft); }
.deadline-edit .k { color: var(--teal); font-weight: 600; font-size: var(--t-md); }
.deadline-edit .search { margin: 0; }
.deadline-pending { display: block; font-size: var(--t-xs); color: var(--orange); font-weight: 600; }
.kv .link-btn { margin-left: 8px; }

/* Meta do mês (Hoje) */
.goal-card { display: block; width: 100%; text-align: left; padding: 14px 16px; margin: 0; border: 1px solid var(--line); font: inherit; color: var(--text); }
.goal-card.c-teal { --goal: var(--teal); } .goal-card.c-green { --goal: var(--green); } .goal-card.c-orange { --goal: var(--orange); } .goal-card.c-red { --goal: var(--red); }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; color: var(--goal); }
.goal-head b { font-size: var(--t-lg); font-variant-numeric: tabular-nums; }
.goal-bar { position: relative; height: 10px; border-radius: 999px; background: var(--card-2); margin: 10px 0 8px; overflow: hidden; }
.goal-bar span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--goal); }
.goal-bar i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--muted); }
.goal-line { font-size: var(--t-md); font-variant-numeric: tabular-nums; }
.goal-detail { font-size: var(--t-sm); color: var(--muted); margin-top: 2px; }
/* Hoje: cards empilhados com o mesmo respiro de 10px (os botões não pegam o .card + .card). */
.goal-card + .goal-card { margin-top: 10px; }

/* Conferir rolos */
.count-link { width: 100%; margin: 4px 0 10px; }
.count-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.count-filters select { min-height: 44px; }
.count-material { padding: 12px 16px 4px; }
.count-head { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; }
.count-head .main { flex: 1; min-width: 0; }
.count-roll { border-top: 1px solid var(--line); padding: 10px 0; }
.count-roll .row-item { width: 100%; text-align: left; }
.count-roll.done .title { color: var(--muted); }
.count-roll .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.count-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--t-md); }

/* Rendimento da conta: saldo do banco ao lado da Conta no app, com a diferença logo abaixo. */
.yield-check { background: var(--blue-soft); border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent); border-radius: var(--radius); padding: 12px; margin: 0 0 14px; }
.yield-head { display: flex; align-items: center; gap: 8px; color: var(--blue); font-weight: 600; font-size: var(--t-md); margin-bottom: 10px; }
.yield-head svg { width: 18px; height: 18px; }
.yield-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.yield-app { display: grid; gap: 2px; min-width: 0; padding-bottom: 4px; }
.yield-app b { font-size: var(--t-lg); font-variant-numeric: tabular-nums; }
.yield-check small { color: var(--muted); font-size: var(--t-xs); }
.yield-grid .k { display: block; margin-bottom: 4px; }
.yield-grid input { margin: 0; font-size: var(--t-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.yield-diff { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--blue) 18%, transparent); }
.yield-diff span { display: grid; gap: 2px; min-width: 0; }
.yield-diff b { font-size: var(--t-md); }
.yield-diff strong { font-size: var(--t-lg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.yield-diff.up strong { color: var(--green); }
.yield-diff.down strong, .yield-diff.down b { color: var(--orange); }
.yield-diff.even strong { color: var(--muted); }
.yield-hint { color: var(--muted); font-size: var(--t-xs); margin: 10px 0 0; }
[data-yield-after] .yield-hint { margin: -4px 0 8px; text-align: center; }
.yield-hint.ok { color: var(--green); }

/* Esqueleto de carregamento e avisos de falta de sinal */
.sk { background: linear-gradient(90deg, var(--card-2) 25%, color-mix(in srgb, var(--card-2) 70%, var(--card)) 50%, var(--card-2) 75%); background-size: 200% 100%; border-radius: 6px; animation: sk-shimmer 1.3s linear infinite; }
.sk-title { height: 14px; width: 62%; margin-bottom: 8px; } .sk-meta { height: 11px; width: 38%; } .sk-pill { height: 22px; width: 64px; border-radius: 11px; } .sk-big { height: 24px; width: 70%; margin-top: 8px; }
.skeleton .metrics { margin-bottom: 14px; }
.skeleton-row { pointer-events: none; }
@keyframes sk-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.queued-note { color: var(--orange); font-weight: 600; }

/* Folha de ações estilo iOS (actionsheet.js) */
.action-sheet-root { position: fixed; inset: 0; z-index: 90; }
.action-sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); animation: fade 0.18s ease; }
.action-sheet { position: absolute; left: 8px; right: 8px; bottom: calc(var(--safe-bottom) + 8px); max-width: 520px; margin: 0 auto; display: grid; gap: 8px; animation: sheet-up 0.22s ease; }
.action-sheet-group { background: var(--card); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.action-sheet-head { padding: 14px 16px 12px; text-align: center; color: var(--muted); font-size: var(--t-sm); border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.action-sheet-head strong { color: var(--text); font-size: var(--t-md); }
.action-sheet-btn { display: block; width: 100%; min-height: 52px; border: 0; background: transparent; color: var(--blue); font: inherit; font-size: var(--t-lg); cursor: pointer; }
.action-sheet-btn.destructive { color: var(--red); font-weight: 600; }
.action-sheet-btn.cancel { color: var(--blue); font-weight: 600; }
.action-sheet-btn:active { background: var(--card-2); }
.action-sheet-root.leaving { opacity: 0; transition: opacity 0.18s ease; pointer-events: none; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .action-sheet, .action-sheet-backdrop { animation: none; } }

/* Folhas: meia tela e cheia, barra de ação fixa no pé */
.sheet.sheet-main { transition: height 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sheet.sheet-main.half { height: 58vh; height: 58dvh; max-height: 58vh; max-height: 58dvh; }
.sheet.sheet-main.full { height: 92vh; height: 92dvh; }
.sheet.has-bar { padding-bottom: 0; }
.sheet-bar {
  position: sticky; bottom: 0; z-index: 4; margin: 14px -16px 0;
  padding: 10px 16px calc(var(--safe-bottom) + 10px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.sheet-bar .actions { padding: 0; }
@media (prefers-reduced-motion: reduce) { .sheet.sheet-main { transition: none; } }
.kv-btn { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.kv-btn .v { color: var(--teal); }
.kv-btn:active { background: var(--card-2); }

/* Gestos nas listas (rows.js) */
[data-row] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
[data-row].swiping { position: relative; z-index: 1; background: var(--card); will-change: transform; }
.swipe-under { position: absolute; z-index: 0; display: flex; justify-content: space-between; overflow: hidden; }
.swipe-side { display: flex; }
.swipe-btn {
  width: 96px; min-height: 44px; border: 0; border-radius: 0; margin: 0; padding: 0 8px; display: flex; align-items: center; justify-content: center;
  text-align: center; font: inherit; font-size: var(--t-md); font-weight: 700; line-height: 1.15; color: #fff; gap: 6px;
}
.swipe-btn svg { width: 18px; height: 18px; flex: none; }
.swipe-btn.go { background: var(--teal); color: var(--bg); }
.swipe-btn.wa { background: var(--whatsapp); color: #fff; }
.batch-btn { margin: 10px 0 4px; }

/* Áreas de toque de 44 px sem mudar o visual */
.icon-btn, .stepper button { position: relative; }
.icon-btn::after, .stepper button::after { content: ""; position: absolute; inset: -4px; min-width: 44px; min-height: 44px; left: 50%; top: 50%; transform: translate(-50%, -50%); }

/* Hoje personalizável */
.edit-btn { min-height: 44px; padding: 0 var(--sp-2); }
.hoje-tools { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.hoje-edit .row-item { gap: var(--sp-3); }
.hoje-tools .icon-btn:disabled { opacity: 0.3; }
.scan-btn { white-space: nowrap; }
.delta.flat { color: var(--muted); }

/* Troca de aba e entrada de linhas novas. */
@keyframes tab-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
main.tab-in { animation: tab-in 0.2s ease-out; }
main > .row-in { animation: row-in 0.22s ease-out; }
@media (prefers-reduced-motion: reduce) { main.tab-in, main > .row-in { animation: none; } }

/* Fluxo de caixa de 30 dias. */
.flow-chart { padding: 10px 12px 6px; margin-bottom: 8px; }
.flow-chart svg { width: 100%; height: auto; display: block; }
.flow-chart .zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }
.flow-chart .curve { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.flow-chart .dot-neg { fill: var(--red); stroke: var(--card); stroke-width: 2; }
.flow-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.flow-row.first-negative { box-shadow: inset 3px 0 0 var(--red); }

/* Linhas do Painel com detalhe longo quebram em vez de cortar. */
.row-item.wrap-meta .meta { white-space: normal; }

/* Interruptores dos avisos. */
.pref-row { width: 100%; text-align: left; }
.switch { flex: none; width: 51px; height: 31px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); position: relative; transition: background 0.18s ease; }
.switch i { position: absolute; top: 2px; left: 2px; width: 25px; height: 25px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: transform 0.18s ease; }
.switch.on { background: var(--brand); border-color: var(--brand); }
.switch.on i { transform: translateX(20px); }
@media (prefers-reduced-motion: reduce) { .switch, .switch i { transition: none; } }

/* Resultados da busca com ações. */
.result-row { flex-wrap: wrap; }
.result-row > .main { text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; }
.result-actions { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
.result-actions .btn { min-height: 36px; }

/* Estado vazio: ícone, frase e uma ação. */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 20px; }
.empty-state p { margin: 0; max-width: 28ch; line-height: 1.4; }
.empty-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--muted); }
.empty-icon svg { width: 24px; height: 24px; }

/* Agenda: simulador de prazo, cartões de resumo, ocupação e linha do tempo da semana. */
.sim { margin-top: var(--sp-3); padding: var(--sp-3); border-radius: var(--radius); background: color-mix(in srgb, var(--teal) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent); }
.sim-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--t-lg); color: var(--brand); }
.sim-head svg { width: 22px; height: 22px; flex: none; }
.sim-label { margin: var(--sp-3) 0 6px; font-size: var(--t-sm); color: var(--muted); font-weight: 600; }
.sim-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { min-height: 44px; min-width: 56px; padding: 0 14px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; font-size: var(--t-md); font-weight: 700; }
.chip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.sim-input { min-height: 44px; width: 88px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 0 12px; font-size: var(--t-base); font-weight: 600; }
.sim-out { margin-top: var(--sp-3); padding: var(--sp-3); border-radius: 12px; background: var(--card); display: grid; gap: 6px; }
.sim-out.warn { color: var(--orange); background: var(--orange-soft); font-weight: 600; }
.sim-out.empty-ish { color: var(--muted); }
.sim-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: var(--t-md); }
.sim-line .k { color: var(--muted); min-width: 64px; font-size: var(--t-sm); }
.sim-line b { font-variant-numeric: tabular-nums; }
.sim-line.big b { font-size: var(--t-xl); color: var(--brand); line-height: 1.1; }
.sim-sub { color: var(--muted); font-size: var(--t-sm); }
.a-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: var(--sp-3); }
.a-card { border-radius: 12px; padding: 10px; background: color-mix(in srgb, var(--c) 16%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); min-width: 0; }
.a-ico { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--c-text); background: color-mix(in srgb, var(--c) 24%, transparent); }
.a-ico svg { width: 17px; height: 17px; }
.a-label { margin-top: 6px; font-size: var(--t-xs); color: var(--muted); font-weight: 600; }
.a-value { font-size: var(--t-md); font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.a-note { margin-top: 2px; font-size: var(--t-xs); }
.a-note .warn, .lane-free.warn { color: var(--orange); font-weight: 700; }
.flag { display: inline-flex; vertical-align: -2px; }
.flag svg { width: 15px; height: 15px; }
.flag.safe { color: var(--green); } .flag.tight { color: var(--c-yellow); } .flag.late { color: var(--red); }
.lane-free { padding: 8px 14px 0; font-size: var(--t-md); color: var(--c-text); }
.occ { display: flex; align-items: center; gap: 10px; padding: 4px 14px 0; }
.occ .progress { flex: 1; margin-top: 0; }
.occ-pct { font-size: var(--t-xs); color: var(--muted); font-weight: 700; white-space: nowrap; }
.tl { padding: 10px 14px 8px; }
.tl-bar { position: relative; height: 26px; border-radius: 7px; background: var(--card-2); overflow: hidden; }
.tl-block { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; }
.tl-block.solid { background: var(--c); }
.tl-block.line { border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); }
.tl-free { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--green) 22%, transparent); }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--red); }
.tl-days { position: relative; height: 16px; margin-top: 3px; }
.tl-day { position: absolute; font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-day.today { color: var(--brand); font-weight: 800; }
.lane .lane-job .main .meta { white-space: normal; }
.lane .lane-job .title { overflow-wrap: anywhere; }

/* Forma de pagamento: botões grandes lado a lado, um toque (mesmo padrão do app Mac). */
.segmented.pay { overflow: visible; }
.segmented.pay button {
  flex: 1 1 0; border-radius: 12px; padding: 11px 8px; min-height: 44px; text-align: center; white-space: normal;
  border-width: 1.5px;
}
.segmented.pay button[data-value="Pix"] { --pay: var(--teal); }
.segmented.pay button[data-value="Dinheiro"] { --pay: var(--green); }
.segmented.pay button[data-value="Cartão"] { --pay: #5b5bd6; }
.segmented.pay button[data-value] { --pay: var(--pay, var(--muted)); }
.segmented.pay button[aria-pressed="true"] { background: var(--pay, var(--teal)); border-color: var(--pay, var(--teal)); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.segmented.pay button[aria-pressed="false"] { border-color: color-mix(in srgb, var(--pay, var(--line)) 35%, var(--line)); }
