:root { color-scheme: light; --ink:#17231c; --muted:#68756d; --paper:#f4f7f3; --panel:#fff; --line:#dfe7e1; --brand:#176b45; --brand-dark:#0d4b2e; --accent:#d9f2e4; }
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; background:var(--paper); color:var(--ink); font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; display:grid; grid-template-columns:240px 1fr; }
.sidebar { position:sticky; top:0; height:100vh; background:var(--brand-dark); color:#fff; padding:28px 18px; display:flex; flex-direction:column; }
.brand { display:flex; align-items:center; gap:12px; padding:0 10px 28px; font-size:20px; font-weight:750; }
.brand-mark { display:block; width:34px; height:34px; flex-shrink:0; }
nav { display:grid; gap:5px; }
nav a { color:#d8e7de; text-decoration:none; padding:11px 12px; border-radius:9px; font-size:14px; }
nav a:hover, nav a.active { color:#fff; background:rgba(255,255,255,.12); }
.nav-disabled { color:#87a393; padding:11px 12px; border-radius:9px; font-size:14px; display:flex; justify-content:space-between; }.nav-disabled small { font-size:9px; text-transform:uppercase; letter-spacing:.06em; }
.sidebar-install { margin-top:auto; display:flex; align-items:center; justify-content:center; gap:8px; width:100%; padding:10px 12px; border:1px solid rgba(255,255,255,.28); border-radius:9px; background:rgba(255,255,255,.08); color:#fff; font:inherit; font-size:13px; font-weight:650; cursor:pointer; }
.sidebar-install:hover { background:rgba(255,255,255,.16); }
.sidebar-install[hidden] { display:none; }
main { padding:34px 42px 60px; min-width:0; }
.topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:30px; }
.eyebrow { margin:0 0 5px; color:var(--brand); font-size:11px; letter-spacing:.12em; text-transform:uppercase; font-weight:800; }
h1,h2 { margin:0; letter-spacing:-.035em; } h1 { font-size:30px; } h2 { font-size:21px; }
.environment { padding:7px 11px; border:1px solid var(--line); border-radius:999px; background:#fff; color:var(--muted); font-size:12px; }
.account { display:flex; align-items:center; gap:10px; }
.account-avatar { width:34px; height:34px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.account-avatar-fallback { display:grid; place-items:center; background:var(--brand); color:#fff; font-weight:700; font-size:14px; }
.account-info { display:grid; gap:2px; }
.account-name { font-size:13px; font-weight:650; }
.link-button { background:none; border:none; padding:0; margin:0; color:var(--muted); font-size:11px; cursor:pointer; text-decoration:underline; text-underline-offset:2px; text-align:left; }
.link-button:hover { color:var(--ink); }
.metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:16px; margin-bottom:22px; }
.metrics article,.panel { background:var(--panel); border:1px solid var(--line); border-radius:15px; box-shadow:0 5px 24px rgba(15,50,30,.04); }
.metrics article { padding:20px; display:grid; gap:4px; } .metrics span,.metrics small { color:var(--muted); } .metrics span { font-size:13px; font-weight:650; } .metrics strong { font-size:31px; } .metrics small { font-size:12px; }
.panel { overflow:hidden; padding:22px; }.panel-heading { margin:-22px -22px 22px; padding:21px 22px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); }
.panel > table,.panel > .table-scroll,.panel > .empty { margin-left:-22px; margin-right:-22px; }
.button { background:var(--brand); color:#fff; text-decoration:none; font-weight:700; font-size:13px; padding:10px 14px; border-radius:9px; }
.actions { display:flex; gap:10px; align-items:center; }
.wizard-steps { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 22px; padding:0; list-style:none; }
.wizard-steps li { display:flex; align-items:center; gap:8px; padding:8px 14px; border-radius:999px; background:var(--panel); border:1px solid var(--line); color:var(--muted); font-size:13px; font-weight:650; }
.wizard-steps li span { display:grid; place-items:center; width:22px; height:22px; border-radius:50%; background:var(--line); color:var(--ink); font-size:12px; }
.wizard-steps li.active { color:var(--brand-dark); border-color:var(--brand); background:var(--accent); }
.wizard-steps li.active span { background:var(--brand); color:#fff; }
.wizard-steps li.done span { background:var(--brand-dark); color:#fff; }
table { width:100%; border-collapse:collapse; } th,td { padding:14px 22px; text-align:left; border-bottom:1px solid var(--line); font-size:13px; } th { color:var(--muted); background:#fafcf9; font-size:11px; text-transform:uppercase; letter-spacing:.06em; } td small { display:block; margin-top:4px; color:var(--muted); } tbody tr:last-child td { border-bottom:0; }
.status { display:inline-block; padding:5px 8px; border-radius:999px; background:#edf1ee; color:#4f5d54; font-size:11px; text-transform:capitalize; }.status-ativo { background:var(--accent); color:var(--brand-dark); }
.empty { padding:50px 22px; text-align:center; color:var(--muted); }.empty strong { color:var(--ink); }.empty p { margin:7px 0 0; }
code { color:#355343; background:#f0f5f1; padding:3px 6px; border-radius:5px; }

[hidden] { display: none !important; }
.explorer-tabs, .query-controls, .pagination, .column-options { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; align-items: end; }
.query-controls label { display: grid; gap: .4rem; }
button, select, input:not([type=checkbox]) { font: inherit; padding: .5rem .7rem; border: 1px solid #cbd5e1; border-radius: .4rem; }
button { cursor: pointer; background: #edf5f2; color: #174d40; }
button:disabled { opacity: .5; cursor: default; }
.table-scroll { overflow-x: auto; }
#message { color: #174d40; white-space: pre-wrap; }
fieldset { border: 1px solid #cbd5e1; border-radius: .4rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.map-toolbar { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:0 0 1rem; color:var(--muted); font-size:12px; }
.map-layout { display:grid; grid-template-columns:minmax(0,1fr) 360px; height:var(--map-height, 560px); border:1px solid var(--line); border-radius:.6rem; overflow:hidden; }
.map-canvas { width:100%; height:100%; min-height:0; background:#e7eee9; }
.map-details { min-height:0; padding:18px; border-left:1px solid var(--line); overflow:auto; }
.map-details h3 { margin:0 0 12px; font-size:15px; }
.map-details h3:not(:first-child) { margin-top:26px; }
.map-details form { display:grid; gap:12px; }
.map-details label { display:grid; gap:5px; font-size:12px; color:var(--muted); }
.feature-properties { display:grid; grid-template-columns:minmax(90px,auto) 1fr; gap:6px 10px; margin:0; font-size:12px; }
.feature-properties dt { color:var(--muted); overflow-wrap:anywhere; }
.feature-properties dd { margin:0; overflow-wrap:anywhere; }
.maplibregl-popup-content { color:var(--ink); max-width:320px; }
body.map-active main { padding-bottom:22px; }
/* Em telas estreitas os detalhes vão para baixo: o mapa fica com a altura visível e o painel cresce abaixo dele. */
@media (max-width:1000px) { .map-layout { grid-template-columns:1fr; height:auto; }.map-canvas { height:var(--map-height, 480px); }.map-details { border-left:0; border-top:1px solid var(--line); overflow:visible; } }
.auth-body { display:grid; grid-template-columns:1fr; min-height:100vh; place-items:center; background:var(--paper); padding:24px; }
.auth-card { width:min(100%,460px); background:white; border:1px solid var(--line); border-radius:14px; padding:34px; box-shadow:0 18px 50px rgba(18,53,39,.08); }
.auth-card .brand { color:var(--ink); margin-bottom:32px; }
.auth-card h1 { margin:8px 0 12px; }
.auth-actions,.auth-form { display:grid; gap:14px; margin-top:24px; }
.auth-form label { display:grid; gap:7px; }
.auth-error { color:#9f2d20; }
.mfa-qr { display:block; margin:20px auto 0; padding:14px; background:#fff; border:1px solid var(--line); border-radius:12px; }
.mfa-secret,.break-code { display:block; margin:18px 0; padding:12px; overflow-wrap:anywhere; }
.recovery-codes { columns:2; list-style:none; padding:16px; background:#f4f7f5; border-radius:8px; }
.recovery-codes li { margin:8px 0; }
.editor-layout { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:22px; align-items:start; }
.editor-main { display:grid; gap:22px; min-width:0; }
.sql-editor { width:100%; font:13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding:12px; border:1px solid #cbd5e1; border-radius:.4rem; resize:vertical; tab-size:2; }
.sql-block { font:13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background:#f0f5f1; padding:14px; border-radius:.4rem; }
.editor-message { margin:12px 0 0; color:#9f2d20; font-size:13px; }
.editor-message:empty { display:none; }
.editor-sources { position:sticky; top:20px; max-height:calc(100vh - 40px); overflow:auto; }
.editor-sources h2 { font-size:17px; }
.source-item { border-top:1px solid var(--line); padding:10px 0; }
.source-item summary { cursor:pointer; display:flex; justify-content:space-between; gap:8px; font-size:13px; }
.source-item summary small { color:var(--muted); white-space:nowrap; }
.source-insert { display:block; margin:8px 0; font:12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap:anywhere; text-align:left; width:100%; }
.source-columns { display:flex; flex-wrap:wrap; gap:6px; }
.source-column { padding:3px 7px; font:11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background:#fff; }
@media (max-width:1000px) { .editor-layout { grid-template-columns:1fr; }.editor-sources { position:static; max-height:none; } }

/* Formulários */
textarea { font:inherit; padding:.5rem .7rem; border:1px solid #cbd5e1; border-radius:.4rem; resize:vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline:2px solid var(--brand); outline-offset:1px; }
.form-stack { display:grid; gap:18px; }
.form-field { display:grid; gap:6px; max-width:640px; font-size:13px; font-weight:650; }
.form-field input, .form-field select, .form-field textarea { width:100%; font-weight:400; }
.field-hint { color:var(--muted); font-size:12px; font-weight:400; }
.optional { color:var(--muted); font-size:11px; font-weight:400; }
.form-error { margin:0; color:#9f2d20; font-size:13px; white-space:pre-wrap; }
.form-error:empty { display:none; }
.form-actions { display:flex; justify-content:flex-end; align-items:center; gap:10px; margin-top:4px; padding-top:18px; border-top:1px solid var(--line); }
.form-actions .button { padding:.55rem .9rem; }
button.primary { background:var(--brand); border-color:var(--brand); color:#fff; font-weight:700; }
button.primary:hover:not(:disabled) { background:var(--brand-dark); }
.secondary-link { margin-right:auto; color:var(--muted); font-size:13px; }
.check-field { display:flex; align-items:center; gap:8px; font-size:13px; }
.choice-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr)); gap:12px; max-width:640px; margin:0; padding:0; border:0; }
.choice-cards legend { margin-bottom:8px; padding:0; font-size:13px; font-weight:650; }
.choice-card { position:relative; display:grid; gap:4px; padding:14px 16px 14px 42px; border:1px solid var(--line); border-radius:12px; background:#fff; font-size:14px; cursor:pointer; }
.choice-card input { position:absolute; top:16px; left:16px; margin:0; padding:0; accent-color:var(--brand); }
.choice-card small { color:var(--muted); font-size:12px; }
.choice-card:has(input:checked) { border-color:var(--brand); background:var(--accent); }
.choice-card.disabled { opacity:.5; cursor:not-allowed; }
.target-summary { margin:0; padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:#fafcf9; color:var(--muted); font-size:13px; }
.target-summary strong { color:var(--ink); }
.dropzone { position:relative; display:grid; place-items:center; gap:6px; padding:44px 20px; border:2px dashed #cbd5e1; border-radius:14px; background:#fafcf9; text-align:center; cursor:pointer; overflow-wrap:anywhere; }
.dropzone input { position:absolute; inset:0; width:100%; opacity:0; cursor:pointer; }
.dropzone small { color:var(--muted); }
.dropzone:hover, .dropzone.dragging { border-color:var(--brand); background:var(--accent); }
.dropzone.has-file { border-style:solid; border-color:var(--brand); }
.dropzone:focus-within { outline:2px solid var(--brand); outline-offset:2px; }
.progress { height:10px; border-radius:999px; background:var(--line); overflow:hidden; }
.progress span { display:block; width:0; height:100%; background:var(--brand); transition:width .4s ease; }
.alert-error { display:grid; gap:10px; padding:14px 16px; border:1px solid #f0c8c2; border-radius:10px; background:#fdf3f1; color:#7a2318; font-size:13px; }
.alert-error pre { max-height:280px; margin:0; overflow:auto; font-size:12px; color:var(--ink); }
.alert-error .form-actions { border-top-color:#f0c8c2; }
.diff-summary { display:grid; gap:10px; }
.diff-summary p { margin:0; }
.diff-group { display:grid; grid-template-columns:120px 1fr; gap:10px; align-items:start; font-size:13px; }
.diff-label { color:var(--muted); font-weight:650; }
.diff-items { display:flex; flex-wrap:wrap; gap:6px; }
.diff-none { color:var(--muted); }
.diff-added { background:#e3f4ea; }
.diff-removed { background:#fbe7e4; color:#7a2318; }
.diff-changed { background:#fdf3d8; color:#6b4e00; }
.wizard { max-width:880px; }
#publish-message:empty { display:none; }
.back-link { margin:-12px 0 18px; font-size:13px; }
.back-link a { color:var(--muted); text-decoration:none; }
.back-link a:hover { color:var(--brand); }
.editor-message { margin:12px 0; }
.editor-message.success { color:var(--brand-dark); }
.editor-sources p { font-size:13px; }
.editor-sources .form-field { margin:12px 0; }
@media (max-width:640px) { .diff-group { grid-template-columns:1fr; gap:4px; } }

/* Padrão visual compartilhado por todas as telas */
main > .panel + .panel, .page-stack { margin-top:22px; }
.page-stack { display:grid; gap:22px; margin-top:0; }
.form-page { max-width:880px; }
.form-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr)); gap:18px; max-width:640px; }
.form-row .form-field { max-width:none; }
.form-details { max-width:100%; font-size:13px; }
.form-details summary { cursor:pointer; color:var(--brand); font-weight:650; }
.form-details[open] summary { margin-bottom:14px; }
select { background-color:#fff; }
button { font-size:14px; }
.query-controls label { display:grid; gap:6px; font-size:13px; font-weight:650; }
.query-controls label input, .query-controls label select { font-weight:400; }
fieldset { margin:0; padding:12px 14px; border:1px solid var(--line); border-radius:10px; }
fieldset > legend { padding:0 6px; font-size:13px; font-weight:650; }
.column-options { margin:4px 0 0; gap:8px; }
.column-options label { display:inline-flex; align-items:center; gap:6px; padding:5px 10px; border:1px solid var(--line); border-radius:999px; font-size:13px; cursor:pointer; }
.column-options label:has(input:checked) { border-color:var(--brand); background:var(--accent); }
.column-options input { accent-color:var(--brand); margin:0; }
.pagination { align-items:center; justify-content:flex-end; gap:10px; }
.pagination span { color:var(--muted); font-size:13px; }
.page-message { margin:0 0 16px; padding:10px 14px; border-radius:10px; background:var(--accent); color:var(--brand-dark); font-size:13px; }
.page-message:empty { display:none; }
.page-message.error { background:#fdf3f1; color:#7a2318; }
.status-pendente { background:#fdf3d8; color:#6b4e00; }
.status-inativo { background:#edf1ee; color:var(--muted); }
.row-actions { text-align:right; white-space:nowrap; }
.row-actions button + button { margin-left:6px; }
.explorer-tabs { gap:4px; margin:6px 0 18px; padding:0; border-bottom:1px solid var(--line); align-items:stretch; }
.explorer-tabs button { margin-bottom:-1px; padding:10px 14px; border:0; border-bottom:2px solid transparent; border-radius:0; background:none; color:var(--muted); font-weight:650; font-size:13px; }
.explorer-tabs button:hover { color:var(--ink); }
.explorer-tabs button.active { color:var(--brand-dark); border-bottom-color:var(--brand); }
.panel > h2:first-child { margin-bottom:14px; }
.panel h3 { margin:18px 0 10px; font-size:15px; }
.access-matrix { border:1px solid var(--line); }
.access-matrix thead th { background:var(--brand-dark); color:#fff; text-align:center; font-size:12px; letter-spacing:0; text-transform:none; }
.access-matrix thead th:first-child, .access-matrix tbody th { text-align:left; }
.access-matrix tbody th { color:var(--ink); background:none; font-size:13px; letter-spacing:0; text-transform:none; }
.access-matrix td { text-align:center; }
.access-matrix th, .access-matrix td { border:1px solid var(--line); }
.access-matrix tbody tr:nth-child(even) { background:#f6f8f5; }
.access-yes { color:var(--brand); font-size:17px; font-weight:700; }
.access-no { color:#b8c3bc; }
.invite-note { display:flex; align-items:flex-start; gap:12px; margin:18px 0 0; color:var(--ink); font-size:13px; max-width:720px; }
.invite-note svg { flex-shrink:0; color:var(--brand); }
.auth-form button { background:var(--brand); border-color:var(--brand); color:#fff; font-weight:700; }
.auth-form button:hover { background:var(--brand-dark); }
.auth-form label { font-size:13px; font-weight:650; }
select, input:not([type=checkbox]):not([type=radio]):not([type=file]) { height:38px; }
input:disabled { background:#f3f5f3; }
a { color:var(--brand); }
td a { color:var(--ink); text-decoration:none; }
td a:hover { color:var(--brand); text-decoration:underline; }
a.button, .button { color:#fff; white-space:nowrap; flex-shrink:0; }
a.button:hover { background:var(--brand-dark); }
.panel-heading { gap:24px; }
.panel-heading p:not(.eyebrow) { margin:6px 0 0; max-width:720px; color:var(--muted); }
.panel-heading p small { font-size:13px; }
.dataset-description { margin:0 0 12px; color:var(--muted); }
#validation-rules-table td { padding:10px 8px; }
#validation-rules-table td:first-child, #validation-rules-table th:first-child { padding-left:22px; }
#validation-rules-table input:not([type=checkbox]), #validation-rules-table select { width:100%; min-width:90px; }
#validation-rules-table input[type=text] { min-width:140px; }
#version-list p, #ingestion-list > p { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:0; padding:12px 0; border-bottom:1px solid var(--line); font-size:14px; }
#version-list p:last-child, #ingestion-list > p:last-child { border-bottom:0; }
#version-list strong { padding:4px 8px; border-radius:999px; background:var(--accent); color:var(--brand-dark); font-size:11px; }
#diff p { margin:4px 0; font-size:13px; }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.help-button, .icon-button { display:inline-grid; place-items:center; width:34px; height:34px; padding:0; border:1px solid var(--line); border-radius:50%; background:#fff; color:var(--brand); vertical-align:middle; }
.help-button:hover, .icon-button:hover { border-color:var(--brand); background:var(--accent); }
.legend-with-help { display:flex; align-items:center; gap:8px; }
.legend-with-help .help-button { width:26px; height:26px; }
.legend-with-help .help-button svg { width:16px; height:16px; }
.help-dialog { width:min(960px, calc(100vw - 32px)); max-height:calc(100vh - 48px); padding:24px; border:0; border-radius:16px; color:var(--ink); box-shadow:0 24px 70px rgba(15,50,30,.25); }
.help-dialog::backdrop { background:rgba(13,40,26,.45); }
.help-dialog-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:18px; }

/* Card de filtros + card de resultados */
.filter-panel { padding:18px 22px 20px; overflow:visible; }
.filter-form { display:grid; gap:16px; }
.filter-header { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; }
.filter-title { display:flex; align-items:center; gap:10px; color:var(--brand); }
.filter-title h2 { color:var(--ink); font-size:15px; letter-spacing:-.01em; }
.filter-summary { padding:3px 9px; border-radius:999px; background:#edf1ee; color:var(--muted); font-size:11px; font-weight:650; }
.filter-summary.active { background:var(--accent); color:var(--brand-dark); }
.filter-clear { height:auto; padding:6px 10px; border:0; background:none; color:var(--brand); font-size:13px; font-weight:650; }
.filter-clear:hover:not(:disabled) { background:var(--accent); }
.filter-clear:disabled { color:var(--muted); opacity:.6; }
.filter-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:14px 16px; align-items:end; }
.filter-field { display:grid; gap:6px; min-width:0; color:var(--muted); font-size:12px; font-weight:650; }
.filter-field input, .filter-field select { width:100%; min-width:0; color:var(--ink); font-weight:400; }
.filter-wide { grid-column:span 2; }
.input-icon { position:relative; display:block; }
.input-icon svg { position:absolute; top:50%; left:11px; transform:translateY(-50%); color:var(--muted); pointer-events:none; }
.input-icon input { padding-left:34px; }
.filter-columns { padding:10px 14px 12px; }
.filter-columns legend { color:var(--muted); font-size:12px; }
.filter-actions { display:flex; justify-content:flex-end; gap:10px; padding-top:14px; border-top:1px solid var(--line); }
.count-badge { display:inline-block; margin-left:6px; padding:3px 9px; border-radius:999px; background:#edf1ee; color:var(--muted); font-size:12px; font-weight:650; letter-spacing:0; vertical-align:middle; }
.count-badge:empty { display:none; }
.pagination { margin:0; padding:14px 0 0; }
@media (max-width:640px) { .filter-wide { grid-column:auto; } }
.filter-grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media (max-width:900px) { .filter-grid-3 { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:560px) { .filter-grid-3 { grid-template-columns:1fr; } }
/* Seta própria em todos os dropdowns: afastada da borda e igual em todos os navegadores. */
select:not([multiple]) {
  appearance:none; -webkit-appearance:none;
  padding-right:2.4rem;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2368756d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right .8rem center; background-size:16px;
  text-overflow:ellipsis;
}
select:not([multiple]):disabled { background-color:#f3f5f3; }
#validation-rules-table select { min-width:120px; }
/* Filtros dinâmicos do Explorer */
.filter-rules { display:grid; gap:10px; padding:10px 14px 14px; }
.filter-rules legend { color:var(--muted); font-size:12px; }
.filter-rules legend .field-hint { font-weight:400; }
.filter-rows { display:grid; gap:8px; }
.filter-rows:empty { display:none; }
.filter-row { display:grid; grid-template-columns:28px minmax(140px,1.2fr) minmax(140px,1fr) minmax(140px,1.4fr) 38px; gap:8px; align-items:center; }
.filter-row select, .filter-row input { width:100%; min-width:0; }
.filter-connector { color:var(--muted); font-size:12px; font-weight:650; text-align:center; }
.filter-row:first-child .filter-connector { visibility:hidden; }
.filter-remove { width:38px; height:38px; border-radius:.4rem; color:var(--muted); }
.filter-remove:hover { color:#9f2d20; border-color:#f0c8c2; background:#fdf3f1; }
.filter-empty { margin:0; color:var(--muted); font-size:13px; }
.add-filter { justify-self:start; display:inline-flex; align-items:center; gap:6px; height:auto; padding:7px 12px; border:1px dashed var(--brand); border-radius:.4rem; background:#fff; color:var(--brand); font-size:13px; font-weight:650; }
.add-filter:hover:not(:disabled) { background:var(--accent); }
@media (max-width:760px) {
  .filter-row { grid-template-columns:1fr 1fr 38px; }
  .filter-connector { display:none; }
  .filter-row input { grid-column:1 / 3; }
}
.status-erro { background:#fbe7e4; color:#7a2318; }
.row-current { background:#f6fbf8; }
.row-current td:first-child { box-shadow:inset 3px 0 0 var(--brand); }
.status { text-transform:none; }
#version-table td:nth-child(5), #version-table td:nth-child(6) { white-space:nowrap; }
/* Aba Exportação */
.export-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; }
.export-card { display:flex; flex-direction:column; gap:12px; }
.export-card p { margin:0; font-size:13px; line-height:1.55; }
.export-card-head { display:flex; align-items:center; gap:12px; }
.export-card-head h2 { font-size:17px; }
.export-card-head small { color:var(--muted); font-size:12px; }
.export-icon { display:grid; place-items:center; width:44px; height:44px; flex-shrink:0; border-radius:10px; background:var(--accent); color:var(--brand-dark); font-size:12px; font-weight:800; letter-spacing:.02em; }
.export-use { color:var(--muted); }
.export-use strong { color:var(--ink); }
.export-actions { display:flex; justify-content:flex-end; align-items:center; gap:10px; margin-top:auto; padding-top:14px; border-top:1px solid var(--line); }
.copy-field { display:flex; align-items:center; gap:8px; }
.copy-field code { flex:1; min-width:0; padding:8px 10px; overflow-x:auto; white-space:nowrap; font-size:12px; }
.copy-field .icon-button { width:32px; height:32px; border-radius:.4rem; flex-shrink:0; }
.icon-button.copied { border-color:var(--brand); background:var(--accent); }
.connection-details { display:grid; grid-template-columns:max-content 1fr; gap:6px 12px; margin:0; font-size:13px; }
.connection-details dt { color:var(--muted); font-weight:650; }
.connection-details dd { margin:0; min-width:0; overflow-wrap:anywhere; }
.secret-box { display:grid; gap:8px; padding:12px; border:1px solid #f1d58a; border-radius:10px; background:#fdf8e6; font-size:12px; }
.secret-box, .secret-box > * { min-width:0; }
@media (max-width:1000px) { .export-grid { grid-template-columns:1fr; } }
.review-dialog { width:min(720px, calc(100vw - 32px)); }
.review-dialog .help-dialog-header p.field-hint { margin:6px 0 0; }
/* MFA dentro do fluxo (static/step-up.js) */
.step-up-inline { display:grid; gap:8px; padding:14px 16px; border:1px solid #f1d58a; border-radius:10px; background:#fdf8e6; }
.step-up-inline strong { font-size:14px; }
.step-up-inline p { margin:0; font-size:13px; color:var(--muted); }
.step-up-inline p.form-error { color:#9f2d20; }
.step-up-row { display:flex; gap:8px; flex-wrap:wrap; }
.step-up-row input { width:160px; font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:16px; letter-spacing:.18em; text-align:center; }
.page-step-up { margin:0 0 16px; }
.detail-list { display:grid; grid-template-columns:max-content 1fr; gap:6px 14px; margin:0; font-size:13px; }
.detail-list dt { color:var(--muted); font-weight:650; }
.detail-list dd { margin:0; overflow-wrap:anywhere; }
.warning-list { display:grid; gap:6px; margin:0; padding-left:18px; font-size:13px; }
.warning-list small { margin-left:8px; color:var(--muted); }
#ingestion-details pre { max-height:240px; overflow:auto; padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:#fafcf9; font-size:12px; }
#ingestion-details .form-actions { margin-top:18px; }
.success-step { display:grid; justify-items:center; gap:10px; padding:18px 12px 6px; text-align:center; }
.success-step h2 { font-size:22px; }
.success-step p { max-width:480px; margin:0; color:var(--muted); font-size:14px; line-height:1.5; }
.success-icon { display:grid; place-items:center; width:60px; height:60px; border-radius:50%; background:var(--accent); color:var(--brand); }
.success-actions { display:flex; gap:10px; margin-top:12px; }
.export-scope { display:grid; gap:12px; padding:18px 22px; }
.export-scope h2 { font-size:17px; }
.export-scope p { margin:0; font-size:14px; }
.export-choice { max-width:none; grid-template-columns:repeat(2,minmax(0,1fr)); }
.scope-details { display:grid; gap:2px; margin:4px 0 0; padding-left:16px; color:var(--ink); font-size:12px; }
.scope-details code { font-size:11px; }
@media (max-width:760px) { .export-choice { grid-template-columns:1fr; } }
.choice-card { align-content:start; }
/* Painel lateral do mapa: filtro por área e ponto selecionado */
.map-details { display:grid; align-content:start; gap:0; padding:0; }
.map-section { display:grid; gap:10px; padding:16px 18px; border-bottom:1px solid var(--line); }
.map-section:last-child { border-bottom:0; }
.map-section h3, .map-details .map-section h3:not(:first-child) { margin:0; font-size:15px; }
.map-section .field-hint { margin:0; }
.area-tools { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.area-tool { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:38px; background:#fff; border-color:var(--line); color:var(--ink); font-size:13px; font-weight:650; }
.area-tool svg { color:var(--brand); }
.area-tool:hover { border-color:var(--brand); }
.area-tool[aria-pressed="true"] { border-color:var(--brand); background:var(--accent); color:var(--brand-dark); box-shadow:inset 0 0 0 1px var(--brand); }
.area-summary { display:grid; gap:4px; padding:10px 12px; border:1px solid var(--brand); border-radius:10px; background:var(--accent); font-size:13px; }
.area-summary strong { color:var(--brand-dark); }
.area-summary-actions { display:flex; gap:4px; margin:2px -10px -4px; }
.radius-form { display:grid; gap:10px; margin-top:10px; }
.radius-form .form-row { gap:10px; }
.radius-actions { display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.map-details form { gap:10px; }
.map-details label.filter-field { font-size:12px; }
/* Propriedades do ponto empilhadas: nome numa linha, valor inteiro embaixo. */
.feature-properties.stacked { grid-template-columns:1fr; gap:0; }
.feature-properties.stacked dt { padding-top:8px; font-size:11px; font-weight:650; color:var(--muted); }
.feature-properties.stacked dd { padding-bottom:8px; border-bottom:1px solid var(--line); font-size:13px; color:var(--ink); }
.feature-properties.stacked dd:last-child { border-bottom:0; }
.map-details { overflow-x:hidden; }
.radius-form .form-row { grid-template-columns:repeat(2,minmax(0,1fr)); max-width:none; }
.radius-form input { min-width:0; }
.area-chip { display:flex; align-items:center; flex-wrap:wrap; gap:6px 10px; padding:8px 8px 8px 14px; border:1px solid var(--brand); border-radius:10px; background:var(--accent); color:var(--brand-dark); font-size:13px; }
.area-chip > svg { flex-shrink:0; color:var(--brand); }
.area-chip > span { margin-right:auto; }
.filter-row select, .filter-row input { font-size:13px; }
/* Painel Administração (feature flags) */
nav a.nav-admin { margin-top:8px; border:1px solid rgba(255,255,255,.22); }
.feature-groups { display:grid; gap:22px; }
.feature-group { display:grid; gap:0; }
.feature-group h3 { margin:0 0 6px; color:var(--muted); font-size:11px; letter-spacing:.08em; text-transform:uppercase; }
.feature-row { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:14px 0; border-top:1px solid var(--line); }
.feature-row.is-off .feature-text > p:first-of-type { color:var(--muted); }
.feature-text { display:grid; gap:4px; min-width:0; }
.feature-text p { margin:0; font-size:13px; }
.feature-title { display:flex; align-items:center; gap:10px; }
.feature-note { color:var(--muted); }
.feature-meta { color:var(--muted); font-size:11px; }
.switch { position:relative; flex-shrink:0; width:46px; height:26px; padding:0; border:0; border-radius:999px; background:#c9d3cc; transition:background .15s; }
.switch[aria-checked="true"] { background:var(--brand); }
.switch-thumb { position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:transform .15s; }
.switch[aria-checked="true"] .switch-thumb { transform:translateX(20px); }
.switch:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.feature-effects { display:grid; gap:6px; margin:0; padding-left:18px; font-size:13px; }
button.primary.danger { background:#9f2d20; border-color:#9f2d20; }
button.primary.danger:hover:not(:disabled) { background:#7a2318; }
.count-badge-warning { background:#fbe7e4; color:#7a2318; }
/* Organizações: etiquetas e seletor */
.org-chips { display:inline-flex; flex-wrap:wrap; gap:4px; vertical-align:middle; }
.org-chip { display:inline-block; padding:2px 8px; border:1px solid #c9dccf; border-radius:999px; background:#f2f8f4; color:var(--brand-dark); font-size:11px; font-weight:650; white-space:nowrap; }
.org-fieldset { min-width:0; margin:0; padding:0; border:0; }
.org-picker { max-width:none; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); }
.org-picker .choice-card input:disabled + strong { color:var(--muted); }
.dataset-organizations { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:-4px 0 12px; color:var(--muted); font-size:13px; }
.dataset-organizations .filter-clear { padding:2px 8px; }
.membership-list { display:grid; gap:2px; font-size:13px; }
.membership-organizations { display:grid; gap:12px; }
.membership-org { display:flex; flex-wrap:wrap; gap:6px 16px; padding:10px 14px 12px; }
.membership-org legend { font-size:13px; font-weight:650; }
.access-scope-note { margin:14px 0 0; }
/* Pastas e etiquetas */
.catalog-layout { display:grid; grid-template-columns:210px minmax(0,1fr); gap:18px; align-items:start; }
.folder-panel { padding:16px 12px; position:sticky; top:16px; }
.folder-panel .eyebrow { padding:0 10px; }
.folder-tree { list-style:none; margin:6px 0 0; padding:0; display:grid; gap:2px; }
.folder-item { width:100%; padding:7px 10px; border:0; border-radius:8px; background:none; color:var(--ink); font-size:13px; text-align:left; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.folder-item:hover { background:#f2f8f4; }
.folder-item.active { background:var(--accent); color:var(--brand-dark); font-weight:700; }
.folder-manage { display:block; margin:12px 10px 0; padding-top:12px; border-top:1px solid var(--line); color:var(--muted); font-size:12px; }
.tag-chips { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.tag-chip { display:inline-block; padding:2px 8px; border-radius:6px; background:#eef0fb; color:#33407a; font-size:11px; font-weight:650; white-space:nowrap; }
.tag-options { display:flex; flex-wrap:wrap; gap:8px; }
.tag-option { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border:1px solid var(--line); border-radius:8px; background:#fff; font-size:13px; font-weight:500; cursor:pointer; }
.tag-option input { width:auto; margin:0; padding:0; border:0; accent-color:var(--brand); }
.tag-option:has(input:checked) { border-color:#8b97d6; background:#eef0fb; }
@media (max-width:1000px) { .catalog-layout { grid-template-columns:1fr; }.folder-panel { position:static; } }
.dataset-organizations .tag-chips { margin-top:0; }
/* Auditoria legível */
.audit-action { min-width:240px; }
.audit-action small { max-width:360px; }
.audit-category { display:block; margin-bottom:3px; color:var(--brand); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
/* Celular (até 800px): barra superior compacta com menu recolhível (static/mobile.js) */
.sidebar-bar { display:contents; }
.nav-toggle, .nav-account, .filter-toggle { display:none; }
@media (max-width:800px) {
  body { display:block; }
  .sidebar { position:sticky; top:0; z-index:20; width:100%; height:auto; padding:10px 16px; }
  .sidebar-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; }
  .sidebar .brand { padding:0; font-size:18px; }
  .sidebar .brand-mark { width:28px; height:28px; }
  .nav-toggle { display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 14px; border:1px solid rgba(255,255,255,.28); border-radius:10px; background:rgba(255,255,255,.08); color:#fff; font-weight:650; }
  .sidebar.nav-open .nav-toggle { background:rgba(255,255,255,.18); }
  .sidebar nav { display:none; grid-template-columns:1fr; gap:2px; max-height:calc(100vh - 64px); overflow-y:auto; padding:10px 0 6px; }
  .sidebar.nav-open nav { display:grid; }
  .sidebar nav a, .sidebar .nav-disabled { display:flex; align-items:center; min-height:44px; font-size:15px; }
  nav a.nav-admin { margin-top:4px; }
  .nav-account { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:8px; padding:12px 12px 4px; border-top:1px solid rgba(255,255,255,.18); color:#d8e7de; font-size:14px; }
  .nav-account span { min-width:0; overflow-wrap:anywhere; }
  .nav-logout { flex-shrink:0; min-height:44px; padding:0 18px; border:1px solid rgba(255,255,255,.28); border-radius:10px; background:none; color:#fff; font-weight:650; }
  .sidebar:not(.nav-open) .sidebar-install { display:none; }
  .sidebar-install { margin-top:10px; min-height:44px; }
  main { padding:20px 16px 40px; }
  .topbar { margin-bottom:18px; }
  .topbar .account { display:none; }
  h1 { font-size:24px; overflow-wrap:anywhere; text-wrap:balance; }
  .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
  .metrics article { padding:14px; }
  .metrics strong { font-size:24px; }
  .panel { padding:16px; }
  .panel-heading { margin:-16px -16px 16px; padding:16px; flex-wrap:wrap; gap:12px; }
  .panel > table, .panel > .table-scroll, .panel > .empty { margin-left:-16px; margin-right:-16px; }
  .actions { flex-wrap:wrap; }
  th, td { padding:12px 14px; }
  /* Tabela de dados do explorer: uma linha por registro, rolando para o lado, em vez de colunas espremidas. */
  #data-table td { white-space:nowrap; max-width:240px; overflow:hidden; text-overflow:ellipsis; }
  .filter-panel { padding:14px 16px; }
  .filter-toggle { display:inline-flex; align-items:center; min-height:40px; height:auto; padding:0 14px; border:1px solid var(--line); border-radius:999px; background:#fff; color:var(--brand); font-size:13px; font-weight:650; }
  .filter-header { gap:10px; }
  .filter-title { flex:1 1 auto; min-width:0; flex-wrap:wrap; }
  .filter-form.collapsed { gap:0; }
  .filter-form.collapsed > :not(.filter-header):not(.area-chip) { display:none !important; }
  .filter-form.collapsed > .area-chip { margin-top:12px; }
  .filter-form.collapsed .filter-header .filter-clear { display:none; }
  /* Abaixo de 16px o Safari do iPhone dá zoom ao focar o campo. */
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea, .sql-editor, .filter-row select, .filter-row input { font-size:16px; }
  select, input:not([type=checkbox]):not([type=radio]):not([type=file]) { height:44px; }
  .form-actions { flex-wrap:wrap; }
  .dataset-organizations { gap:4px 8px; }
  /* Abas do explorer numa linha só, rolando para o lado. */
  .explorer-tabs { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; }
  .explorer-tabs::-webkit-scrollbar { display:none; }
  .explorer-tabs button { flex-shrink:0; white-space:nowrap; min-height:44px; }
}
/* Toque: alvos de pelo menos 44px onde o desenho permite */
@media (pointer:coarse) {
  .link-button, .filter-clear, .secondary-link, .back-link a { display:inline-flex; align-items:center; min-height:44px; }
  .help-button, .icon-button { width:44px; height:44px; }
  .legend-with-help .help-button { width:36px; height:36px; }
  .copy-field .icon-button { width:44px; height:44px; }
  input[type=checkbox], input[type=radio] { width:20px; height:20px; }
  .check-field, .column-options label, .tag-option { min-height:40px; }
  .area-tool, .filter-remove { height:44px; }
  .filter-remove { width:44px; }
  .switch::before { content:""; position:absolute; inset:-9px -4px; }
  .maplibregl-ctrl-group button { width:40px; height:40px; }
  .source-column { padding:8px 10px; font-size:13px; }
}
/* Nomes longos (colunas, relações) quebram em vez de alargar a tela */
.diff-items { min-width:0; }
.diff-items code { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.source-item summary strong, .source-item summary span { min-width:0; overflow-wrap:anywhere; }
.source-column { max-width:100%; white-space:normal; overflow-wrap:anywhere; text-align:left; }
/* Botão "Cancelar desenho" sobre o mapa enquanto uma área está sendo desenhada (static/map-renderer.js). */
/* Embaixo do mapa: no celular é o trecho à vista, logo acima das ferramentas que iniciaram o desenho. */
.map-draw-cancel { position:absolute; bottom:84px; left:50%; z-index:2; transform:translateX(-50%); min-height:44px; padding:0 16px; border:1px solid var(--brand); border-radius:999px; background:#fff; color:var(--brand-dark); font-weight:700; box-shadow:0 4px 14px rgba(15,50,30,.18); }
/* Textos que mudam com o jeito de usar: "Clique" com mouse, "Toque" em tela de toque. */
.on-touch { display:none; }
@media (pointer:coarse) { .on-mouse { display:none; } .on-touch { display:inline; } }
.auth-form button.link-button { justify-self:center; min-height:44px; padding:0 8px; border:0; background:none; color:var(--brand); font-size:14px; font-weight:650; }
.auth-form button.link-button:hover { background:none; color:var(--brand-dark); }
/* Visão geral com atividade (ADR 0004, static/activity.js) */
.metrics-strip { grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; }
.metrics-strip article { padding:14px 16px; }
.metrics-strip strong { font-size:24px; }
.overview { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:22px; align-items:start; }
.overview-feed { grid-column:1; grid-row:1; }
.overview-side { grid-column:2; grid-row:1; display:grid; gap:22px; min-width:0; }
.overview-card { padding:18px 18px 10px; }
.overview-card-head { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:8px 12px; margin-bottom:10px; }
.overview-card-head h2 { font-size:17px; }
.overview-card-head small { color:var(--muted); font-size:12px; }
.overview-list, .feed, .folder-cards { list-style:none; margin:0; padding:0; }
.feed-filter select { height:36px; font-size:13px; }
.activity-row { display:flex; align-items:center; gap:12px; min-height:52px; padding:10px 8px; margin:0 -8px; border-radius:10px; color:var(--ink); text-decoration:none; }
.activity-row:hover { background:#f2f8f4; }
.activity-row:focus-visible { outline:2px solid var(--brand); outline-offset:-2px; }
.activity-row.compact { min-height:44px; padding:8px; }
.feed li + li .activity-row { border-top:1px solid var(--line); border-radius:0; }
.activity-avatar { display:grid; place-items:center; flex-shrink:0; width:32px; height:32px; border-radius:50%; background:var(--accent); color:var(--brand-dark); font-size:12px; font-weight:750; object-fit:cover; }
.activity-icon { display:grid; place-items:center; flex-shrink:0; width:32px; height:32px; border-radius:9px; background:#f2f5f3; color:var(--brand); }
.activity-icon.kind-view { color:#6b4e00; background:#fdf3d8; }
.activity-icon.kind-visualization { color:#33407a; background:#eef0fb; }
.activity-icon.kind-folder { color:var(--brand-dark); background:var(--accent); }
.activity-icon.kind-file { color:#5b4b8a; background:#f1eefb; }
.activity-text { display:grid; gap:2px; flex:1; min-width:0; }
.activity-line { font-size:14px; line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.activity-line strong { font-weight:650; }
.activity-detail { color:var(--muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.activity-time { flex-shrink:0; color:var(--muted); font-size:12px; white-space:nowrap; }
.activity-text .progress { margin-top:6px; height:6px; }
.overview-empty { padding:14px 0; color:var(--muted); font-size:13px; }
.feed-news { display:block; width:100%; min-height:44px; margin:0 0 8px; border:1px solid var(--brand); border-radius:10px; background:var(--accent); color:var(--brand-dark); font-weight:700; }
.feed-more { display:flex; justify-content:center; padding:12px 0 4px; }
.feed-more button { min-height:44px; padding:0 22px; }
.folder-cards { display:grid; gap:8px; }
.folder-card { display:grid; grid-template-columns:auto 1fr; column-gap:10px; row-gap:2px; padding:12px; border:1px solid var(--line); border-radius:12px; color:var(--ink); text-decoration:none; }
.folder-card:hover { border-color:var(--brand); background:#f6fbf8; }
.folder-card .activity-icon { grid-row:span 4; }
.folder-card-name { font-size:14px; overflow-wrap:anywhere; }
.folder-card-meta { color:var(--muted); font-size:12px; }
.folder-card-people { display:flex; margin-top:4px; }
.folder-card-people .activity-avatar { width:26px; height:26px; margin-right:-6px; border:2px solid var(--panel); font-size:10px; }
/* Espaço reservado enquanto carrega: a página não pula quando os dados chegam. */
ul[aria-busy="true"]:empty { min-height:120px; border-radius:10px; background:linear-gradient(90deg,#eef2ef 0,#f6f8f6 40%,#eef2ef 80%) 0 0/200% 100%; animation:skeleton 1.4s linear infinite; }
@keyframes skeleton { to { background-position:-200% 0; } }
@media (prefers-reduced-motion:reduce) { ul[aria-busy="true"]:empty { animation:none; } }
@media (max-width:1000px) {
  .overview { grid-template-columns:1fr; }
  .overview-feed, .overview-side { grid-column:auto; grid-row:auto; }
}
@media (max-width:800px) {
  /* Contadores viram chips numa linha que rola para o lado. */
  .metrics-strip { display:flex; gap:8px; overflow-x:auto; margin:0 -16px 16px; padding:0 16px 4px; scrollbar-width:none; }
  .metrics-strip::-webkit-scrollbar { display:none; }
  .metrics-strip article { flex:0 0 auto; display:flex; align-items:baseline; gap:8px; padding:8px 14px; border-radius:999px; }
  .metrics-strip strong { font-size:18px; order:-1; }
  .overview-side { gap:16px; }
  /* No celular o nome de quem fez já está no texto: o avatar sai e o texto ganha espaço. */
  .feed .activity-avatar { display:none; }
  .activity-line { -webkit-line-clamp:3; }
  /* Pastas em movimento: cards lado a lado, rolando para o lado. */
  .folder-cards { display:flex; gap:10px; overflow-x:auto; margin:0 -18px; padding:0 18px 8px; scroll-snap-type:x mandatory; scrollbar-width:none; }
  .folder-cards::-webkit-scrollbar { display:none; }
  .folder-cards li { flex:0 0 78%; scroll-snap-align:start; }
  .folder-cards .overview-empty { flex-basis:100%; }
}
/* Painel Administração: configurações */
.settings-list { display:grid; }
.setting-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:10px 16px; padding:14px 0; border-top:1px solid var(--line); }
.setting-row .form-error, .setting-row > div:not(.feature-text) { grid-column:1 / -1; }
.setting-field { display:flex; align-items:center; gap:8px; }
.setting-field input { width:120px; }
.setting-unit { color:var(--muted); font-size:13px; }
@media (max-width:640px) { .setting-row { grid-template-columns:1fr auto; } .setting-row .feature-text { grid-column:1 / -1; } }
/* Arquivos (ADR 0001): navegador de pastas em lista ou grade (static/files.js) */
.files-page { display:grid; grid-template-columns:230px minmax(0,1fr); gap:18px; align-items:start; }
.files-tree { padding:16px 12px; position:sticky; top:16px; max-height:calc(100vh - 32px); overflow:auto; }
.files-tree .eyebrow { padding:0 10px; }
.files-main { position:relative; min-width:0; }
.files-main.dragging { outline:2px dashed var(--brand); outline-offset:-6px; background:#f6fbf8; }
.files-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px 16px; margin-bottom:14px; }
.files-location { display:flex; align-items:center; gap:10px; min-width:0; flex:1 1 auto; }
.files-tree-toggle { display:none; }
.breadcrumbs { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; min-width:0; font-size:15px; }
.breadcrumbs a { color:var(--muted); text-decoration:none; }
.breadcrumbs a:hover { color:var(--brand); text-decoration:underline; }
.crumb-current { font-weight:700; overflow-wrap:anywhere; }
.crumb-separator { color:#b8c3bc; }
.files-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.upload-button { display:inline-flex; align-items:center; gap:8px; cursor:pointer; }
.upload-folder { display:inline-flex; align-items:center; min-height:38px; padding:0 12px; border:1px solid #cbd5e1; border-radius:.4rem; background:#edf5f2; color:#174d40; font-size:14px; cursor:pointer; }
.upload-folder:focus-within, .upload-button:focus-within { outline:2px solid var(--brand); outline-offset:2px; }
.danger-link { border:0; background:none; color:#9f2d20; font-weight:650; }
.files-filters { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:12px; }
.files-search { flex:1 1 240px; }
.files-search input { width:100%; }
.view-toggle { display:inline-flex; border:1px solid #cbd5e1; border-radius:.4rem; overflow:hidden; }
.view-toggle button { display:inline-flex; align-items:center; gap:6px; height:38px; border:0; border-radius:0; background:#fff; color:var(--muted); font-size:13px; }
.view-toggle button[aria-pressed="true"] { background:var(--accent); color:var(--brand-dark); font-weight:700; }
.files-content.files-list { display:grid; }
.file-row { display:flex; align-items:center; gap:8px; border-top:1px solid var(--line); }
.file-row:first-child { border-top:0; }
.file-open { display:flex; align-items:center; gap:12px; flex:1; min-width:0; min-height:56px; padding:8px 8px 8px 4px; color:var(--ink); text-decoration:none; border-radius:10px; }
.file-open:hover { background:#f2f8f4; }
.file-open:focus-visible { outline:2px solid var(--brand); outline-offset:-2px; }
.file-icon { display:grid; place-items:center; flex-shrink:0; width:38px; height:38px; border-radius:10px; background:#f2f5f3; color:var(--brand); }
.file-icon.kind-folder { background:var(--accent); color:var(--brand-dark); }
.file-icon.kind-view, .file-icon.kind-planilha { background:#fdf3d8; color:#6b4e00; }
.file-icon.kind-pdf, .file-icon.kind-apresentacao { background:#fbe7e4; color:#9f2d20; }
.file-icon.kind-imagem, .file-icon.kind-video { background:#eef0fb; color:#33407a; }
.file-icon.kind-documento { background:#e8f1fb; color:#1f5aa6; }
.file-text { display:grid; gap:2px; flex:1; min-width:0; }
.file-name { font-size:14px; font-weight:650; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-detail, .file-meta { color:var(--muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-meta { flex-shrink:0; max-width:40%; text-align:right; }
.files-content.files-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; }
.file-card { position:relative; border:1px solid var(--line); border-radius:12px; background:#fff; }
.file-card:hover { border-color:var(--brand); }
.file-card .file-open { flex-direction:column; align-items:stretch; gap:8px; min-height:0; padding:12px; }
.file-card .file-icon { width:100%; height:96px; border-radius:8px; }
.file-card .file-icon svg { width:36px; height:36px; }
.file-card .file-thumb { width:100%; height:96px; object-fit:cover; border-radius:8px; background:#f2f5f3; }
.file-card .file-meta { display:none; }
.file-card .item-menu { position:absolute; top:6px; right:6px; }
.item-menu { position:relative; flex-shrink:0; }
.item-menu summary { display:grid; place-items:center; width:36px; height:36px; border-radius:50%; list-style:none; cursor:pointer; color:var(--muted); font-size:20px; line-height:1; }
.item-menu summary::-webkit-details-marker { display:none; }
.item-menu summary:hover, .item-menu[open] summary { background:#edf1ee; color:var(--ink); }
.item-menu-list { position:absolute; right:0; top:calc(100% + 4px); z-index:5; display:grid; min-width:200px; padding:6px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 12px 30px rgba(15,50,30,.16); }
.item-menu-list button { justify-content:flex-start; height:auto; min-height:40px; padding:8px 12px; border:0; border-radius:8px; background:none; color:var(--ink); text-align:left; }
.item-menu-list button:hover { background:#f2f8f4; }
.item-menu-list .danger-link { color:#9f2d20; }
.drop-hint { margin:14px 0 0; color:var(--muted); font-size:12px; text-align:center; }
.tree-dialog { width:min(480px, calc(100vw - 24px)); }
.upload-queue { position:fixed; right:20px; bottom:20px; z-index:30; width:min(380px, calc(100vw - 32px)); max-height:min(60vh, 520px); display:grid; grid-template-rows:auto 1fr; border:1px solid var(--line); border-radius:14px; background:#fff; box-shadow:0 18px 50px rgba(15,50,30,.22); }
.upload-queue-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px 10px 16px; border-bottom:1px solid var(--line); }
.upload-list { list-style:none; margin:0; padding:4px 12px 8px; overflow:auto; }
.upload-item { display:grid; gap:6px; padding:10px 4px; border-top:1px solid var(--line); }
.upload-item:first-child { border-top:0; }
.upload-text { display:grid; gap:4px; min-width:0; }
.upload-text strong { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.upload-status { color:var(--muted); font-size:12px; }
.upload-item[data-state="erro"] .upload-status { color:#9f2d20; }
.upload-item[data-state="concluido"] .progress span { background:var(--brand-dark); }
.upload-actions { display:flex; flex-wrap:wrap; gap:6px; }
.upload-actions button { height:auto; min-height:32px; padding:4px 10px; font-size:12px; }
.file-summary-head { display:flex; align-items:flex-start; gap:14px; }
.file-summary-head .file-icon { width:52px; height:52px; }
.file-summary-text { min-width:0; }
.file-summary-text h2 { overflow-wrap:anywhere; }
.file-buttons { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:16px 0; }
.file-buttons .button { display:inline-flex; align-items:center; min-height:38px; }
.file-preview { margin:0 0 16px; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#f6f8f6; }
@media (max-width:1000px) {
  .files-page { grid-template-columns:1fr; }
  .files-tree { display:none; }
  .files-tree-toggle { display:inline-flex; align-items:center; gap:6px; flex-shrink:0; min-height:40px; }
}
@media (max-width:800px) {
  .files-toolbar { align-items:flex-start; }
  .files-actions { width:100%; }
  .files-actions .upload-button { flex:1 1 auto; justify-content:center; min-height:44px; }
  .file-meta { display:none; }
  .files-content.files-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .view-toggle span { display:none; }
  .upload-queue { right:0; left:0; bottom:0; width:100%; max-height:50vh; border-radius:14px 14px 0 0; padding-bottom:env(safe-area-inset-bottom, 0px); }
}
@media (pointer:coarse) {
  .item-menu summary { width:44px; height:44px; }
  .item-menu-list button { min-height:44px; }
  .upload-actions button { min-height:40px; }
}
@media (pointer:coarse) { .upload-folder.on-mouse { display:none; } }
.upload-queue.collapsed { grid-template-rows:auto; }
.upload-queue.collapsed .upload-list { display:none; }
.upload-queue.collapsed .upload-queue-head { border-bottom:0; }
#upload-summary { cursor:pointer; }
/* Pré-visualização na página do arquivo (static/preview.js) */
.preview-body { padding:12px; }
.preview-image { display:block; max-width:100%; max-height:75vh; margin:0 auto; border-radius:8px; }
.preview-media { display:block; width:100%; max-height:75vh; background:#000; border-radius:8px; }
audio.preview-media { background:none; }
.preview-text { max-height:65vh; overflow:auto; margin:0; padding:12px; border-radius:8px; background:#fff; font:13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
.preview-pages { display:grid; justify-items:center; gap:12px; }
.preview-page { max-width:100%; height:auto; background:#fff; box-shadow:0 2px 10px rgba(15,50,30,.12); }
.preview-body > button { display:block; margin:12px auto 0; }
.preview-map { width:100%; height:min(65vh, 560px); border-radius:8px; overflow:hidden; }
.preview-body .table-scroll { max-height:65vh; background:#fff; border-radius:8px; }
.file-preview.fullscreen { position:fixed; inset:0; z-index:50; margin:0; border:0; border-radius:0; display:grid; grid-template-rows:auto 1fr; background:#f6f8f6; padding-top:env(safe-area-inset-top, 0px); padding-bottom:env(safe-area-inset-bottom, 0px); }
.file-preview.fullscreen .preview-body { overflow:auto; }
.file-preview.fullscreen .preview-image, .file-preview.fullscreen .preview-media { max-height:none; }
.file-preview.fullscreen .preview-map { height:calc(100vh - 120px); }
.preview-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 16px; background:var(--brand-dark); color:#fff; }
.preview-bar strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.preview-bar button { flex-shrink:0; min-height:44px; padding:0 18px; border:1px solid rgba(255,255,255,.4); background:none; color:#fff; font-weight:650; }
.account-name { color:var(--ink); text-decoration:none; }
.account-name:hover { color:var(--brand); text-decoration:underline; }
.nav-account a { color:#fff; text-decoration:none; min-width:0; overflow-wrap:anywhere; }
/* Administração: armazenamento e cota (ADR 0006) */
.storage-summary { display:grid; gap:8px; margin-bottom:18px; }
.storage-summary strong { font-size:20px; font-weight:600; }
.storage-summary .progress { height:12px; }
.storage-summary.is-warning .progress span { background:#c98a12; }
.storage-summary.is-full .progress span { background:#b3261e; }
.storage-columns { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr)); gap:8px 32px; }
.storage-subtitle { margin:18px 0 8px; font-size:13px; font-weight:650; }
.storage-subtitle small { color:var(--muted); font-weight:400; }
.storage-parts { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 16px; margin:0; font-size:13px; }
.storage-parts dt { min-width:0; color:var(--muted); }
.storage-parts dt small { display:block; font-size:11px; }
.storage-parts dd { margin:0; font-variant-numeric:tabular-nums; text-align:right; }
.storage-parts .is-total { padding-top:6px; border-top:1px solid var(--line); color:var(--ink, inherit); font-weight:650; }
