/* =====================================================================
   CN&IJ Gestão — identidade visual
   Minimalista, sofisticada, muito espaço em branco.
   ===================================================================== */
/* Fontes hospedadas no próprio sistema (funcionam sem depender do Google Fonts) */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 300; font-display: swap; src: url('/fonts/jost-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/jost-latin-400-normal.woff2') format('woff2'); }
:root {
  --ink: #111111;
  --ink-2: #3a3a3a;
  --muted: #7a7a7a;
  --muted-2: #a3a3a3;
  --line: #ececec;
  --line-2: #f3f3f3;
  --bg: #ffffff;
  --surface: #fafaf9;
  --surface-2: #f5f4f2;
  --accent: #8a7560;          /* bronze discreto — detalhes */
  --success: #3f7a5c; --success-bg: #eef5f0;
  --warning: #a97a26; --warning-bg: #fbf4e6;
  --danger:  #b0473b; --danger-bg:  #fbeeec;
  --info:    #4d6a86; --info-bg:    #eef3f8;
  --accentc: #7a6150; --accent-bg:  #f5f0eb;
  --neutral: #5b5b5b; --neutral-bg: #f2f2f2;
  --radius: 14px; --radius-sm: 10px;
  --sidebar: 252px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --shadow: 0 1px 2px rgba(17,17,17,.04), 0 8px 24px rgba(17,17,17,.06);
  --shadow-lg: 0 24px 64px rgba(17,17,17,.14);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.01em; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); } .muted-2 { color: var(--muted-2); }
.small { font-size: 12px; } .tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.danger-text { color: var(--danger); } .success-text { color: var(--success); } .warning-text { color: var(--warning); }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.sm { width: 15px; height: 15px; } .icon.lg { width: 22px; height: 22px; }

