/* =========================================================
   Portal do Síndico — estilos
   ========================================================= */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e8f0;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #8a94a8;
  --primary: #4f46e5;
  --primary-2: #6366f1;
  --primary-soft: #eef0ff;
  --good: #059669; --good-soft: #e7f8f1;
  --bad: #dc2626;  --bad-soft: #fdeceb;
  --warn: #d97706; --warn-soft: #fff4e2;
  --info: #0284c7; --info-soft: #e6f4fc;
  --side-bg: #0f172a;
  --side-text: #aab4c8;
  --side-active: #1e293b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18);
  --side-w: 264px;
  --top-h: 64px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #121a2b;
  --surface-2: #172036;
  --border: #243049;
  --text: #e6eaf2;
  --text-2: #b3bdd1;
  --muted: #7d89a3;
  --primary: #818cf8;
  --primary-2: #a5b4fc;
  --primary-soft: #1f2547;
  --good: #34d399; --good-soft: #0f2e25;
  --bad: #f87171;  --bad-soft: #3a1a1d;
  --warn: #fbbf24; --warn-soft: #3a2c10;
  --info: #38bdf8; --info-soft: #0d2a3b;
  --side-bg: #070c18;
  --side-active: #151e33;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }

/* ---------------- Layout ---------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side-w); background: var(--side-bg); color: var(--side-text);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40;
  transition: transform .25s ease;
}
.side-brand { height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 20px; color: #fff; font-weight: 700; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.logo-dot { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #6366f1, #22d3ee); display: inline-grid; place-items: center; box-shadow: 0 4px 14px rgba(99,102,241,.45); }
.logo-dot::after { content: ""; width: 12px; height: 12px; border: 2.5px solid #fff; border-radius: 3px; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 12px 20px; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.nav-group { margin-top: 14px; }
.nav-group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 0 10px 6px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--side-text); font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #6366f1; }
.nav-item .badge { margin-left: auto; }
.side-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.06); font-size: 12px; }

.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--top-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.topbar .title { font-size: 17px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.condo-select { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; height: 38px; max-width: 320px; }
.condo-select select { border: 0; background: transparent; outline: none; font-weight: 600; min-width: 0; max-width: 240px; cursor: pointer; }
.user-chip { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 99px; position: relative; }
.user-chip:hover { background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #06b6d4); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-chip .info { line-height: 1.15; }
.user-chip .info small { color: var(--muted); font-size: 11.5px; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 210px; padding: 6px; z-index: 60; }
.dropdown a, .dropdown button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); background: none; border: 0; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); }

.content { padding: 24px; max-width: 1500px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- Botões & inputs ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.25); }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=month], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--text-2); }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.req::after { content: " *"; color: var(--bad); }

/* ---------------- Cards ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px; display: flex; gap: 14px; align-items: flex-start; position: relative; overflow: hidden; cursor: default; }
.kpi[data-link] { cursor: pointer; }
.kpi[data-link]:hover { border-color: var(--primary); }
.kpi .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.kpi .ico svg { width: 21px; height: 21px; }
.kpi.good .ico { background: var(--good-soft); color: var(--good); }
.kpi.bad .ico { background: var(--bad-soft); color: var(--bad); }
.kpi.warn .ico { background: var(--warn-soft); color: var(--warn); }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .val { font-size: 22px; font-weight: 750; margin-top: 3px; letter-spacing: -.02em; white-space: nowrap; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.chart-box { position: relative; height: 300px; padding: 12px 16px 16px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); cursor: pointer; }
.list li:last-child { border-bottom: 0; }
.list li:hover { background: var(--surface-2); }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .s { font-size: 12px; color: var(--muted); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; opacity: .5; margin-bottom: 8px; }
.date-pill { min-width: 50px; text-align: center; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); padding: 4px 6px; line-height: 1.1; }
.date-pill b { display: block; font-size: 16px; }
.date-pill small { font-size: 10.5px; text-transform: uppercase; color: var(--muted); }
.date-pill.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.date-pill.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }

/* ---------------- Badges ---------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.stars { color: #f59e0b; letter-spacing: 1px; }

/* ---------------- Tabela ---------------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.toolbar .search { flex: 1 1 240px; position: relative; }
.toolbar .search svg { position: absolute; left: 11px; top: 11px; color: var(--muted); }
.toolbar .search input { padding-left: 36px; }
.toolbar select, .toolbar input[type=date] { width: auto; min-width: 140px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none; }
table.data th.sorted { color: var(--primary); }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data tbody tr { cursor: pointer; transition: background .1s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.act { width: 1%; }
.money-pos { color: var(--good); font-weight: 600; }
.money-neg { color: var(--bad); font-weight: 600; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.sums { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.sums b { font-variant-numeric: tabular-nums; }
.pager { display: flex; gap: 6px; align-items: center; }

/* ---------------- Upload ---------------- */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center; background: var(--surface); transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .big { width: 46px; height: 46px; border-radius: 14px; margin: 0 auto 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.dropzone .big svg { width: 24px; height: 24px; }
.dropzone h4 { margin: 0 0 4px; font-size: 15px; }
.dropzone p { margin: 0; color: var(--muted); font-size: 13px; }
.dropzone .formats { margin-top: 10px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.dropzone.compact { padding: 14px; display: flex; align-items: center; gap: 14px; text-align: left; }
.dropzone.compact .big { margin: 0; width: 40px; height: 40px; }
.files-panel { margin-bottom: 20px; }
.file-list { list-style: none; padding: 0; margin: 0; }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); }
.file-ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; color: #fff; background: #64748b; flex-shrink: 0; text-transform: uppercase; }
.file-ico.pdf { background: #dc2626; } .file-ico.xlsx, .file-ico.xls, .file-ico.csv, .file-ico.ods { background: #16a34a; }
.file-ico.jpg, .file-ico.jpeg, .file-ico.png, .file-ico.webp { background: #7c3aed; } .file-ico.ofx { background: #0284c7; } .file-ico.doc, .file-ico.docx { background: #2563eb; }
.collapser { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.collapser .chev { transition: transform .2s; }
.collapsed .chev { transform: rotate(-90deg); }

/* ---------------- Modal ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(3px); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 760px; animation: pop .18s ease; }
.modal.xl { max-width: 1100px; }
.modal.sm { max-width: 460px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); gap: 10px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .right { display: flex; gap: 8px; margin-left: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span2 { grid-column: span 2; }
.form-section { grid-column: span 2; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
.rating-input { display: flex; gap: 4px; font-size: 24px; cursor: pointer; color: #cbd5e1; }
.rating-input span.on { color: #f59e0b; }

/* ---------------- Importação ---------------- */
.imp-item { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.imp-item-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface-2); flex-wrap: wrap; }
.imp-item-head .grow { flex: 1; min-width: 160px; }
.imp-item-body { padding: 14px 16px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.map-cell { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.map-cell .h { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-cell select { height: 34px; font-size: 13px; }
.map-cell.unmapped { opacity: .6; }
.preview-table { font-size: 12.5px; }
.preview-table td, .preview-table th { padding: 7px 10px !important; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), #06b6d4); transition: width .3s; }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-box { border-radius: 12px; padding: 12px 14px; background: var(--good-soft); color: var(--good); margin-top: 10px; font-weight: 500; }
.result-box.bad { background: var(--bad-soft); color: var(--bad); }
.result-box ul { margin: 6px 0 0; padding-left: 18px; font-weight: 400; color: var(--text-2); max-height: 140px; overflow: auto; }

/* ---------------- Toast ---------------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 36px); }
.toast { background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; animation: pop .2s; max-width: 420px; }
.toast.bad { background: #b91c1c; }
.toast.good { background: #047857; }

/* ---------------- Login ---------------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 10% -10%, #c7d2fe 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #a5f3fc 0%, transparent 55%), var(--bg); padding: 20px; }
[data-theme="dark"] .auth-body { background: radial-gradient(1200px 600px at 10% -10%, #1e1b4b 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #083344 0%, transparent 55%), var(--bg); }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 32px; }
.auth-card.wide { max-width: 620px; }
.auth-card h2 { margin: 14px 0 6px; font-size: 22px; }
.auth-card form { display: grid; gap: 14px; margin-top: 18px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; }
.auth-brand small { color: var(--muted); font-weight: 500; }
.alert { padding: 11px 14px; border-radius: 10px; margin: 12px 0; font-weight: 500; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.install-log { background: var(--surface-2); padding: 12px; border-radius: 10px; max-height: 220px; overflow: auto; font-size: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-color: var(--primary); }
.condo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.condo-card { padding: 18px; cursor: pointer; }
.condo-card:hover { border-color: var(--primary); }
.condo-card h4 { margin: 0 0 12px; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.condo-card .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.backdrop { display: none; }

/* ---------------- Filtros avançados ---------------- */
.adv-filters { border-bottom: 1px solid var(--border); background: var(--surface-2); padding: 16px; }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.adv-grid label { font-size: 12px; }
.adv-grid input, .adv-grid select { height: 36px; font-size: 13px; }
.range { display: flex; gap: 6px; }
.range input { min-width: 0; }
.adv-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------------- Relatórios ---------------- */
.report-bar { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.report-table tfoot th { background: var(--surface-2); border-top: 2px solid var(--border); font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text); padding: 11px 14px; }
.report-table tbody tr { cursor: default; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #06b6d4); border-radius: 99px; }
body.printing-report > *:not(.print-target) { display: none !important; }
body.printing-report .print-target { position: static; background: none; backdrop-filter: none; padding: 0; overflow: visible; }
body.printing-report .print-target .modal { box-shadow: none; max-width: none; border-radius: 0; }
body.printing-report .print-target .modal-foot, body.printing-report .print-target [data-close] { display: none !important; }

/* ---------------- Perfis e permissões ---------------- */
.perm-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.perm-table th.c, .perm-table td.c { text-align: center; width: 92px; }
.perm-table td.c input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.perm-table tbody tr { cursor: default; }
.perm-table tr.grp td { background: var(--surface-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 14px; }

/* ---------------- Pendências ---------------- */
.bell-btn { position: relative; }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.bell-count.alta { background: var(--bad); }
.pend-group { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.pend-cond { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface-2); font-weight: 650; font-size: 13px; }
.pend-list li { padding: 11px 16px; }
.pend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.pend-dot.alta { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }

/* ---------------- Assistente ---------------- */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 45; display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 20px 0 16px; border: 0; border-radius: 99px; color: #fff; font-weight: 650; cursor: pointer; background: linear-gradient(135deg, #4f46e5, #06b6d4); box-shadow: 0 12px 30px rgba(79,70,229,.4); transition: transform .15s; }
.ai-fab:hover { transform: translateY(-2px); }
.ai-fab svg { width: 20px; height: 20px; }
.ai-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 70; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; padding-top: env(safe-area-inset-top, 0px); }
.ai-panel.open { transform: none; }
.ai-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ai-title { display: flex; gap: 10px; align-items: center; }
.ai-title > svg { width: 34px; height: 34px; padding: 8px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #4f46e5, #06b6d4); }
.ai-title small { display: block; color: var(--muted); font-size: 12px; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; line-height: 1.5; font-size: 14px; word-wrap: break-word; }
.ai-msg p { margin: 0 0 6px; } .ai-msg p:last-child { margin: 0; }
.ai-msg ul { margin: 4px 0 6px; padding-left: 18px; }
.ai-msg code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.ai-msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.ai-msg.assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ai-msg.typing { display: flex; gap: 5px; padding: 14px; }
.ai-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.ai-msg.typing span:nth-child(2) { animation-delay: .2s; } .ai-msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-hello { text-align: center; margin: auto 0; padding: 10px; }
.ai-orb { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #4f46e5, #06b6d4); box-shadow: 0 10px 30px rgba(79,70,229,.35); }
.ai-orb svg { width: 26px; height: 26px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.ai-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 99px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; text-align: left; }
.ai-chip:hover { border-color: var(--primary); color: var(--primary); }
.ai-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); align-items: flex-end; }
.ai-input textarea { min-height: 42px; max-height: 140px; resize: none; padding: 10px 12px; }
.ai-foot { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: 11px; color: var(--muted); padding: 0 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
.ai-foot svg { width: 13px; height: 13px; color: var(--good); }
@media (max-width: 860px) {
  .ai-fab { right: 14px; bottom: 84px; height: 46px; padding: 0 14px; }
  .ai-fab span { display: none; }
}

/* ---------------- Login (tela dividida) ---------------- */
.login-split { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.login-hero { position: relative; overflow: hidden; background: linear-gradient(150deg, #0b1120 0%, #1e1b4b 55%, #312e81 100%); color: #fff; display: flex; align-items: center; padding: 56px; }
.lh-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; }
.lh-glow.g1 { width: 420px; height: 420px; background: #6366f1; top: -120px; left: -80px; }
.lh-glow.g2 { width: 380px; height: 380px; background: #06b6d4; bottom: -140px; right: -60px; opacity: .4; }
.lh-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%); }
.lh-inner { position: relative; max-width: 540px; }
.auth-brand.light { color: #fff; }
.login-hero h1 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.12; font-weight: 800; letter-spacing: -.03em; margin: 34px 0 16px; }
.login-hero h1 span { background: linear-gradient(90deg, #a5b4fc, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p { color: #c7cce0; font-size: 16px; line-height: 1.6; margin: 0 0 28px; }
.login-feats { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 16px; }
.login-feats li { display: flex; gap: 14px; align-items: center; }
.login-feats b { display: block; font-size: 15px; }
.login-feats span:not(.lf-ico) { color: #aab3cc; font-size: 13.5px; }
.lf-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); flex-shrink: 0; }
.lf-ico svg { width: 20px; height: 20px; color: #a5b4fc; }
.lh-card { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 18px 20px; backdrop-filter: blur(10px); max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.lh-card-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: #c7cce0; }
.lh-card-row b { font-size: 20px; color: #fff; }
.lh-card-row b.up { color: #6ee7b7; }
.lh-bars { display: flex; align-items: flex-end; gap: 8px; height: 70px; margin-top: 14px; }
.lh-bars i { flex: 1; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #818cf8, rgba(129,140,248,.25)); }
.lh-bars i:last-child { background: linear-gradient(180deg, #67e8f9, rgba(103,232,249,.3)); }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.login-box { width: 100%; max-width: 400px; }
.login-box h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.login-box form { display: grid; gap: 18px; margin-top: 26px; }
.input-ico { position: relative; }
.input-ico > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-ico input { height: 48px !important; padding-left: 42px !important; padding-right: 44px !important; border-radius: 12px !important; font-size: 15px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; width: 36px; height: 36px; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-toggle:hover { background: var(--surface-2); color: var(--text); }
.login-btn { height: 50px !important; font-size: 15px; border-radius: 12px !important; margin-top: 4px; }
.login-secure { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--muted); font-size: 12px; margin-top: 22px; text-align: center; }
.login-secure svg { width: 15px; height: 15px; color: var(--good); }
.mobile-only { display: none; }
@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .mobile-only { display: flex; margin-bottom: 28px; }
  .login-panel { align-items: flex-start; padding-top: 12vh; background: radial-gradient(600px 300px at 0% 0%, var(--primary-soft), transparent 70%), var(--surface); }
}

/* ---------------- Responsivo ---------------- */
.dash-grid > *, .dash-grid-3 > *, .kpis > * { min-width: 0; }
@media (max-width: 1100px) {
  .dash-grid, .dash-grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 35; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .title { display: none; }
  .topbar .spacer { display: none; }
  .condo-select { flex: 1; max-width: none; min-width: 0; }
  .condo-select select { max-width: none; width: 100%; }
  .user-chip .info { display: none; }
  .content { padding: 16px 12px 90px; }
  .page-head h1 { font-size: 20px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; flex-direction: column; gap: 8px; min-width: 0; }
  .kpi > div { min-width: 0; width: 100%; }
  .kpi .val { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
  .kpi .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .page-head p { font-size: 13px; }
  .card-head h3 { font-size: 14px; }
  .kpi .ico { width: 36px; height: 36px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2, .form-section { grid-column: span 1; }
  .overlay { padding: 0; align-items: stretch; }
  .modal { border-radius: 0; min-height: 100vh; max-width: none !important; }
  .toolbar select, .toolbar input[type=date] { flex: 1 1 45%; min-width: 0; }
  /* tabela vira cartões */
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { border-bottom: 1px solid var(--border); padding: 10px 14px; }
  table.data td { border: 0; padding: 3px 0; max-width: none; white-space: normal; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.data td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; }
  table.data td:first-child { font-weight: 650; font-size: 15px; }
  table.data td:first-child::before { display: none; }
  table.data td.act { width: auto; justify-content: flex-end; }
  table.data td.act::before { display: none; }
  table.data td.num { text-align: right; }
  .fab { display: grid !important; }
}
.fab { display: none; position: fixed; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 18px; background: var(--primary); color: #fff; place-items: center; box-shadow: 0 10px 30px rgba(79,70,229,.45); border: 0; z-index: 25; cursor: pointer; }
.fab svg { width: 24px; height: 24px; }
@media print {
  .sidebar, .topbar, .actions, .toolbar, .fab, .files-panel { display: none !important; }
  .main { margin: 0; }
}
