/* KS Business Manager — tema escuro (mesma linguagem visual do KS Leads) */
@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2-variations"), url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #07090f;
  --card: #0f131c;
  --card-2: #151a26;
  --card-3: #1b2130;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --ink: #e7eaf2;
  --strong: #ffffff;
  --slate: #8b93a7;
  --mute: #5f677b;
  --pri: #7c6cff;
  --pri-2: #6a59f5;
  --pri-soft: rgba(124, 108, 255, .14);
  --pri-text: #b4abff;
  --side: #0a0d15;
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, .12);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, .12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .12);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, .12);
  --r: 10px;
  --r-lg: 16px;
  --sidew: 248px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px -16px rgba(0, 0, 0, .6);
  --shadow-hi: 0 20px 50px -20px rgba(0, 0, 0, .8);
  --hover: rgba(255, 255, 255, .05);
  --bar-out: #3a4256;
  --shade: rgba(0, 0, 0, .18);
  --bar-bg: rgba(10, 13, 21, .94);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; color: var(--ink); font: 400 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(124, 108, 255, .10), transparent 60%),
    radial-gradient(700px 400px at 10% 110%, rgba(56, 189, 248, .05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
::selection { background: rgba(124, 108, 255, .35); }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; color: var(--strong); }
h1 { font-size: 25px; }
h2 { font-size: 15.5px; font-weight: 600; margin-bottom: 14px; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
small { font-size: 12.5px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; border-radius: 6px; }

.muted { color: var(--slate); }
.small { font-size: 13px; }
.cap::first-letter { text-transform: uppercase; }
.pre { white-space: pre-line; }
.strong { font-weight: 600; text-decoration: none; color: var(--strong); }
a.strong:hover { color: var(--pri-text); }
.link { color: var(--pri-text); font-weight: 600; text-decoration: none; font-size: 13.5px; }
.link:hover { color: #d4cfff; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.owed { color: var(--red); font-weight: 600; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.dim { opacity: .5; }
.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt { margin-top: 22px; }
.mt-sm { margin-top: 10px; }
.i { width: 18px; height: 18px; flex: none; }
.i.big { width: 34px; height: 34px; color: var(--mute); }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-columns: var(--sidew) 1fr; min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 1200px; margin: 0 auto; padding: 30px 32px 64px; }

.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--side); border-right: 1px solid var(--line); padding: 18px 14px; overflow-y: auto;
}
.side-head { display: flex; align-items: center; gap: 11px; padding: 4px 6px 22px; }
.side-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #8f81ff, #5b49f0); color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: 0 8px 20px -8px rgba(124, 108, 255, .7);
}
.side-logo { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 11px; padding: 3px; flex: none; }
.side-name { min-width: 0; }
.side-name strong { display: block; color: var(--strong); font-size: 14.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-name small { color: var(--slate); font-size: 12px; }
.side-close { display: none; margin-left: auto; background: none; border: 0; color: var(--strong); padding: 6px; cursor: pointer; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  text-decoration: none; font-weight: 500; font-size: 14px; color: var(--slate); position: relative;
  transition: background .12s, color .12s;
}
.side-nav a:hover { background: var(--hover); color: var(--ink); }
.side-nav a.on { background: var(--pri-soft); color: var(--strong); font-weight: 600; }
.side-nav .i { color: var(--mute); }
.side-nav a:hover .i { color: var(--slate); }
.side-nav a.on .i { color: var(--pri-text); }
.side-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px; text-decoration: none; border-radius: 10px; }
.side-user:hover { background: var(--hover); }
.side-user strong { display: block; color: var(--strong); font-size: 13.5px; font-weight: 600; }
.side-user small { color: var(--slate); font-size: 12px; }
.side-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 6px 0; }
.side-logout { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--slate); font: inherit; font-size: 13px; cursor: pointer; padding: 6px 4px; }
.side-logout:hover { color: var(--strong); }
.side-logout .i { width: 16px; height: 16px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--card-3); color: var(--strong); display: grid; place-items: center;
  font-size: 12px; font-weight: 700; flex: none; border: 1px solid var(--line-2);
}
.lang-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--card); }
.lang-switch button { background: none; border: 0; color: var(--slate); font: 600 12px var(--font); padding: 5px 10px; cursor: pointer; }
.lang-switch button.on { background: var(--pri-soft); color: var(--pri-text); }

.topbar { display: none; }
.tabbar { display: none; }
.side-backdrop { display: none; }
.support-bar {
  display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 16px;
  background: linear-gradient(90deg, rgba(124, 108, 255, .22), rgba(124, 108, 255, .12)); border-bottom: 1px solid rgba(124, 108, 255, .3);
  color: var(--strong); font-size: 13.5px; font-weight: 600;
}

