/* LCM.online — identidade própria: tinta profunda + verde-petróleo + madeira (marcenaria). */
:root {
  --ink: #13201d; --ink-2: #33433f; --muted: #5f6f6b; --line: #dfe6e3; --line-2: #eef2f0;
  --bg: #f4f6f5; --panel: #ffffff; --panel-2: #f8faf9;
  --brand: #0f6b5f; --brand-ink: #ffffff; --brand-soft: #e3f2ef; --brand-2: #0b5248;
  --wood: #b5762b; --wood-soft: #f8eedf;
  --ok: #157f3b; --ok-soft: #e4f4e9; --warn: #9a6200; --warn-soft: #fdf3dc; --bad: #b42318; --bad-soft: #fde8e6; --info: #1d5fae; --info-soft: #e5eefb;
  --side: #10201c; --side-ink: #d6e2de; --side-muted: #8fa39d; --side-active: #1d3a33;
  --radius: 10px; --radius-sm: 7px; --shadow: 0 1px 2px rgb(16 32 28 / .06), 0 4px 14px rgb(16 32 28 / .05);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e6eeeb; --ink-2: #c3d0cc; --muted: #93a6a0; --line: #2a3a36; --line-2: #22312d;
    --bg: #0d1513; --panel: #131e1b; --panel-2: #172521;
    --brand: #39b39f; --brand-ink: #06231e; --brand-soft: #143a33; --brand-2: #5fd0bc;
    --wood: #e0a45a; --wood-soft: #3a2a14;
    --ok: #4cc17a; --ok-soft: #12321f; --warn: #e5b44f; --warn-soft: #362a10; --bad: #ff8a7a; --bad-soft: #3b1714; --info: #7fb2f0; --info-soft: #132a45;
    --side: #0a110f; --side-active: #16302a; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-2); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 1.45rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: .98rem; }
p { margin: 0 0 .7rem; }
small, .muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .88em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; vertical-align: -3px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Estrutura */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-ink); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; color: #fff; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--wood), #d79a4f); color: #1b1206; font-weight: 800; font-size: .8rem; letter-spacing: .02em; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; color: #fff; }
.brand-name span { color: #8fd3c5; font-weight: 600; }
.nav-group { margin: 10px 0 4px; padding: 0 10px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink); text-decoration: none; font-size: .93rem; }
.nav a:hover { background: rgb(255 255 255 / .05); color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--wood); }
.nav .count { margin-left: auto; background: var(--wood); color: #1b1206; border-radius: 999px; font-size: .72rem; padding: 0 7px; font-weight: 700; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .title { font-weight: 650; font-size: 1rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.content { padding: 22px 24px 48px; max-width: 1360px; width: 100%; }
.demo-banner { background: repeating-linear-gradient(45deg, var(--warn-soft), var(--warn-soft) 12px, #fbe7b9 12px, #fbe7b9 24px); color: #5c3b00; text-align: center; font-weight: 700; padding: 6px; font-size: .85rem; }

/* Componentes */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head p { margin: 0; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; min-width: 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.stat .label { color: var(--muted); font-size: .8rem; display: flex; gap: 6px; align-items: center; }
.stat .value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: .9rem; font-weight: 500; }
.stat .sub { font-size: .82rem; color: var(--muted); }
meter, progress { width: 100%; height: 10px; }
progress { appearance: none; border: 0; border-radius: 999px; background: var(--line-2); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line-2); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--brand); border-radius: 999px; }
progress.wood::-webkit-progress-value { background: var(--wood); }
progress.wood::-moz-progress-bar { background: var(--wood); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand-2); }
.badge.wood { background: var(--wood-soft); color: #7a4a10; }
.badge.stage { color: #fff; }
.score { display: inline-grid; place-items: center; min-width: 34px; height: 24px; border-radius: 6px; font-weight: 700; font-size: .8rem; background: var(--line-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.score.hi { background: var(--wood-soft); color: #7a4a10; }
.score.md { background: var(--brand-soft); color: var(--brand-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-2); color: var(--brand-ink); }
.btn.wood { background: var(--wood); border-color: var(--wood); color: #1b1206; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: .82rem; }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-btn { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }

form.stack { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span, label.lbl { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=url], input[type=file], select, textarea {
  width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); font: inherit; font-size: .92rem;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 1px; border-color: var(--brand); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.filters .field { min-width: 140px; flex: 1 1 140px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 0; }
legend { font-weight: 650; font-size: .88rem; padding: 0 6px; }
details.box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 12px; }
details.box > summary { cursor: pointer; padding: 11px 14px; font-weight: 650; list-style: none; display: flex; gap: 8px; align-items: center; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-family: var(--mono); }
details.box[open] > summary::after { content: "−"; }
details.box > .body { padding: 0 14px 14px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--panel-2); font-weight: 650; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-dnc td { opacity: .7; }
.pagination { display: flex; gap: 6px; align-items: center; justify-content: space-between; margin-top: 10px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }

.alert { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; border: 1px solid transparent; display: flex; gap: 10px; align-items: flex-start; }
.alert.success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert.error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert.warning { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert p:last-child { margin: 0; }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); }
.coach { background: linear-gradient(135deg, var(--brand-soft), var(--wood-soft)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; }
.achievements { display: flex; flex-wrap: wrap; gap: 8px; }
.ach { display: flex; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 6px; font-size: .84rem; }
.ach .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--wood-soft); color: #7a4a10; }

/* Linha do tempo */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .tdot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin-top: 6px; }
.timeline .tdot.goal { background: var(--ok); }
.timeline .tdot.contact { background: var(--brand); }
.timeline .tdot.sale { background: var(--wood); }
.timeline .meta { font-size: .78rem; color: var(--muted); }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 6px 12px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.actions-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.factor { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: .88rem; }
.factor:last-child { border-bottom: 0; }
.factor .pts { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.factor.off { color: var(--muted); }

/* Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kcol { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 210px); min-height: 160px; }
.kcol-head { padding: 10px 12px; display: flex; gap: 8px; align-items: center; font-weight: 650; font-size: .88rem; border-bottom: 1px solid var(--line); }
.kcol-head .swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--muted); }
.kcol-head .n { margin-left: auto; color: var(--muted); font-weight: 500; }
.kcol-body { padding: 8px; display: grid; gap: 8px; overflow-y: auto; align-content: start; flex: 1; }
.kcol.drop-target { outline: 2px dashed var(--brand); outline-offset: -4px; background: var(--brand-soft); }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; box-shadow: var(--shadow); cursor: grab; }
.kcard.dragging { opacity: .5; }
.kcard a { color: var(--ink); font-weight: 600; text-decoration: none; }
.kcard .meta { font-size: .78rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.kcard form { margin-top: 6px; display: flex; gap: 4px; }
.kcard select { min-height: 28px; padding: 2px 6px; font-size: .78rem; }

/* Toast */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--panel); padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 24px rgb(0 0 0 / .2); font-size: .9rem; }
.toast.error { background: var(--bad); color: #fff; }

/* Telas de acesso */
.guest { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, var(--brand-soft), transparent), radial-gradient(900px 500px at 110% 110%, var(--wood-soft), transparent), var(--bg); }
.guest-card { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 28px; }
.guest-card.wide { max-width: 760px; }
.guest-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.guest-brand .brand-name { color: var(--ink); }
.guest-brand .brand-name span { color: var(--brand); }
.steps { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.steps span { font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: var(--line-2); color: var(--muted); }
.steps span.on { background: var(--brand); color: var(--brand-ink); }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; font-size: .88rem; }
.checklist li { display: flex; gap: 8px; }
.checklist .ok { color: var(--ok); }
.checklist .no { color: var(--bad); }
.checklist .opt { color: var(--warn); }
.secret { font-family: var(--mono); background: var(--panel-2); border: 1px dashed var(--wood); border-radius: 8px; padding: 10px; overflow-wrap: anywhere; user-select: all; }

/* Calendário de metas */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: .72rem; color: var(--muted); text-align: center; text-transform: uppercase; }
.cal .day { border: 1px solid var(--line); border-radius: 8px; padding: 6px; min-height: 64px; font-size: .78rem; background: var(--panel); }
.cal .day .d { font-weight: 700; }
.cal .day.met { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: var(--ok-soft); }
.cal .day.fail { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: var(--bad-soft); }
.cal .day.off { background: var(--panel-2); color: var(--muted); }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--wood); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; border-bottom: 1px solid var(--line); padding-top: 8px; }
.bars .bar { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 1px; position: relative; }
.bars .bar.we { background: var(--wood); }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgb(0 0 0 / .3); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 16px 16px 40px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .user-chip .name { display: none; }
  .kanban { grid-auto-columns: minmax(80vw, 1fr); }
  .cal { gap: 3px; }
  .cal .day { min-height: 48px; padding: 3px; font-size: .7rem; }
  .cal .day .x { display: none; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .guest-card { padding: 20px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { margin-top: 6px; }
}
.backdrop { display: none; }
@media (max-width: 860px) { .backdrop.show { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 40; } }
@media print { .sidebar, .topbar, .btn, form { display: none !important; } .app { display: block; } }

/* Utilitários (sem estilos inline: CSP estrita) */
.mt { margin-top: 14px; } .mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .narrow { max-width: 560px; } .nowrap { white-space: nowrap; } .right { text-align: right; } .grow { flex: 1; } .hidden { display: none; } .small { font-size: .82rem; } .strong { font-weight: 650; } .inline { display: inline; } .gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .w-sm { max-width: 140px; } .pre { white-space: pre-wrap; }