/* ---------------- Layout ---------------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: #fff; z-index: 20; }
.brand { display: flex; align-items: center; justify-content: center; padding: 26px 20px 22px; background: #fff; }
.brand-logo { display: block; width: 100%; max-width: 208px; height: auto; object-fit: contain; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-size: 13.5px; position: relative; transition: background .15s; }
.nav a .icon { color: var(--muted); }
.nav a:hover { background: var(--surface); }
.nav a.active { background: var(--surface-2); color: var(--ink); font-weight: 500; }
.nav a.active .icon { color: var(--ink); }
.nav a .count { margin-left: auto; font-size: 11px; background: var(--ink); color: #fff; border-radius: 20px; padding: 0 7px; line-height: 18px; }
.nav a .count.soft { background: var(--danger-bg); color: var(--danger); }
.nav .sep { height: 1px; background: var(--line); margin: 10px 12px; }
.side-user { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.side-user .who { min-width: 0; flex: 1; } .side-user .who b { font-weight: 500; display: block; font-size: 13px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 15; height: 68px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 32px; }
.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 0 14px 0 40px; outline: none; transition: border .15s, background .15s; }
.search input:focus { background: #fff; border-color: #d6d6d6; }
.search > .icon { position: absolute; left: 13px; top: 11px; color: var(--muted); }
.search kbd { position: absolute; right: 10px; top: 10px; font: 11px var(--font); color: var(--muted-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: #fff; }
.search-results { position: absolute; top: 46px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: 70vh; overflow: auto; padding: 6px; }
.search-results a { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 10px; }
.search-results a:hover, .search-results a.sel { background: var(--surface); }
.search-results .type { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); width: 84px; flex: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid transparent; background: transparent; display: inline-grid; place-items: center; position: relative; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface); }
.icon-btn .dot { position: absolute; top: 3px; right: 1px; min-width: 10px; height: 16px; padding: 0 3px; text-align: center; border-radius: 10px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; font-weight: 600; border: 2px solid #fff; box-sizing: content-box; }
.content { padding: 32px 40px 80px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--serif); font-size: 36px; font-weight: 500; line-height: 1.1; letter-spacing: -.005em; }
.page-head .sub { color: var(--muted); margin-top: 6px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.crumbs a:hover { color: var(--ink); }

/* ---------------- Buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; font-weight: 500; font-size: 13px; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: var(--surface); border-color: #dedede; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2b2b2b; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; gap: 5px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-group { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; gap: 2px; background: #fff; }
.btn-group button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 7px; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.btn-group button.on { background: var(--surface-2); color: var(--ink); font-weight: 500; }
.fab { width: 40px; height: 40px; border-radius: 12px; background: var(--ink); color: #fff; border: 0; display: inline-grid; place-items: center; }
.fab:hover { background: #2b2b2b; }

/* ---------------- Cards / KPIs ---------------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; min-width: 0; }
.card.flat { background: var(--surface); border-color: transparent; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-head h3 { font-size: 14px; font-weight: 500; }
.card-head .link { font-size: 12px; color: var(--muted); } .card-head .link:hover { color: var(--ink); }
.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)); } .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; }
.kpi { padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; cursor: default; transition: border-color .15s; }
a.kpi, .kpi[data-link] { cursor: pointer; } a.kpi:hover { border-color: #d9d9d9; }
.kpi .label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-family: var(--serif); font-size: clamp(22px, 1.9vw, 30px); white-space: nowrap; font-weight: 500; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: lining-nums tabular-nums; }
.kpi .value.sm { font-size: clamp(19px, 1.5vw, 24px); }
.kpi .foot { font-size: 12px; color: var(--muted); }
.kpi.alert .value { color: var(--danger); }
.kpi .dotc { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.section-title { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 36px 0 14px; font-weight: 500; display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ''; height: 1px; background: var(--line); flex: 1; }

/* ---------------- Badges ---------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 20px; font-size: 11.5px; font-weight: 500; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral); }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.accent { background: var(--accent-bg); color: var(--accentc); }
.badge.muted { background: #f4f4f4; color: var(--muted-2); }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.prio i { width: 8px; height: 8px; border-radius: 2px; background: #cfcfcf; display: inline-block; }
.prio.alta i { background: var(--warning); } .prio.urgente i { background: var(--danger); } .prio.baixa i { background: #e2e2e2; }
.prio.urgente { color: var(--danger); font-weight: 500; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; background: var(--ink); flex: none; letter-spacing: .02em; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; } .avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatars { display: inline-flex; } .avatars .avatar { border: 2px solid #fff; margin-left: -6px; } .avatars .avatar:first-child { margin-left: 0; }

/* ---------------- Progress ---------------- */
.progress { height: 6px; background: var(--line-2); border-radius: 10px; overflow: hidden; min-width: 60px; }
.progress > span { display: block; height: 100%; background: var(--ink); border-radius: 10px; transition: width .4s; }
.progress.thin { height: 4px; }
.progress.success > span { background: var(--success); } .progress.danger > span { background: var(--danger); } .progress.warning > span { background: var(--warning); }
.pcell { display: flex; align-items: center; gap: 10px; min-width: 110px; } .pcell .progress { flex: 1; } .pcell span.n { font-size: 12px; color: var(--muted); width: 34px; text-align: right; }
.phase-track { display: flex; gap: 4px; margin: 6px 0 4px; }
.phase-track i { flex: 1; height: 6px; border-radius: 3px; background: var(--line-2); position: relative; }
.phase-track i.done { background: var(--ink); } .phase-track i.doing { background: repeating-linear-gradient(45deg, #111 0 3px, #555 3px 6px); }
.phase-track i.wait { background: var(--warning); }
.phase-labels { display: flex; gap: 4px; } .phase-labels span { flex: 1; font-size: 10px; color: var(--muted-2); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phase-labels span.cur { color: var(--ink); font-weight: 500; }

/* ---------------- Tabelas ---------------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: #fff; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fff; position: sticky; top: 0; z-index: 1; user-select: none; }
table.t th.sortable { cursor: pointer; } table.t th.sortable:hover { color: var(--ink); }
table.t th .arr { opacity: .6; margin-left: 4px; }
table.t td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background .1s; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr:hover { background: #fcfcfb; }
table.t td.nw { white-space: nowrap; }
table.t td.actions { width: 1%; white-space: nowrap; text-align: right; }
table.t tr.muted-row td { color: var(--muted-2); }
table.t tfoot td { font-weight: 600; border-top: 1px solid var(--line); background: var(--surface); }
table.t.compact td { padding: 9px 12px; } table.t.compact th { padding: 9px 12px; }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 4px; color: var(--muted); font-size: 12px; }
.cell-title { font-weight: 500; } .cell-sub { font-size: 12px; color: var(--muted); }
.late { color: var(--danger); }

/* ---------------- Toolbar / filtros ---------------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search-sm { position: relative; min-width: 220px; flex: 1; max-width: 340px; }
.toolbar .search-sm input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 12px 0 36px; outline: none; background: #fff; }
.toolbar .search-sm input:focus { border-color: #cfcfcf; }
.toolbar .search-sm .icon { position: absolute; left: 11px; top: 10px; color: var(--muted); width: 17px; height: 17px; }
.toolbar select, .toolbar input[type=date], .toolbar input[type=month] { height: 38px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 32px 0 12px; background: #fff; outline: none; font-size: 13px; }
.toolbar input[type=date], .toolbar input[type=month] { padding-right: 10px; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { padding: 10px 0 12px; border: 0; background: none; color: var(--muted); font-size: 13.5px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs a.on, .tabs button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.tabs .n { font-size: 11px; background: var(--surface-2); border-radius: 10px; padding: 0 6px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 13px; border-radius: 20px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: #d6d6d6; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .n { font-size: 11px; opacity: .7; }

/* ---------------- Formulários ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label, .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field > label .req { color: var(--danger); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .field textarea {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 12px; background: #fff; outline: none; transition: border .15s, box-shadow .15s; font-size: 14px; }
.field textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: #bdbdbd; box-shadow: 0 0 0 3px rgba(17,17,17,.05); }
.field .hint { font-size: 11.5px; color: var(--muted-2); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px !important; }
.money-input { position: relative; } .money-input span { position: absolute; left: 12px; top: 11px; color: var(--muted); font-size: 13px; } .money-input input { padding-left: 36px !important; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13.5px; height: 40px; }
.toggle input { display: none; }
.toggle .sw { width: 36px; height: 20px; border-radius: 20px; background: #dcdcdc; position: relative; transition: background .2s; flex: none; }
.toggle .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + .sw { background: var(--ink); } .toggle input:checked + .sw::after { transform: translateX(16px); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 20px; font-size: 12.5px; cursor: pointer; user-select: none; }
.checks label:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); }
.checks input { display: none; }
.combo { position: relative; }
.combo-btn { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; text-align: left; padding: 0 32px 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.combo-btn.empty { color: var(--muted-2); }
.combo-pop { position: absolute; top: 44px; left: 0; right: 0; z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 300px; display: flex; flex-direction: column; }
.combo-pop input { height: 36px !important; margin-bottom: 4px; }
.combo-pop .opts { overflow: auto; }
.combo-pop .opt { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.combo-pop .opt:hover, .combo-pop .opt.sel { background: var(--surface); }
.combo-pop .opt small { color: var(--muted); margin-left: 6px; }
.stars { display: inline-flex; gap: 2px; } .stars button { border: 0; background: none; padding: 2px; color: #d9d9d9; font-size: 20px; line-height: 1; }
.stars button.on { color: var(--accent); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; }
.form-section { grid-column: 1 / -1; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
input[type=range] { accent-color: #111; width: 100%; }

/* ---------------- Drawer / modal ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(17,17,17,.28); z-index: 100; opacity: 0; transition: opacity .2s; }
.overlay.show { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: #fff; z-index: 101; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(24px); opacity: 0; transition: transform .22s ease, opacity .22s ease; }
.drawer.wide { width: min(880px, 100vw); }
.drawer.show { transform: none; opacity: 1; }
.drawer-head { padding: 22px 28px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h2 { font-family: var(--serif); font-size: 26px; line-height: 1.15; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px 28px 40px; }
.drawer-foot { padding: 14px 28px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: #fff; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -48%); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: #fff; z-index: 102; border-radius: 18px; box-shadow: var(--shadow-lg); opacity: 0; transition: transform .2s, opacity .2s; }
.modal.show { opacity: 1; transform: translate(-50%, -50%); }
.modal .m-head { padding: 22px 24px 4px; } .modal .m-head h3 { font-family: var(--serif); font-size: 24px; }
.modal .m-body { padding: 14px 24px 8px; } .modal .m-foot { padding: 14px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; }
.menu { position: fixed; z-index: 120; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; border-radius: 8px; font-size: 13.5px; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--surface); }
.menu .danger { color: var(--danger); }
.menu hr { border: 0; height: 1px; background: var(--line); margin: 4px 0; }
.menu .mh { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 4px; }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; pointer-events: auto; display: flex; gap: 12px; align-items: center; }
.toast.error { background: var(--danger); }
.toast button { background: none; border: 0; color: #fff; text-decoration: underline; padding: 0; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

/* ---------------- Listas / itens ---------------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover .li-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #ccc; }
.li-title { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-date { width: 46px; flex: none; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 5px 0 4px; line-height: 1.05; }
.li-date b { display: block; font-family: var(--serif); font-size: 20px; font-weight: 500; } .li-date span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sev { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted-2); }
.sev.danger { background: var(--danger); } .sev.warning { background: var(--warning); } .sev.info { background: var(--info); } .sev.success { background: var(--success); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon { width: 28px; height: 28px; color: var(--muted-2); margin-bottom: 8px; }
.empty.sm { padding: 18px 10px; font-size: 13px; }
.attention { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.attention-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); background: #fff; }
.attention-head h3 { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; }
.attention-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.att { display: flex; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); align-items: flex-start; min-width: 0; }
.att:hover { background: var(--surface); }
.att .sev { margin-top: 6px; }
.att .t { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.att .h { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .d { font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.info-row { display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.info-row span { display: inline-flex; align-items: center; gap: 6px; }
.notes { white-space: pre-wrap; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }

/* ---------------- Kanban ---------------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface); border-radius: var(--radius); padding: 12px; min-height: 200px; display: flex; flex-direction: column; gap: 10px; }
.kcol.over { background: var(--surface-2); outline: 2px dashed #d5d5d5; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: grab; display: flex; flex-direction: column; gap: 8px; }
.kcard:hover { border-color: #d9d9d9; }
.kcard.dragging { opacity: .4; }
.kcard .kt { font-weight: 500; font-size: 13.5px; line-height: 1.35; }
.kcard .km { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }

/* ---------------- Calendário ---------------- */
.cal { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.cal-head div { padding: 10px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day { min-height: 118px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { background: #fcfcfc; } .cal-day.out .dn { color: var(--muted-2); }
.cal-day:hover { background: var(--surface); }
.cal-day .dn { font-size: 12px; padding: 2px 6px; align-self: flex-start; border-radius: 20px; }
.cal-day.today .dn { background: var(--ink); color: #fff; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.ev { font-size: 11.5px; padding: 3px 7px; border-radius: 6px; background: var(--neutral-bg); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 2px solid var(--muted-2); }
.ev.info { background: var(--info-bg); border-color: var(--info); } .ev.success { background: var(--success-bg); border-color: var(--success); }
.ev.warning { background: var(--warning-bg); border-color: var(--warning); } .ev.danger { background: var(--danger-bg); border-color: var(--danger); }
.ev.accent { background: var(--accent-bg); border-color: var(--accentc); } .ev.task { background: #fff; border: 1px dashed #d0d0d0; border-left: 2px solid var(--ink); }
.ev.done { text-decoration: line-through; opacity: .6; }
.more-ev { font-size: 11px; color: var(--muted); padding-left: 6px; }

/* ---------------- Gráficos ---------------- */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar .top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; gap: 10px; }
.hbar .top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .bar { height: 6px; background: var(--line-2); border-radius: 6px; overflow: hidden; } .hbar .bar i { display: block; height: 100%; background: var(--ink); border-radius: 6px; }
.tip { position: fixed; z-index: 300; background: var(--ink); color: #fff; font-size: 12px; padding: 8px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); }

/* ---------------- Projetos (cards) ---------------- */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; background: #fff; transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: #d6d6d6; }
.pcard h3 { font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.pcard .meta { font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.hero { border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 8px; }
.hero h1 { font-family: var(--serif); font-size: 40px; line-height: 1.1; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat-strip > div { padding: 16px 20px; border-right: 1px solid var(--line); }
.stat-strip > div:last-child { border-right: 0; }
.stat-strip .l { font-size: 11.5px; color: var(--muted); } .stat-strip .v { font-family: var(--serif); font-size: 24px; margin-top: 2px; font-variant-numeric: lining-nums tabular-nums; }
.phase-list .ph { display: grid; grid-template-columns: 28px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-2); align-items: start; }
.phase-list .ph:last-child { border-bottom: 0; }
.ph-num { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; color: var(--muted); background: #fff; }
.ph.done .ph-num { background: var(--ink); color: #fff; border-color: var(--ink); }
.ph.doing .ph-num { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery a { aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--surface); display: block; position: relative; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.03); }
.files .file { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.files .file:last-child { border-bottom: 0; }
.file-ico { width: 36px; height: 36px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-size: 9.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; flex: none; text-transform: uppercase; }
.dropzone { border: 1.5px dashed #dadada; border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: background .15s, border-color .15s; font-size: 13px; }
.dropzone.compact { padding: 8px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; }
.dropzone.compact .mt-8 { margin: 0; }
.dropzone:hover, .dropzone.over { background: var(--surface); border-color: #bdbdbd; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl { position: relative; padding: 0 0 18px; }
.tl::before { content: ''; position: absolute; left: -21px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 1.5px solid var(--ink); }
.tl.future::before { border-color: var(--muted-2); border-style: dashed; }
.tl .d { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.tl .x { font-size: 13.5px; }
.checklist .ci { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.checklist .ci input { width: 16px; height: 16px; accent-color: #111; }
.checklist .ci.done span { text-decoration: line-through; color: var(--muted-2); }
.checklist .ci .del { margin-left: auto; opacity: 0; } .checklist .ci:hover .del { opacity: 1; }
.comment { display: flex; gap: 10px; padding: 10px 0; }
.comment .b { background: var(--surface); border-radius: 12px; padding: 9px 12px; font-size: 13.5px; white-space: pre-wrap; flex: 1; }
.compare { display: grid; gap: 10px; }
.compare .opt { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; }
.compare .opt.best { border-color: var(--success); }
.compare .opt.chosen { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.compare .bar { grid-column: 1 / -1; height: 4px; background: var(--line-2); border-radius: 4px; overflow: hidden; } .compare .bar i { display: block; height: 100%; background: var(--muted-2); }
.compare .opt.best .bar i { background: var(--success); }
.profit { display: grid; grid-template-columns: 1fr auto; gap: 0; }
.profit > div { padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.profit > div:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.profit .total { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--ink); font-size: 15px; }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.notif.unread { background: #fcfbf9; } .notif:hover { background: var(--surface); }
.notif .sev { margin-top: 6px; }
.pop-panel { position: fixed; top: 64px; right: 24px; width: min(420px, calc(100vw - 24px)); max-height: 75vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 90; }
.pop-panel .ph-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }

/* ---------------- Login ---------------- */
/* Tela de acesso: painel branco (identidade) + painel preto (formulário) */
.auth { --auth-dark: #0b0b0b; --auth-field: #141414; --auth-border: #2c2c2c; --auth-text: #f4f2ef; --auth-soft: #a9a6a2;
  position: fixed; inset: 0; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; background: #fff; }
.auth-brand { position: relative; background: #fff; min-height: 0; overflow: hidden; display: flex; align-items: stretch; justify-content: center; padding: clamp(28px, 4.6vh, 56px) clamp(28px, 4vw, 72px) clamp(26px, 4vh, 48px); }
/* Fotografia como fundo suave: proporção preservada (object-fit: cover, sem distorcer), rostos no terço superior */
.auth-photo { position: absolute; left: 0; right: 0; top: 13%; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; opacity: .3; z-index: 0; pointer-events: none; user-select: none; }
/* Véu branco: integra a foto ao fundo e garante leitura da logo e da frase */
.auth-veil { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,.9) 0%, rgba(255,255,255,.35) 18%, rgba(255,255,255,0) 28%, rgba(255,255,255,0) 60%, rgba(255,255,255,.5) 80%, rgba(255,255,255,.8) 100%); }
.auth-brand-inner { position: relative; z-index: 1; height: 100%; width: 100%; max-width: 720px; display: flex; flex-direction: column; align-items: center; min-height: 0; }
.auth-spacer { flex: 1 1 auto; min-height: 24px; }
.auth-logo { display: block; flex: none; width: clamp(260px, 25vw, 460px); max-height: 16vh; height: auto; object-fit: contain; }
.auth-slogan { flex: none; margin: 0; text-align: center; font-family: var(--serif); font-weight: 400; letter-spacing: .005em;
  font-size: clamp(28px, 2.55vw, 50px); line-height: 1.12; color: #1c1a19; }
.auth-slogan span { display: block; }
.auth-contact { flex: none; margin-top: clamp(22px, 4.4vh, 52px); display: flex; flex-direction: column; align-items: center; gap: 8px; font-family: 'Jost', var(--font); font-weight: 400; font-size: clamp(12px, .78vw, 14px); letter-spacing: .04em; color: #5a5450; }
.auth-contact-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 8px; color: inherit; }
.auth-contact .icon { width: 17px; height: 17px; stroke-width: 1.5; color: #1a1a1a; margin-right: 2px; }
.auth-contact a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.auth-contact a:hover, .auth-contact a:hover span { color: #111; border-color: #111; }
a.auth-contact-row:hover { border-color: transparent; } a.auth-contact-row:hover span { border-bottom: 1px solid #111; }
.auth-contact a:focus-visible { outline: 2px solid #b9a489; outline-offset: 3px; }
.auth-dot { color: #b5aea8; }
.auth-lang { position: absolute; top: clamp(20px, 3.4vh, 36px); right: clamp(20px, 2.6vw, 40px); display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .14em; color: #bdbdbd; z-index: 2; }
.auth-lang button { border: 0; background: none; padding: 4px 2px; font: inherit; letter-spacing: inherit; color: #9a9a9a; cursor: pointer; transition: color .15s; }
.auth-lang button:hover { color: #111; }
.auth-lang button.on { color: #111; font-weight: 600; }
.auth-panel { position: relative; background: var(--auth-dark); color: var(--auth-text); display: flex; align-items: center; justify-content: center; padding: 48px clamp(28px, 5vw, 96px); overflow: hidden; min-height: 0; }
.auth-deco-circle { position: absolute; top: -34vh; right: -16vw; width: 64vh; height: 64vh; border-radius: 50%; border: 1px solid rgba(255,255,255,.09); pointer-events: none; }
.auth-deco-square { position: absolute; top: -1px; right: -1px; width: 15vw; height: 21vh; border-left: 1px solid rgba(255,255,255,.09); border-bottom: 1px solid rgba(255,255,255,.09); pointer-events: none; }
.auth-form { position: relative; z-index: 1; width: min(420px, 100%); display: flex; flex-direction: column; gap: 22px; }
.auth-head { margin-bottom: 6px; }
.auth-eyebrow { font-size: 11.5px; letter-spacing: .32em; text-transform: uppercase; color: var(--auth-soft); }
.auth-form h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 3.4vw, 54px); line-height: 1.05; margin-top: 12px; color: #fff; letter-spacing: 0; }
.auth-field { display: flex; flex-direction: column; gap: 9px; }
.auth-field > label { font-size: 13.5px; color: #e6e3df; font-weight: 500; }
.auth-input { position: relative; display: flex; align-items: center; height: 54px; background: var(--auth-field); border: 1px solid var(--auth-border); border-radius: 10px; transition: border-color .2s, box-shadow .2s, background .2s; }
.auth-input:hover { border-color: #3d3d3d; }
.auth-input:focus-within { border-color: #8f8a84; background: #171717; box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
.auth-input > .icon { margin-left: 16px; color: #8d8984; width: 18px; height: 18px; }
.auth-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: #fff; font-size: 14.5px; padding: 0 16px 0 14px; letter-spacing: .01em; }
.auth-input input::placeholder { color: #6f6c68; }
.auth-input input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 40px var(--auth-field) inset; caret-color: #fff; }
.auth-eye { border: 0; background: none; color: #8d8984; padding: 0 16px; height: 100%; display: grid; place-items: center; cursor: pointer; }
.auth-eye:hover { color: #fff; }
.auth-hint { font-size: 11.5px; color: #807c77; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.auth-check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: #e6e3df; user-select: none; }
.auth-check input { width: 17px; height: 17px; accent-color: #fff; margin: 0; cursor: pointer; }
.auth-row a { color: #d9d5cf; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(217,213,207,.45); transition: color .15s, text-decoration-color .15s; }
.auth-row a:hover { color: #fff; text-decoration-color: #fff; }
.auth-submit { position: relative; height: 56px; border: 1px solid #fff; border-radius: 10px; background: #fff; color: #0b0b0b; font-size: 15px; font-weight: 600; letter-spacing: .02em;
  display: flex; align-items: center; justify-content: center; cursor: pointer; margin-top: 6px; transition: background .2s, border-color .2s, transform .1s; }
.auth-submit .icon { position: absolute; right: 22px; width: 18px; height: 18px; transition: transform .2s; }
.auth-submit:hover { background: #ebe7e1; border-color: #ebe7e1; }
.auth-submit:hover .icon { transform: translateX(3px); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:focus-visible, .auth-row a:focus-visible, .auth-lang button:focus-visible, .auth-eye:focus-visible { outline: 2px solid #b9a489; outline-offset: 3px; }
.auth-submit[disabled] { opacity: .6; pointer-events: none; }
.auth-note { font-size: 12.5px; line-height: 1.6; color: #8f8b86; text-align: center; margin: 14px 0 0; padding-top: 18px; position: relative; }
.auth-note::before { content: ''; position: absolute; top: 0; left: 50%; width: 1px; height: 12px; background: #3a3a3a; }
@media (max-height: 700px) and (min-width: 901px) { .auth-form { gap: 16px; } .auth-input { height: 48px; } .auth-submit { height: 50px; } }

/* ---------------- Portal do cliente ---------------- */
.portal { max-width: 1080px; margin: 0 auto; padding: 0 24px 80px; }
.portal-top { display: flex; align-items: center; justify-content: space-between; padding: 26px 0; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.portal-hero { padding: 12px 0 28px; }
.portal-hero h1 { font-family: var(--serif); font-size: 44px; line-height: 1.1; }

/* ---------------- Mobile ---------------- */
.mobile-nav { display: none; }
.mobile-only { display: none; }
@media (max-width: 1200px) {
  .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  :root { --sidebar: 76px; }
  .nav a span.lbl, .nav a .count, .side-user .who { display: none; }
  .brand { padding: 20px 8px 16px; } .brand-logo { max-width: 62px; }
  .nav a { justify-content: center; padding: 11px; }
  .side-user { justify-content: center; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding: 28px 24px 80px; }
  .topbar { padding: 0 20px; }
}
@media (max-width: 720px) {
  html, body { font-size: 14.5px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-only { display: initial; }
  .desktop-only { display: none !important; }
  .topbar { height: 58px; padding: 0 12px; gap: 8px; }
  .topbar .m-brand { flex: none; display: flex; align-items: center; } .topbar .m-brand .brand-logo { width: 96px; max-width: 26vw; }
  .search { max-width: none; }
  .search input { height: 38px; } .search kbd { display: none; }
  .search.collapsed { flex: 0; } .search.collapsed input { width: 0; padding: 0; border: 0; }
  .content { padding: 20px 16px 110px; }
  .page-head { margin-bottom: 20px; } .page-head h1 { font-size: 30px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span2, .span3 { grid-column: auto; }
  .kpi .value { font-size: 24px; }
  .card { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .drawer { width: 100vw; border-radius: 0; }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 18px; padding-right: 18px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 10px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); z-index: 40; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .mobile-nav a, .mobile-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); padding: 6px 0; border: 0; background: none; }
  .mobile-nav a.active { color: var(--ink); }
  .mobile-nav .plus { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; margin-top: -18px; box-shadow: var(--shadow); }
  table.t.responsive thead { display: none; }
  table.t.responsive, table.t.responsive tbody, table.t.responsive tr, table.t.responsive td { display: block; width: 100%; }
  table.t.responsive tr { padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  table.t.responsive td { padding: 2px 0; border: 0; text-align: left !important; }
  table.t.responsive td[data-l]:not(.primary)::before { content: attr(data-l) ': '; color: var(--muted); font-size: 12px; }
  table.t.responsive td.actions { text-align: right !important; margin-top: -26px; }
  table.t.responsive tfoot { display: block; }
  .kanban { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; } .kcol { scroll-snap-align: start; }
  .cal-day { min-height: 64px; padding: 3px; } .cal-day .ev { font-size: 0; padding: 0; height: 5px; border-radius: 3px; border: 0; }
  .cal-day .ev.task { border: 0; background: var(--ink); } .more-ev { display: none; }
  .attention-grid { grid-template-columns: 1fr; } .att { border-right: 0; padding: 12px 16px; } .attention-head { padding: 14px 16px; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); } .stat-strip > div { border-bottom: 1px solid var(--line); }
  .hero h1 { font-size: 30px; }
  .pop-panel { right: 12px; top: 58px; }
  .portal-hero h1 { font-size: 32px; }
  .toolbar .search-sm { max-width: none; min-width: 100%; }
}

/* ---------------- Impressão (relatórios / PDF) ---------------- */
@media print {
  .sidebar, .topbar, .mobile-nav, .toolbar, .no-print, .btn { display: none !important; }
  .app { display: block; } .content { padding: 0; max-width: none; }
  .card, .table-wrap { break-inside: avoid; border-color: #ddd; }
  body { font-size: 11px; }
}

/* Tela de acesso — tablet em pé e celular: identidade em cima, formulário embaixo */
@media (max-width: 900px) {
  .auth { position: static; min-height: 100vh; grid-template-columns: 1fr; overflow: visible; }
  .auth-brand { padding: 56px 22px 30px; min-height: 82vh; }
  .auth-logo { width: min(290px, 74vw); max-height: none; }
  .auth-slogan { font-size: 25px; }
  .auth-photo { top: 11%; }
  .auth-veil { background: linear-gradient(to bottom, rgba(255,255,255,.9) 0%, rgba(255,255,255,.4) 18%, rgba(255,255,255,0) 34%, rgba(255,255,255,0) 50%, rgba(255,255,255,.6) 72%, rgba(255,255,255,.9) 100%); }
  .auth-contact { font-size: 13px; margin-top: 22px; gap: 12px; }
  .auth-contact-row:first-child { flex-direction: column; gap: 7px; }
  .auth-contact-row:first-child .icon { margin: 0 0 2px; }
  .auth-dot { display: none; }
  .auth-lang { top: 18px; right: 18px; }
  .auth-panel { padding: 48px 22px 56px; overflow: hidden; }
  .auth-deco-circle { width: 360px; height: 360px; top: -220px; right: -160px; }
  .auth-deco-square { width: 120px; height: 90px; }
  .auth-form { width: min(440px, 100%); }
  .auth-form h1 { font-size: 40px; }
}