/* ---------- Cabeçalho de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .muted { margin: 4px 0 0; }
.page-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--slate); text-decoration: none; font-size: 13.5px; margin-bottom: 6px; }
.crumb .i { width: 16px; height: 16px; }
.crumb:hover { color: var(--ink); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 15px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card-2); color: var(--ink);
  font: 600 13.5px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--card-3); border-color: var(--line-2); color: var(--strong); }
.btn .i { width: 17px; height: 17px; }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; box-shadow: 0 8px 20px -10px rgba(124, 108, 255, .8); }
.btn.primary:hover { background: var(--pri-2); border-color: var(--pri-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--slate); box-shadow: none; }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); color: var(--red); }
.btn.small { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.btn.tiny { min-height: 28px; padding: 4px 10px; font-size: 12.5px; background: var(--pri); color: #fff; border-color: var(--pri); }
.btn.block { width: 100%; }
.btn.static { cursor: default; min-width: 150px; }
.btn.static:hover { background: var(--card-2); border-color: var(--line-2); color: var(--ink); }
.btn.copied { border-color: var(--green); color: var(--green); }
.btn.wa { color: #4ade80; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--slate); cursor: pointer; padding: 0; text-decoration: none; }
.icon-btn:hover { background: var(--hover); color: var(--strong); }
.icon-btn.accent { background: var(--pri); color: #fff; }
.inline { display: inline; margin: 0; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: var(--r) 0 0 var(--r); margin-left: 0; }
.seg .btn:last-child { border-radius: 0 var(--r) var(--r) 0; }
.seg .btn.on { background: var(--pri-soft); color: var(--pri-text); border-color: rgba(124, 108, 255, .45); position: relative; z-index: 1; }
.seg-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Painéis ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.panel + .panel { margin-top: 18px; }
.panel.narrow { max-width: 760px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.cols.wide { grid-template-columns: minmax(0, 1fr) 360px; }
.cols.even { grid-template-columns: 1fr 1fr; margin-top: 18px; }
.cols > .panel + .panel { margin-top: 0; }
.doc-cols { grid-template-columns: minmax(0, 1fr) 330px; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }
.stack-lg { display: grid; gap: 18px; min-width: 0; }
.stack-lg > .panel + .panel { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ---------- Formulários ---------- */
.field { display: grid; gap: 6px; min-width: 0; position: relative; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.field.short { max-width: 220px; }
input, select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--card-2); color: var(--ink); font: 400 14.5px/1.4 var(--font);
}
input::placeholder, textarea::placeholder { color: var(--mute); }
select option { background: var(--card-2); color: var(--ink); }
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px rgba(124, 108, 255, .25); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--pri); margin: 0; flex: none; }
input[readonly] { background: var(--card); color: var(--slate); }
input[type="date"], input[type="time"], input[type="month"] { color-scheme: dark; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.field-link { position: absolute; right: 0; top: 0; font-size: 12.5px; color: var(--pri-text); text-decoration: none; font-weight: 600; display: inline-flex; gap: 3px; align-items: center; }
.field-link .i { width: 14px; height: 14px; }
.box { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 14px 16px 16px; margin: 0; display: grid; gap: 10px; }
.box legend { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; font-weight: 600; font-size: 13.5px; color: var(--strong); }
.box legend .i { width: 16px; height: 16px; color: var(--pri-text); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.danger-zone { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 14px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { max-width: 300px; }

/* ---------- Mensagens ---------- */
.flash { padding: 12px 16px; border-radius: var(--r); margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.flash.success { background: var(--green-soft); border-color: rgba(52, 211, 153, .3); color: #a7f3d0; }
.flash.error { background: var(--red-soft); border-color: rgba(251, 113, 133, .3); color: #fecdd3; }
.flash.info { background: var(--blue-soft); border-color: rgba(96, 165, 250, .3); color: #bfdbfe; }

/* ---------- Abas, busca ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; width: max-content; max-width: 100%; }
.tabs a { padding: 7px 14px; text-decoration: none; color: var(--slate); font-weight: 600; font-size: 13.5px; border-radius: 9px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); background: var(--hover); }
.tabs a.on { color: var(--strong); background: var(--pri-soft); }
.tabs em { font-style: normal; font-size: 11.5px; background: var(--hover); border-radius: 10px; padding: 1px 7px; margin-left: 4px; color: var(--ink); }
.toolbar { margin-bottom: 14px; }
.search { display: flex; align-items: center; gap: 8px; max-width: 420px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 12px; background: var(--card-2); }
.search:focus-within { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(124, 108, 255, .25); }
.search .i { color: var(--mute); }
.search input { border: 0; padding-left: 0; background: transparent; box-shadow: none !important; }

/* ---------- Tabela ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--mute); padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td small { display: block; color: var(--slate); font-size: 12.5px; margin-top: 2px; }
.table th.num, .table td.num { text-align: right; }
.table td.actions { text-align: right; white-space: nowrap; }
.table tbody tr:hover td { background: var(--hover); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; height: 23px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--hover); color: var(--ink); border: 1px solid var(--line); vertical-align: middle; }
.badge.s-sent, .badge.s-confirmed { background: var(--blue-soft); color: #93c5fd; border-color: rgba(96, 165, 250, .25); }
.badge.s-approved, .badge.s-paid, .badge.s-completed { background: var(--green-soft); color: #6ee7b7; border-color: rgba(52, 211, 153, .25); }
.badge.s-overdue, .badge.s-declined { background: var(--red-soft); color: #fda4af; border-color: rgba(251, 113, 133, .25); }
.badge.s-partial, .badge.s-lead { background: var(--amber-soft); color: #fcd34d; border-color: rgba(251, 191, 36, .25); }
.badge.s-void, .badge.s-cancelled { color: var(--mute); text-decoration: line-through; }
h1 .badge { font-size: 12.5px; height: 26px; }

/* ---------- Números de resumo ---------- */
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.figure { padding: 18px 20px; display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.figure span { font-size: 12.5px; color: var(--slate); font-weight: 500; }
.figure strong { font-size: 26px; font-weight: 700; color: var(--strong); letter-spacing: -.02em; }
.figure strong.owed { color: var(--red); }
.figure small { color: var(--mute); font-size: 12px; }

/* ---------- Vazio ---------- */
.empty { text-align: center; padding: 36px 16px; display: grid; justify-items: center; gap: 12px; color: var(--slate); }
.empty p { margin: 0; max-width: 420px; }
.empty.slim { padding: 22px 12px; }

/* ---------- Listas ---------- */
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); text-decoration: none; min-width: 0; border-radius: 0; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--hover); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow strong { display: block; font-weight: 600; font-size: 14px; color: var(--strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .grow small { display: block; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datebox { width: 44px; flex: none; text-align: center; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 4px 0 3px; line-height: 1.1; }
.datebox b { display: block; font-size: 16px; color: var(--strong); }
.datebox small { font-size: 11px; color: var(--slate); }
.time-col { width: 64px; flex: none; font-weight: 600; font-size: 14px; color: var(--strong); }

/* ---------- Cliente ---------- */
.contact-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.contact-strip a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; font-size: 14px; max-width: 100%; }
.contact-strip a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-strip a:hover { border-color: rgba(124, 108, 255, .5); color: var(--strong); }
.contact-strip .i { color: var(--pri-text); }
.contact-list { display: grid; gap: 8px; }
.contact-list a { display: flex; gap: 8px; align-items: flex-start; text-decoration: none; font-size: 14px; word-break: break-word; }
.contact-list a:hover { color: var(--strong); }
.contact-list .i { color: var(--pri-text); margin-top: 2px; }
.facts { margin: 0; display: grid; gap: 10px; }
.facts div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.facts dt { color: var(--slate); font-size: 13.5px; }
.facts dd { margin: 0; font-weight: 700; font-size: 18px; color: var(--strong); }
.facts dd.owed { color: var(--red); }
.facts dd.pos { color: var(--green); }

/* ---------- Hoje ---------- */
.today-head { margin-bottom: 22px; }
.today-head > .muted { margin: 0 0 4px; font-size: 14.5px; }
.today-date { font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.today-line { margin: 8px 0 0; font-size: 15px; color: var(--slate); }
.timeline { padding: 6px 22px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 74px 1fr auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); position: relative; align-items: start; }
.tl-item:last-child { border-bottom: 0; }
.tl-item time { font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--strong); }
.tl-item time small { display: block; font-weight: 400; color: var(--mute); font-size: 12px; }
.tl-body { border-left: 3px solid var(--who, var(--line-2)); padding-left: 14px; min-width: 0; }
.tl-title { display: block; font-weight: 600; font-size: 16px; text-decoration: none; color: var(--strong); }
.tl-title:hover { color: var(--pri-text); }
.tl-body > span { color: var(--slate); font-size: 13.5px; }
.tl-links { display: flex; gap: 16px; margin-top: 7px; flex-wrap: wrap; }
.tl-links a { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--pri-text); text-decoration: none; }
.tl-links a:hover { color: #d4cfff; }
.tl-links .i { width: 15px; height: 15px; }
.tl-side { display: grid; gap: 6px; justify-items: end; }
.tl-item.is-now::before { content: ""; position: absolute; left: -22px; top: 0; bottom: 0; width: 3px; background: var(--pri); box-shadow: 0 0 14px var(--pri); }
.tl-item.st-completed .tl-title { color: var(--slate); }
.tl-item.st-completed time { color: var(--mute); }
.done-mark { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: 13px; font-weight: 600; }
.review-mark { display: inline-flex; align-items: center; gap: 4px; color: var(--amber); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.review-mark .i { width: 15px; height: 15px; }
a.review-mark:hover { color: #fde68a; }
.ledger dl { margin: 0; display: grid; gap: 9px; }
.ledger dl div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.ledger dt { color: var(--slate); }
.ledger dd { margin: 0; font-weight: 600; color: var(--strong); }
.ledger dd.pos { color: var(--green); }
.ledger .sum { border-top: 1px solid var(--line); padding-top: 10px; }
.ledger .sum dt { color: var(--strong); font-weight: 600; }
.ledger .sum dd { font-size: 22px; font-weight: 750; }
.ledger .sum dd.neg { color: var(--red); }
.ledger dl.sub { margin: 16px 0 14px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.ledger dl.sub dd a { text-decoration: none; }
.attention { display: grid; gap: 4px; padding: 10px; background: var(--amber-soft); border-color: rgba(251, 191, 36, .25); }
.attention a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; text-decoration: none; font-weight: 600; font-size: 14px; border-radius: 9px; color: #fde68a; }
.attention a:hover { background: var(--hover); }
.setup { margin-bottom: 20px; border-color: rgba(124, 108, 255, .35); background: linear-gradient(180deg, rgba(124, 108, 255, .10), var(--card) 70%); }
.setup-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; color: var(--slate); }
.setup-steps a { color: var(--pri-text); font-weight: 600; text-decoration: none; }
.setup-steps li.done a { color: var(--mute); text-decoration: line-through; }

/* ---------- Agenda ---------- */
.cal-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.cal-controls select { width: auto; min-width: 180px; min-height: 40px; }
.week, .month { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day { border-left: 1px solid var(--line); min-height: 420px; display: flex; flex-direction: column; min-width: 0; }
.day:first-child { border-left: 0; }
.day-head { display: flex; align-items: baseline; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.day-head span { font-size: 12.5px; color: var(--slate); font-weight: 600; }
.day-head b { font-size: 19px; color: var(--strong); }
.day.is-today .day-head { background: var(--pri-soft); }
.day.is-today .day-head span { color: var(--pri-text); }
.day.is-past { background: var(--shade); }
.day-body { padding: 8px; display: grid; gap: 6px; align-content: start; flex: 1; }
.event {
  display: grid; gap: 1px; padding: 7px 9px 7px 10px; border-radius: 9px; text-decoration: none; font-size: 12.5px; line-height: 1.3;
  background: var(--card-2); border: 1px solid var(--line-2); border-left: 3px solid var(--who, var(--mute)); min-width: 0;
}
.event time { font-weight: 700; font-size: 12px; color: var(--strong); }
.event strong { font-weight: 600; color: var(--strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event span, .event small { color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event:hover { border-color: rgba(124, 108, 255, .5); border-left-color: var(--who, var(--mute)); }
.event.st-confirmed { background: var(--blue-soft); }
.event.st-completed { background: var(--green-soft); }
.event.st-completed strong { color: var(--slate); }
.event.st-cancelled { background: transparent; border-style: dashed; opacity: .6; }
.event.st-cancelled strong { text-decoration: line-through; }
.day-add { display: grid; place-items: center; height: 30px; border-radius: 8px; color: var(--mute); text-decoration: none; opacity: 0; transition: opacity .12s; }
.day:hover .day-add, .day-add:focus-visible { opacity: 1; }
.day-add:hover { background: var(--hover); color: var(--strong); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-wd { padding: 9px 10px; font-size: 12px; font-weight: 600; color: var(--mute); border-bottom: 1px solid var(--line); }
.mcell { min-height: 112px; padding: 6px 7px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); text-decoration: none; display: flex; flex-direction: column; gap: 3px; min-width: 0; position: relative; }
.mcell:nth-child(7n + 1) { border-left: 0; }
.mcell b { font-size: 13.5px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
.mcell.out { background: var(--shade); }
.mcell.out b { color: var(--mute); }
.mcell.is-today b { background: var(--pri); color: #fff; box-shadow: 0 4px 14px -4px rgba(124, 108, 255, .9); }
.mcell:hover { background: var(--hover); }
.chip { font-size: 11.5px; padding: 2px 6px; border-radius: 5px; background: var(--card-3); color: var(--ink); border-left: 3px solid var(--who, var(--mute)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.st-confirmed { background: var(--blue-soft); }
.chip.st-completed { background: var(--green-soft); color: var(--slate); }
.chip.st-cancelled { text-decoration: line-through; color: var(--mute); background: transparent; }
.more { font-size: 11.5px; color: var(--slate); padding-left: 4px; }
.mdot { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 12.5px; color: var(--slate); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 10px; border-radius: 3px; display: inline-block; border: 1px solid var(--line-2); background: var(--card-2); }
.lg.st-confirmed { background: var(--blue-soft); border-color: rgba(96, 165, 250, .4); }
.lg.st-completed { background: var(--green-soft); border-color: rgba(52, 211, 153, .4); }
.lg.st-cancelled { background: transparent; border-style: dashed; }
.lg.in { background: var(--pri); border-color: var(--pri); }
.lg.out { background: var(--bar-out); border-color: var(--bar-out); }

/* ---------- Equipe / configurações ---------- */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line-2); }
.swatch input:checked + span { box-shadow: 0 0 0 2px #fff; }
.swatch input:focus-visible + span { outline: 2px solid var(--pri); outline-offset: 2px; }
.logo-row { display: flex; align-items: flex-end; gap: 16px; }
.logo-row .grow { flex: 1; }
.logo-preview { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; background: #fff; flex: none; }
.empty-logo { display: grid; place-items: center; font-weight: 800; color: var(--mute); font-size: 20px; background: var(--card-2); }
.code { background: #05070b; color: #c9d1e0; padding: 16px; border-radius: var(--r); overflow-x: auto; line-height: 1.55; margin: 0; border: 1px solid var(--line); }
.code-line { display: grid; gap: 4px; }
.code-line code { background: var(--card-3); color: var(--pri-text); padding: 8px 10px; border-radius: 8px; word-break: break-all; border: 1px solid var(--line); }
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.copy-row code { flex: 1; background: var(--card-3); color: var(--pri-text); padding: 9px 10px; border-radius: 8px; word-break: break-all; border: 1px solid var(--line); }
.copy-row input { flex: 1; min-width: 0; font-size: 12.5px; }
.review-box { border-color: rgba(251, 191, 36, .25); }
.review-box h2 { display: flex; align-items: center; gap: 8px; }
.review-box h2 .i { color: var(--amber); }
.share-buttons { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Financeiro ---------- */
.fin-figures { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 26px; gap: 0; }
.fin-figures > div { padding: 0 20px; border-left: 1px solid var(--line); }
.fin-figures > div:first-child { padding-left: 0; border-left: 0; }
.fin-figures dt { font-size: 12.5px; color: var(--slate); font-weight: 500; }
.fin-figures dd { margin: 2px 0; font-size: 26px; font-weight: 750; color: var(--strong); letter-spacing: -.02em; }
.fin-figures dd.pos { color: var(--green); }
.fin-figures dd.neg { color: var(--red); }
.fin-figures dd a { text-decoration: none; }
.fin-figures small { color: var(--mute); }
.fin-figures .profit dd { font-size: 30px; }
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; height: 190px; align-items: end; border-bottom: 1px solid var(--line-2); padding: 0 4px; }
.bar-group { display: grid; grid-template-rows: 1fr auto; height: 100%; position: relative; }
.bar-pair { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 100%; }
.bar { width: 34%; max-width: 30px; min-height: 2px; border-radius: 6px 6px 0 0; }
.bar.in { background: linear-gradient(180deg, #9a8dff, #6a59f5); }
.bar.out { background: var(--bar-out); }
.bar-group.on .bar.in { box-shadow: 0 0 18px rgba(124, 108, 255, .6); }
.bar-label { position: absolute; top: 100%; left: 0; right: 0; text-align: center; padding-top: 6px; font-size: 12px; color: var(--slate); text-decoration: none; font-weight: 600; }
.bar-label small { display: block; font-weight: 400; color: var(--mute); font-size: 11px; }
.bar-group.on .bar-label { color: var(--strong); }
.fin-top .legend { margin-top: 52px; }
.expense-form { display: grid; grid-template-columns: 1fr 110px 140px; gap: 8px; margin-bottom: 12px; }
.expense-form input[name="description"] { grid-column: 1 / -1; }
.expense-form input[type="date"] { grid-column: 1 / 2; }
.expense-form button { grid-column: 2 / -1; }

/* ---------- Estimate / invoice (formulário) ---------- */
.items { display: grid; gap: 8px; margin-bottom: 10px; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) 84px 120px 104px 36px; gap: 8px; align-items: start; }
.item textarea { min-height: 42px; resize: none; overflow: hidden; }
.item-head span { font-size: 12px; font-weight: 600; color: var(--mute); }
.line-total { padding-top: 11px; font-weight: 600; color: var(--strong); }
.remove-item { margin-top: 3px; }
.doc-totals { margin: 18px 0 0 auto; max-width: 340px; display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.doc-totals > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.doc-totals input { width: 120px; min-height: 36px; text-align: right; }
.doc-totals .grand { border-top: 1px solid var(--line-2); padding-top: 10px; font-size: 19px; font-weight: 750; color: var(--strong); }
#addService { width: auto; max-width: 280px; min-height: 36px; font-size: 13.5px; }

/* ---------- Folha do documento (sempre papel branco) ---------- */
.sheet {
  --s-ink: #17202E; --s-slate: #5B6678; --s-mute: #8A94A6; --s-line: #E2E6EC; --s-paper: #F3F4F6;
  background: #fff; color: #1B2433; border-radius: 6px; box-shadow: var(--shadow-hi); padding: 46px 48px 40px; font-size: 14px;
}
.sheet h2 { color: var(--s-ink); }
.sheet-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 2px solid var(--s-ink); }
.sheet-from { display: grid; gap: 2px; font-size: 13.5px; color: var(--s-slate); max-width: 55%; }
.sheet-from strong { color: var(--s-ink); font-size: 17px; margin-bottom: 2px; }
.sheet-logo { max-width: 150px; max-height: 64px; object-fit: contain; margin-bottom: 10px; }
.sheet-title { text-align: right; display: grid; align-content: start; justify-items: end; gap: 2px; }
.sheet-title h2 { font-size: 34px; margin: 0; letter-spacing: -.03em; font-weight: 800; }
.sheet-no { color: var(--s-slate); font-size: 14px; }
.stamp { margin-top: 10px; border: 2px solid currentColor; border-radius: 6px; padding: 2px 10px; font-weight: 750; font-size: 13px; transform: rotate(-4deg); }
.stamp.st-paid, .stamp.st-approved { color: #1F7A52; }
.stamp.st-void, .stamp.st-declined, .stamp.st-overdue { color: #B23A2E; }
.sheet-meta { display: flex; justify-content: space-between; gap: 24px; padding: 22px 0; }
.sheet-meta > div { display: grid; gap: 2px; font-size: 13.5px; color: var(--s-slate); }
.sheet-meta strong { color: var(--s-ink); font-size: 15.5px; }
.sheet-label { font-size: 12px; font-weight: 650; color: var(--s-mute); margin-bottom: 3px; display: block; }
.sheet-meta dl { margin: 0; display: grid; gap: 4px; min-width: 220px; font-size: 13.5px; }
.sheet-meta dl div { display: flex; justify-content: space-between; gap: 16px; }
.sheet-meta dt { color: var(--s-slate); }
.sheet-meta dd { margin: 0; color: var(--s-ink); }
.sheet-meta dl .strong { background: var(--s-paper); padding: 7px 10px; border-radius: 6px; margin-top: 4px; font-weight: 700; color: var(--s-ink); }
.sheet-meta dl .strong dt { color: var(--s-ink); }
.sheet-items { width: 100%; border-collapse: collapse; }
.sheet-items th { text-align: left; font-size: 12px; font-weight: 650; color: var(--s-mute); padding: 0 8px 8px; border-bottom: 1px solid var(--s-ink); }
.sheet-items td { padding: 12px 8px; border-bottom: 1px solid var(--s-line); vertical-align: top; color: var(--s-ink); }
.sheet-items th:first-child, .sheet-items td:first-child { padding-left: 0; }
.sheet-items th:last-child, .sheet-items td:last-child { padding-right: 0; }
.sheet-sum { margin: 16px 0 0 auto; max-width: 300px; display: grid; gap: 6px; }
.sheet-sum div { display: flex; justify-content: space-between; color: var(--s-slate); }
.sheet-sum .total { color: var(--s-ink); font-weight: 750; font-size: 17px; border-top: 1px solid var(--s-ink); padding-top: 8px; margin-top: 2px; }
.sheet-notes { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--s-line); }
.sheet-notes p { margin: 0; color: #2A3547; }
.sheet-signed { margin: 18px 0 0; color: #1F7A52; font-weight: 650; font-size: 13.5px; }

/* ---------- Página pública (cliente final): clara ---------- */
body.bare.light {
  color-scheme: light; --ink: #17202E; --strong: #17202E; --slate: #5B6678; --mute: #8A94A6;
  --card: #FFFFFF; --card-2: #FFFFFF; --card-3: #F3F4F6; --line: #E2E6EC; --line-2: #CDD3DC;
  --pri: #17202E; --pri-2: #2A3547; --pri-soft: rgba(23, 32, 46, .06); --pri-text: #2F5FA8;
  background: #F3F4F6; color: var(--ink);
}
body.bare.light .btn.primary { box-shadow: none; }
body.bare.light .btn:hover { color: var(--ink); border-color: var(--ink); background: #fff; }
body.bare.light .btn.primary:hover { color: #fff; background: var(--pri-2); }
body.bare.light .sheet { box-shadow: 0 1px 2px rgba(23, 32, 46, .05), 0 12px 32px -14px rgba(23, 32, 46, .22); border: 1px solid #E2E6EC; }
body.bare.light .flash.success { background: #E3F2EA; border-color: #BBDDC9; color: #134D33; }
body.bare.light .flash.error { background: #F8E5E2; border-color: #EBC2BC; color: #7E2318; }
body.bare.light input:focus { box-shadow: 0 0 0 3px rgba(47, 95, 168, .2); border-color: var(--ink); }
.share { max-width: 860px; margin: 0 auto; padding: 28px 20px 48px; }
.share-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; font-size: 15px; }
.respond { margin-top: 20px; }
.respond h2 { font-size: 20px; }
.share-foot { text-align: center; color: var(--mute); font-size: 12.5px; margin-top: 26px; }

/* ---------- Login / instalação / erro ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 34px 32px; box-shadow: var(--shadow-hi); }
.auth-card.wide { max-width: 620px; }
.auth-card h1 { font-size: 24px; margin: 22px 0 6px; }
.auth-card h2 { margin: 6px 0 0; font-size: 15px; }
.auth-brand { display: flex; align-items: center; gap: 11px; }
.auth-brand strong { display: block; font-size: 15.5px; color: var(--strong); }
.auth-brand small { color: var(--slate); font-size: 12.5px; }
.auth-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--slate); }
.auth-code { font-size: 56px; font-weight: 800; margin: 0; color: var(--pri-text); line-height: 1; letter-spacing: -.04em; }
.checks { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 13.5px; }
.checks .ok { color: var(--green); }
.checks .bad { color: var(--red); font-weight: 650; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .cols, .cols.wide, .doc-cols { grid-template-columns: minmax(0, 1fr); }
  .fin-figures { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .fin-figures > div:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 900px) {
  :root { --sidew: 280px; }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidew); z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  .side-close { display: block; }
  body.side-open .side { transform: none; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 50; }
  .topbar {
    display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; padding: 8px 10px;
    padding-top: max(8px, env(safe-area-inset-top)); background: var(--bar-bg); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line); color: var(--strong); position: sticky; top: 0; z-index: 40;
  }
  .topbar .icon-btn { color: var(--strong); }
  .topbar-title { text-align: center; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page { padding: 18px 14px calc(92px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--bar-bg); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 9px 2px 8px; text-decoration: none; color: var(--mute); font: 600 10.5px var(--font); background: none; border: 0; cursor: pointer; }
  .tabbar a.on { color: var(--pri-text); }
  .tabbar .i { width: 22px; height: 22px; }
  h1 { font-size: 22px; }
  .today-date { font-size: 28px; }
  .page-head { align-items: flex-start; margin-bottom: 16px; }
  .page-head > .btn.primary { display: none; }
  .panel { padding: 16px; border-radius: 14px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid3 > :first-child { grid-column: 1 / -1; }
  .figures { grid-template-columns: 1fr; gap: 8px; }
  .figure { padding: 12px 16px; grid-template-columns: 1fr auto; align-items: baseline; }
  .figure strong { font-size: 19px; }
  .figure small { grid-column: 1 / -1; }
  .cols.even { grid-template-columns: 1fr; }

  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
  .table tr:last-child { border-bottom: 0; }
  .table td { padding: 0; border: 0; text-align: left !important; }
  .table td:first-child { grid-column: 1 / -1; font-size: 15px; }
  .table td:not(:first-child):not(.actions)::before { content: attr(data-label) ": "; color: var(--mute); font-size: 12px; }
  .table td.actions { grid-column: 1 / -1; margin-top: 8px; }
  .table td:empty { display: none; }
  .table tbody tr:hover td { background: none; }
  .clip { max-width: none; white-space: normal; }

  .week { grid-template-columns: 1fr; }
  .day { border-left: 0; border-top: 1px solid var(--line); min-height: 0; flex-direction: row; }
  .day:first-child { border-top: 0; }
  .day-head { flex-direction: column; align-items: center; gap: 0; width: 58px; flex: none; border-bottom: 0; border-right: 1px solid var(--line); padding: 10px 4px; }
  .day-body { padding: 8px; }
  .day.is-empty .day-body { padding: 6px 8px; }
  .day-add { opacity: 1; height: 34px; justify-content: start; padding-left: 8px; }
  .day.is-past.is-empty { display: none; }
  .event { grid-template-columns: auto 1fr; column-gap: 10px; font-size: 13.5px; }
  .event time { grid-row: span 3; font-size: 13.5px; }
  .month { font-size: 12px; }
  .mcell { min-height: 58px; padding: 4px; align-items: center; }
  .mcell .chip, .mcell .more { display: none; }
  .mdot { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: var(--pri); color: #fff; font-size: 11px; font-weight: 700; padding: 0 5px; }

  .tl-item { grid-template-columns: 58px 1fr; }
  .tl-side { grid-column: 2; justify-items: start; }
  .tl-item.is-now::before { left: -16px; }
  .timeline { padding: 4px 16px; }

  .item { grid-template-columns: 1fr 1fr 36px; }
  .item textarea { grid-column: 1 / -1; }
  .item .line-total { display: none; }
  .item-head { display: none; }
  .doc-totals { max-width: none; }

  .sheet { padding: 24px 18px; }
  .sheet-head, .sheet-meta { flex-direction: column; }
  .sheet-from { max-width: none; }
  .sheet-title { text-align: left; justify-items: start; }
  .sheet-title h2 { font-size: 28px; }
  .sheet-items th:nth-child(2), .sheet-items td:nth-child(2), .sheet-items th:nth-child(3), .sheet-items td:nth-child(3) { display: none; }

  .fin-figures dd { font-size: 21px; }
  .fin-figures .profit dd { font-size: 23px; }
  .bars { height: 150px; gap: 6px; }
  .expense-form { grid-template-columns: 1fr 1fr; }
  .expense-form select { grid-column: 1 / -1; }
  .expense-form input[type="date"] { grid-column: auto; }
  .expense-form button { grid-column: 1 / -1; }
  .hide-sm { display: none; }
  .list-row { flex-wrap: wrap; }
  .inline-form { flex-wrap: wrap; }
  .inline-form input { max-width: none; }
  .checks { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px; }
  .tabs { width: 100%; }
}
@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr; }
  .head-actions { width: 100%; }
}

@media print {
  .side, .topbar, .tabbar, .share-bar, .respond, .share-foot, .page-head, aside, .support-bar { display: none !important; }
  body, body.bare { background: #fff !important; }
  .app, .cols { display: block; }
  .page, .share { padding: 0; max-width: none; }
  .sheet { border: 0; box-shadow: none; padding: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ===================== Tema claro (escolha do usuário) ===================== */
body.theme-light {
  color-scheme: light;
  --bg: #F4F5F8;
  --card: #FFFFFF;
  --card-2: #FFFFFF;
  --card-3: #EEF0F4;
  --line: #E4E7ED;
  --line-2: #D3D8E1;
  --ink: #1B2230;
  --strong: #0F1520;
  --slate: #5B6475;
  --mute: #8A93A5;
  --pri: #6A59F5;
  --pri-2: #5847EA;
  --pri-soft: rgba(106, 89, 245, .10);
  --pri-text: #5443E0;
  --side: #FFFFFF;
  --green: #12805A;
  --green-soft: rgba(18, 128, 90, .10);
  --red: #D23B53;
  --red-soft: rgba(210, 59, 83, .09);
  --amber: #B7791F;
  --amber-soft: rgba(245, 158, 11, .12);
  --blue: #2F6FDC;
  --blue-soft: rgba(47, 111, 220, .09);
  --shadow: 0 1px 2px rgba(15, 21, 32, .04), 0 8px 24px -18px rgba(15, 21, 32, .25);
  --shadow-hi: 0 20px 50px -24px rgba(15, 21, 32, .35);
  --hover: rgba(15, 21, 32, .04);
  --bar-out: #D3D8E1;
  --shade: rgba(15, 21, 32, .025);
  --bar-bg: rgba(255, 255, 255, .94);
  background: radial-gradient(900px 500px at 85% -10%, rgba(106, 89, 245, .07), transparent 60%), var(--bg);
  background-attachment: fixed;
}
body.theme-light ::selection { background: rgba(106, 89, 245, .2); }
body.theme-light .btn.primary { box-shadow: 0 8px 18px -10px rgba(106, 89, 245, .6); }
body.theme-light .link:hover, body.theme-light .tl-links a:hover { color: var(--pri-2); }
body.theme-light .side-nav a.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pri); }
body.theme-light input[type="date"], body.theme-light input[type="time"], body.theme-light input[type="month"] { color-scheme: light; }
body.theme-light .flash.success { color: #0E5E43; border-color: rgba(18, 128, 90, .25); }
body.theme-light .flash.error { color: #9B1C31; border-color: rgba(210, 59, 83, .25); }
body.theme-light .flash.info { color: #1E4E9E; border-color: rgba(47, 111, 220, .25); }
body.theme-light .badge.s-sent, body.theme-light .badge.s-confirmed { color: #1E4E9E; }
body.theme-light .badge.s-approved, body.theme-light .badge.s-paid, body.theme-light .badge.s-completed { color: #0E5E43; }
body.theme-light .badge.s-overdue, body.theme-light .badge.s-declined { color: #9B1C31; }
body.theme-light .badge.s-partial, body.theme-light .badge.s-lead { color: #8A5A0B; }
body.theme-light .attention a { color: #7A4F06; }
body.theme-light .attention a:hover { background: rgba(255, 255, 255, .7); }
body.theme-light .review-mark { color: #A66A0A; }
body.theme-light .btn.wa { color: #12805A; }
body.theme-light .setup { background: linear-gradient(180deg, rgba(106, 89, 245, .07), var(--card) 70%); }
body.theme-light .bar.in { background: linear-gradient(180deg, #8c7dff, #5847EA); }
body.theme-light .bar-group.on .bar.in { box-shadow: 0 0 14px rgba(106, 89, 245, .35); }
body.theme-light .tl-item.is-now::before { box-shadow: none; }
body.theme-light .support-bar { color: var(--strong); background: linear-gradient(90deg, rgba(106, 89, 245, .16), rgba(106, 89, 245, .08)); }
body.theme-light .sheet { box-shadow: 0 1px 2px rgba(15, 21, 32, .05), 0 14px 34px -16px rgba(15, 21, 32, .28); border: 1px solid var(--line); }
body.theme-light .code { background: #0F1520; color: #D6DCE8; }

/* Botão de tema */
.theme-btn { display: inline-grid; place-items: center; width: 32px; height: 30px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); color: var(--slate); cursor: pointer; padding: 0; }
.theme-btn:hover { color: var(--strong); }
.theme-btn .i { width: 16px; height: 16px; }
.side-actions .prefs { display: inline-flex; gap: 6px; align-items: center; }

/* Logo KS Media (login, instalação, erro) */
.side-logo.ks { background: none; padding: 0; }
.auth-logo { display: grid; justify-items: center; gap: 10px; padding: 4px 0 6px; text-align: center; }
.auth-logo img { width: 170px; height: auto; }
.auth-logo.small img { width: 110px; }
.auth-logo span { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--slate); }
.auth-logo .logo-on-light { display: none; }
body.theme-light .auth-logo .logo-on-dark { display: none; }
body.theme-light .auth-logo .logo-on-light { display: block; }
.auth-card > h1 { text-align: center; margin-top: 18px; }
.auth-card > h1 + .muted { text-align: center; }
.auth { background: radial-gradient(600px 380px at 50% 0%, rgba(124, 108, 255, .16), transparent 70%); }
body.theme-light .auth { background: radial-gradient(600px 380px at 50% 0%, rgba(106, 89, 245, .10), transparent 70%); }
.auth-foot .prefs { display: inline-flex; gap: 6px; align-items: center; }
.inline.lang-switch { display: inline-flex; flex-wrap: nowrap; }
.auth-foot > span:first-child { flex: 1; }
.auth-foot .prefs { flex: none; }

/* Tema claro: menus (lateral, barra do topo e barra de baixo no celular) continuam escuros */
body.theme-light .side, body.theme-light .topbar, body.theme-light .tabbar {
  color-scheme: dark;
  --side: #0a0d15; --card: #0f131c; --card-2: #151a26; --card-3: #1b2130;
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
  --ink: #e7eaf2; --strong: #ffffff; --slate: #8b93a7; --mute: #5f677b;
  --pri-soft: rgba(124, 108, 255, .18); --pri-text: #b4abff; --hover: rgba(255, 255, 255, .05);
  --bar-bg: rgba(10, 13, 21, .96);
}
body.theme-light .side { border-right-color: #0a0d15; }

/* SMS */
.sms-sent { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: 12px; font-weight: 600; margin: -2px 0 4px 4px; }
.sms-sent .i { width: 14px; height: 14px; }
.reminder-row { display: flex; justify-content: flex-end; padding: 0 6px 10px; border-bottom: 1px solid var(--line); margin-top: -6px; }
.list .reminder-row:last-child { border-bottom: 0; }
