:root {
  --bg: #f2f5f7;
  --panel: #ffffff;
  --ink: #053D56;
  --muted: #6D6D6D;
  --line: #dfe6ea;
  --brand: #115F82;
  --brand-dark: #053D56;
  --brand-soft: #e7f0f5;
  --brand-accent: #2E86B3;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --green: #15803d;
  --green-soft: #dcfce7;
  --blue: #1d4ed8;
  --blue-soft: #dbeafe;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 8px 24px rgba(15, 23, 42, .05);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Nexa Light", "Nexa", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}
h1, h2, h3, h4, th, strong, .nav-item, .btn, .kpi-card .value {
  font-family: "Nexa Bold", "Nexa", "Segoe UI", Roboto, system-ui, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }

#shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
#sidebar {
  background: #053D56;
  color: #dbe9ef;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 12px;
}
.brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 10px; margin-bottom: 8px; border-radius: 10px;
  background: linear-gradient(135deg, #115F82 0%, #053D56 100%);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: #115F82; color: #ffffff;
  display: grid; place-items: center; font-weight: 800; letter-spacing: -.5px;
}
.brand-logo { display: block; width: 100%; max-width: 180px; height: auto; }
.brand-sub { display: block; font-size: 9px; line-height: 1.3; color: #dbe9ef; letter-spacing: .7px; }
.brand strong { display: block; color: #fff; font-size: 15px; }
.brand span { display: block; font-size: 11px; color: #a8c6d4; }
#nav { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-heading { margin: 4px 12px 2px; color: #8fb3c4; font-size: 10px; line-height: 1.2; text-transform: uppercase; letter-spacing: 1px; }
.nav-item {
  border: 0; background: transparent; color: #c8dce5;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px; text-align: left; width: 100%;
}
.nav-item span { width: 20px; text-align: center; font-size: 15px; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
  background: #115F82; color: #ffffff; font-weight: 700;
  box-shadow: inset 3px 0 rgba(255, 255, 255, .75);
}
.nav-item.active span { opacity: 1; }
.nav-area {
  border: 0; background: transparent; color: #8fb3c4;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px; width: 100%;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
}
.nav-area:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-area i { font-style: normal; font-size: 11px; opacity: .8; }
.nav-items { display: none; flex-direction: column; gap: 2px; padding-left: 4px; }
.nav-group.open .nav-items { display: flex; }
.sidebar-footer { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-footer small { color: #8fb3c4; font-size: 10px; }
.connection { font-size: 12px; display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.connection i { width: 8px; height: 8px; border-radius: 50%; background: #34d399; display: inline-block; }
.connection.offline i { background: #fbbf24; }

/* ---------- Topbar / layout ---------- */
#main { min-width: 0; display: flex; flex-direction: column; }
#topbar {
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 16px 26px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
#topbar h1 { margin: 0; font-size: 20px; letter-spacing: -.3px; }
#topbar p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.today-label { color: var(--muted); font-size: 12px; margin-right: 4px; }
.top-logo { height: 30px; width: auto; display: block; margin-right: 6px; }
#banner { padding: 0 26px; }
#banner:not(:empty) { padding-top: 14px; }
#view { padding: 22px 26px 60px; flex: 1; outline: none; }

/* ---------- Generic components ---------- */
.btn {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px; transition: .15s;
}
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--red); border-color: #fecaca; background: #fff; }
.btn.small { padding: 4px 8px; font-size: 11px; border-radius: 6px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; margin: 0 0 10px; }

.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.projects { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; background: #fafafa; }

.badge {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; background: #f1f5f9; color: #475569; white-space: nowrap;
}
.badge.teal { background: var(--brand-soft); color: var(--brand-dark); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gray { background: #f1f5f9; color: #64748b; }

.kpi-card { padding: 16px 18px; }
.kpi-card .label { color: var(--muted); font-size: 12px; }
.kpi-card .value { font-size: 26px; font-weight: 800; letter-spacing: -1px; margin-top: 4px; }
.kpi-card .hint { font-size: 11px; color: var(--muted); margin-top: 2px; }

.progress { height: 7px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.progress.thin { height: 5px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; background: #fafafa; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfc; }
td .title-cell { font-weight: 600; }
td .sub-cell { font-size: 11px; color: var(--muted); }

/* ---------- Forms / filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
input[type="text"], input[type="date"], input[type="number"], input[type="url"], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #99f6e4; border-color: var(--brand); }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.field { margin-bottom: 12px; }
.field.inline { display: flex; gap: 8px; align-items: center; }
.field.inline label { margin: 0; white-space: nowrap; }
.check-inline { display: flex; align-items: center; gap: 7px; }
.check-inline input { width: auto; }
.filters input[type="text"] { max-width: 260px; }
.filters select { width: auto; min-width: 140px; }

/* ---------- Checklist ---------- */
.checklist { background: #f8faf9; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 12px; }
.checklist .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.checklist .head strong { font-size: 12px; }
.check-item { display: flex; gap: 8px; align-items: flex-start; padding: 6px 2px; border-bottom: 1px dashed var(--line); }
.check-item:last-child { border-bottom: 0; }
.check-item input[type="checkbox"] { width: auto; margin-top: 2px; }
.check-item .body { flex: 1; min-width: 0; }
.check-item .text { word-break: break-word; }
.check-item.done .text { text-decoration: line-through; color: var(--muted); }
.check-item .meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.check-add { display: flex; gap: 6px; margin-top: 8px; }
.check-add input { flex: 1; padding: 6px 8px; font-size: 12px; }
.check-add input[type="date"] { max-width: 145px; }

/* ---------- Project cards ---------- */
.project-card { display: flex; flex-direction: column; gap: 10px; }
.project-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.project-card h3 { margin: 0; font-size: 15px; }
.project-card .code { font-size: 11px; color: var(--muted); font-weight: 700; }
.project-card .meta-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.project-card .progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.project-card .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; }
.kanban-col { background: #eef2f4; border-radius: 12px; padding: 10px; min-height: 260px; }
.kanban-col h3 { font-size: 12px; margin: 2px 4px 10px; display: flex; justify-content: space-between; }
.kanban-col.dragover { outline: 2px dashed var(--brand); }
.kanban-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.04); cursor: grab; }
.kanban-card .t { font-weight: 600; font-size: 13px; }
.kanban-card .m { color: var(--muted); font-size: 11px; margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; }
.kanban-card .check-mini { margin-top: 6px; font-size: 10px; color: var(--brand); }
.projects-kanban { grid-template-columns: repeat(6, minmax(220px, 1fr)); }
.projects-kanban .code { font-size: 11px; color: var(--muted); font-weight: 700; }

/* ---------- Calendar ---------- */
.calendar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.cal-dow { background: #f8fafc; font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 8px; border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 104px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.outside { background: #fafafa; color: #b6bec9; }
.cal-cell.today { background: #fffbeb; }
.cal-day { font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.cal-chip { display: block; width: 100%; text-align: left; border: 0; border-radius: 5px; padding: 3px 5px; font-size: 10px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.task { background: var(--blue-soft); color: var(--blue); }
.cal-chip.project { background: var(--brand-soft); color: var(--brand-dark); }
.cal-chip.check { background: var(--amber-soft); color: var(--amber); }
.cal-chip.phase { background: var(--green-soft); color: var(--green); }
.cal-chip.done { opacity: .55; text-decoration: line-through; }
.cal-more { font-size: 10px; color: var(--muted); }

/* ---------- Gantt ---------- */
.gantt-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.gantt { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.gantt-row { display: flex; min-width: 900px; border-bottom: 1px solid var(--line); }
.gantt-row:last-child { border-bottom: 0; }
.gantt-label { width: 240px; min-width: 240px; padding: 8px 10px; border-right: 1px solid var(--line); font-size: 12px; background: #fff; position: sticky; left: 0; z-index: 2; }
.gantt-label small { display: block; color: var(--muted); font-size: 10px; }
.gantt-track { flex: 1; position: relative; height: 40px; background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / 12 - 1px), #eef1f4 calc(100% / 12 - 1px), #eef1f4 calc(100% / 12)); }
.gantt-bar { position: absolute; top: 9px; height: 22px; border-radius: 5px; background: var(--brand); color: #fff; font-size: 10px; padding: 4px 6px; white-space: nowrap; overflow: hidden; }
.gantt-bar.project { background: var(--blue); }
.gantt-bar.phase { background: #0f766e; height: 16px; top: 12px; }
.gantt-bar.overdue { background: var(--red); }
.gantt-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.35); }
.gantt-bar span { position: relative; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #f59e0b; z-index: 3; }
.gantt-legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 8px; }

/* ---------- Modal / toast ---------- */
#modal-root { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 100; padding: 20px; }
#modal-root[hidden] { display: none; }
.modal { background: #fff; border-radius: 14px; width: min(620px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,.22); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
#toast { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #0f2e2b; color: #fff; padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow); font-size: 13px; animation: slide .2s ease; }
.toast.error { background: var(--red); }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.banner {
  border: 1px solid #fcd34d; background: #fffbeb; color: #92400e;
  border-radius: 10px; padding: 10px 14px; font-size: 12px;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}

/* ---------- Propostas JHP-01 ---------- */
.service-picker { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 14px; background: #f8faf9; }
.service-picker .title { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.service-picker .svc-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.service-picker .svc-row:last-child { border-bottom: 0; }
.service-picker label { margin: 0; font-weight: 500; display: flex; gap: 8px; align-items: center; }
.service-picker input { width: auto; }
.service-picker .svc-price { font-size: 11px; color: var(--muted); white-space: nowrap; }
.service-picker .svc-row.disabled { opacity: .45; }
.proposal-preview { border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 8px; padding: 12px 14px; margin-top: 12px; }
.proposal-preview .total { font-size: 20px; font-weight: 800; color: var(--brand-dark); }
.proposal-preview .warn { color: var(--amber); font-size: 11px; margin-top: 6px; }
.proposal-preview .ms { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* Identidade visual das propostas (padrão de referência 04-12-2026): Montserrat nos títulos, Open Sans no texto. */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(assets/fonts/montserrat-var-latin.woff2) format('woff2'); }
@font-face { font-family: 'Open Sans'; font-style: normal; font-weight: 300 800; font-display: swap; src: url(assets/fonts/opensans-var-latin.woff2) format('woff2'); }
@font-face { font-family: 'Open Sans'; font-style: italic; font-weight: 300 800; font-display: swap; src: url(assets/fonts/opensans-italic-var-latin.woff2) format('woff2'); }
.proposal-doc { --doc-navy: #053D56; --doc-blue: #115F82; --doc-gray: #6D6D6D; --doc-text: #2b2f33; --doc-line: #dde3e8; --doc-zebra: #f3f6f8;
  font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif; font-size: 10.5pt; line-height: 1.6; color: var(--doc-text); background: #fff; padding: 0; counter-reset: doc-sec; }
.proposal-doc strong { color: var(--doc-navy); font-weight: 700; font-family: inherit; }
.proposal-doc .doc-table th { font-family: inherit; }
/* Folha timbrada dez/2026 em HTML: logo à esquerda, linha com destaque azul à direita, rodapé em uma linha. */
.proposal-doc .doc-letterhead-top { padding: 24px 32px 0; }
.proposal-doc .doc-lh-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 12px; }
.proposal-doc .doc-lh-logo { display: block; width: 190px; height: auto; }
.proposal-doc .doc-lh-id { text-align: right; line-height: 1.4; }
.proposal-doc .doc-lh-kicker { font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 7.5pt; letter-spacing: 2.2px; color: var(--doc-gray); font-weight: 600; }
.proposal-doc .doc-lh-number { font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 10.5pt; font-weight: 700; color: var(--doc-navy); }
.proposal-doc .doc-lh-client { font-size: 8pt; color: var(--doc-gray); }
.proposal-doc .doc-lh-rule { position: relative; height: 4px; }
.proposal-doc .doc-lh-rule::before { content: ''; position: absolute; left: 0; right: 0; top: 1px; height: 2px; background: var(--doc-navy); }
.proposal-doc .doc-lh-rule span { position: absolute; right: 0; top: 0; width: 14%; height: 4px; background: var(--doc-blue); }
.proposal-doc .doc-letterhead-foot { margin: 0 32px; padding: 8px 0 18px; border-top: 1px solid var(--doc-line); font-size: 7.5pt; line-height: 1.5; color: var(--doc-gray); }
.proposal-doc .doc-letterhead-foot strong { font-weight: 600; }
.proposal-doc .doc-frame, .proposal-doc .doc-frame > * > tr > td { min-width: 0; border: 0; padding: 0; background: transparent; }
.proposal-doc .doc-frame { width: 100%; border-collapse: collapse; }
.proposal-doc .doc-frame td.doc-content { padding: 22px 32px 10px; }
.proposal-doc .doc-title { margin: 0 0 22px; color: var(--doc-gray); font-size: 9.5pt; }
.proposal-doc .doc-title h2 { margin: 0 0 6px; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 19pt; font-weight: 700; line-height: 1.25; color: var(--doc-navy); }
.proposal-doc .doc-section { margin: 0 0 20px; }
.proposal-doc .doc-section h3 { margin: 0 0 8px; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 15pt; font-weight: 700; line-height: 1.3; color: var(--doc-navy); }
.proposal-doc .doc-section h3::before { counter-increment: doc-sec; content: counter(doc-sec) ". "; }
.proposal-doc .doc-section h4 { margin: 12px 0 2px; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 10.5pt; font-weight: 600; color: var(--doc-blue); }
.proposal-doc p { margin: 0 0 9px; }
.proposal-doc .doc-table { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0; border: 1px solid var(--doc-line); border-radius: 5px; overflow: hidden; font-size: 10pt; margin: 10px 0; }
.proposal-doc .doc-table th, .proposal-doc .doc-table td { border: 0; border-bottom: 1px solid var(--doc-line); padding: 8px 12px; text-align: left; vertical-align: top; text-transform: none; letter-spacing: 0; }
.proposal-doc .doc-table th { background: var(--doc-navy); color: #fff; font-weight: 700; font-size: 10pt; }
.proposal-doc .doc-table tbody tr:nth-child(even) td { background: var(--doc-zebra); }
.proposal-doc .doc-table tr:last-child td { border-bottom: 0; }
.proposal-doc .doc-table .num, .proposal-doc .doc-table tbody td:first-child { text-align: right; white-space: nowrap; }
.proposal-doc .doc-table tbody td:first-child { text-align: left; }
.proposal-doc .doc-table .doc-total td { font-weight: 700; color: var(--doc-navy); background: #fff; border-top: 1px solid var(--doc-line); }
.proposal-doc .doc-note { font-size: 9pt; color: var(--doc-gray); }
.proposal-doc .doc-clauses { margin: 5px 0; padding-left: 20px; }
.proposal-doc .doc-clauses li { margin-bottom: 5px; }
.doc-modal { width: min(860px, 100%); }
.doc-modal .modal-body { padding: 0; }

/* Impressão: topo e rodapé do timbrado fixos, repetidos em todas as folhas.
   As linhas de cabeçalho/rodapé da tabela reservam o espaço deles em cada página. */
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: transparent; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #shell, #toast, #banner, .modal-head, .modal-foot, .no-print { display: none !important; }
  #modal-root { position: static; display: block; background: transparent; padding: 0; }
  .modal, .doc-modal { width: 100%; max-height: none; overflow: visible; box-shadow: none; border-radius: 0; background: transparent; }
  .modal-body { padding: 0; background: transparent; }
  .proposal-doc { background: transparent; }
  .proposal-doc .doc-frame { position: relative; z-index: 1; }
  .proposal-doc .doc-letterhead-top { position: fixed; top: 0; left: 0; width: 210mm; box-sizing: border-box; padding: 10mm 17mm 0; z-index: 2; background: #fff; }
  .proposal-doc .doc-lh-logo { width: 45mm; }
  .proposal-doc .doc-letterhead-foot { display: none; }
  .proposal-doc .doc-space-top { height: 38mm; }
  .proposal-doc .doc-space-bottom { height: 6mm; }
  .proposal-doc .doc-frame td.doc-content { padding: 0 17mm; }
  .proposal-doc .doc-section { break-inside: avoid; }
  .proposal-doc .doc-table tr { break-inside: avoid; }
}

@media (max-width: 900px) {
  #shell { grid-template-columns: 1fr; }
  #sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .brand { width: 100%; padding-bottom: 8px; }
  #nav { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 8px 14px; overflow: visible; }
  .nav-group { min-width: 160px; }
  .nav-heading { margin-left: 10px; }
  .nav-item { width: auto; }
  .sidebar-footer { width: 100%; margin-top: 4px; }
  #topbar { flex-direction: column; align-items: flex-start; }
  #view { padding: 16px; }
  .kanban { grid-template-columns: repeat(4, 260px); }
  .projects-kanban { grid-template-columns: repeat(6, 240px); }
}

/* ---------- CRM ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.tab {
  border: 0; background: transparent; color: var(--muted); font-weight: 600;
  padding: 9px 14px; border-bottom: 3px solid transparent;
}
.tab:hover { color: var(--brand-dark); }
.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.crm-board { display: grid; grid-template-columns: repeat(8, minmax(210px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.crm-col { background: #eef2f4; border-radius: 12px; padding: 9px; min-height: 220px; }
.crm-col h3 { display: flex; justify-content: space-between; align-items: center; margin: 2px 2px 10px; font-size: 12px; }
.crm-col.dragover { outline: 2px dashed var(--brand); }
.crm-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.04); cursor: grab; }
.crm-card .t { font-weight: 700; font-size: 13px; }
.crm-card .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.crm-card .badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.crm-card .m { font-size: 11px; color: var(--muted); margin-top: 6px; }
.crm-card .actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.masked { color: var(--muted); letter-spacing: 1px; }
.crm-clients { display: grid; gap: 14px; margin-top: 14px; }
.crm-client-card .card-head h3 { margin: 0; font-size: 15px; }
.crm-client-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 16px; margin-bottom: 12px; }
.crm-timeline { border-top: 1px solid var(--line); padding-top: 8px; }
.crm-timeline-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; font-size: 12px; }
.crm-timeline-item .btn { margin-left: auto; }

/* ---------- RH / organograma ---------- */
.org-tree { display: flex; gap: 20px; overflow-x: auto; padding: 10px 2px 16px; align-items: flex-start; }
.org-node { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 160px; }
.org-card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; min-width: 160px; text-align: center;
}
.org-children { display: flex; gap: 14px; align-items: flex-start; border-top: 1px dashed var(--line); padding-top: 12px; }

@media (max-width: 900px) {
  .crm-board { grid-template-columns: repeat(8, 240px); }
}
