/* Busca777 — tokens globais, componentes básicos e layout. */
:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  --bg: #100c1b;
  --sidebar: #161022;
  --surface: #1d162b;
  --surface-2: #291f3b;
  --field: #150f21;
  --border: #745e8a;
  --text: #f7f2ff;
  --muted: #c9bedb;
  --subtle: #b2a3c8;
  --accent: #c6a8ff;
  --accent-strong: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: #34224e;
  --success: #a0e4c0;
  --danger: #ffb0c0;
  --danger-strong: #9e284f;
  --danger-hover: #b12d58;
  --warning: #f4cf8d;
  --focus: #dbbfff;
  --shadow: 0 16px 44px #07041040;
  --shadow-dialog: 0 26px 90px #07041088;
  --scrim: #090412b8;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --motion: 180ms;
}
.light-theme {
  color-scheme: light;
  --bg: #f7f4fc;
  --sidebar: #fefcff;
  --surface: #ffffff;
  --surface-2: #f0eaf8;
  --field: #fffdff;
  --border: #9a86ae;
  --text: #241335;
  --muted: #59446e;
  --subtle: #6b557f;
  --accent: #6830b5;
  --accent-strong: #6d28d9;
  --accent-hover: #5920b5;
  --accent-soft: #ece0ff;
  --success: #166342;
  --danger: #a52648;
  --warning: #815200;
  --focus: #6d28d9;
  --shadow: 0 16px 44px #44226613;
  --shadow-dialog: 0 26px 90px #30144244;
  --scrim: #2010318c;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 0; overflow: hidden; background: radial-gradient(ellipse at 80% 0%, color-mix(in srgb, var(--accent-strong) 13%, transparent), transparent 55%), var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden], .hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 40; top: -70px; left: 15px; padding: 10px var(--space-4); border-radius: 8px; background: var(--accent-strong); color: white; font-weight: 700; }
.skip-link:focus { top: 12px; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; width: 252px; padding: 26px 18px 20px; background: var(--sidebar); border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 13px; margin: 0 var(--space-2) 42px; color: var(--text); font-size: 20px; font-weight: 750; text-decoration: none; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: var(--radius-md); background: linear-gradient(145deg, var(--accent-strong), var(--accent-hover)); box-shadow: 0 7px 24px color-mix(in srgb, var(--accent-strong) 30%, transparent); color: white; font-size: 24px; }
.brand-accent { color: var(--accent); }
.brand small { display: block; margin-top: -3px; color: var(--subtle); font-size: 11px; letter-spacing: .1em; font-weight: 650; }
.nav-label, .eyebrow { color: var(--subtle); font-size: 12px; font-weight: 750; letter-spacing: .11em; }
.nav-label { padding: 0 var(--space-4) 13px; }
.sidebar nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 48px; padding: 10px 15px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--muted); text-align: left; font-size: 15px; font-weight: 550; transition: background-color var(--motion) ease, color var(--motion) ease; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.nav-group { display: grid; gap: 3px; }
.nav-group-toggle { justify-content: flex-start; }
.nav-group-toggle > span:nth-of-type(1) { flex: 1; }
.nav-group-chevron { margin-left: auto; color: var(--subtle); transition: transform var(--motion) ease; }
.nav-group-toggle[aria-expanded="false"] .nav-group-chevron { transform: rotate(-90deg); }
.nav-subnav { display: grid; gap: 2px; margin: 0 0 3px 37px; padding-left: 12px; border-left: 1px solid var(--border); }
.nav-subitem { min-height: 38px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; font-size: 13px; font-weight: 550; }
.nav-subitem:hover { background: var(--surface-2); color: var(--text); }
.nav-subitem.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-icon { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; color: inherit; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-bottom { margin-top: auto; padding: 20px 10px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.sidebar-bottom p { margin: 6px 0 0; font-size: 12px; color: var(--subtle); }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--success); }
.version { float: right; color: var(--subtle); font-size: 12px; }

.main { display: flex; flex-direction: column; width: calc(100% - 252px); min-width: 0; height: 100dvh; margin-left: 252px; padding: 0 clamp(var(--space-5), 3vw, 48px); overflow: hidden; }
.workspace-scroll { flex: 1; min-height: 0; padding: var(--space-5) 3px var(--space-6); overflow: auto; scrollbar-gutter: stable; scroll-padding: var(--space-5); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 88px; flex: none; margin-bottom: 0; border-bottom: 1px solid var(--border); }
.page-title { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 22px; font-weight: 720; letter-spacing: -.025em; }
.top-actions { display: flex; flex: none; align-items: center; gap: var(--space-3); }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 23px; }
.icon-button:hover { background: var(--surface-2); }
.button, .tiny-action, .page-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 14px; font-weight: 650; line-height: 1.3; text-align: center; text-decoration: none; transition: transform var(--motion) ease, background-color var(--motion) ease, border-color var(--motion) ease, box-shadow var(--motion) ease; }
.button:not(:disabled):hover, .tiny-action:not(:disabled):hover, .page-button:not(:disabled):hover { transform: translateY(-1px); }
.button-primary { background: linear-gradient(135deg, var(--accent-strong), var(--accent-hover)); color: #fff; box-shadow: 0 4px 16px color-mix(in srgb, var(--accent-strong) 22%, transparent); }
.button-primary:not(:disabled):hover { background: var(--accent-hover); box-shadow: 0 6px 22px color-mix(in srgb, var(--accent-strong) 34%, transparent); }
.button-secondary, .tiny-action, .page-button { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.button-secondary:hover, .tiny-action:hover, .page-button:hover { border-color: var(--accent); }
.button-small { min-height: 40px; padding: var(--space-2) 13px; font-size: 13px; }
.text-button { min-height: 38px; padding: 5px var(--space-2); border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 650; }
.text-button:hover { text-decoration: underline; }
.page { display: none; }
.page.active { display: block; animation: page-enter .22s ease-out; }
@keyframes page-enter { from { opacity: .4; } to { opacity: 1; } }
.panel, .metric-card { border: 1px solid color-mix(in srgb, var(--border) 68%, var(--surface)); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.panel { padding: var(--space-5); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: 17px; }
.panel-heading h2, .settings-card h2, .national-panel h2, .filter-heading h2 { margin: 0 0 var(--space-1); font-size: 20px; line-height: 1.3; letter-spacing: -.025em; }
.panel-heading p, .settings-card p, .national-panel p, .filter-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.company-sub, .muted, .metric-caption, .privacy-note { color: var(--muted); font-size: 14px; }
.notification-stack { display: grid; flex: none; gap: var(--space-2); max-height: min(22dvh, 170px); overflow: auto; scrollbar-gutter: stable; }
.notification-stack:not(:empty) { margin-top: var(--space-2); padding: 3px; }
.notice { display: grid; grid-template-columns: 30px minmax(0, 1fr) 44px; align-items: start; gap: 11px; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); box-shadow: var(--shadow); font-size: 14px; pointer-events: auto; animation: notice-enter .18s ease-out; }
.notice-mark { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: var(--accent); font-weight: 800; }
.notice-content { display: grid; gap: 2px; min-width: 0; }
.notice-title { color: var(--text); font-size: 13px; }
.notice-text { color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.notice-close { width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 21px; line-height: 1; }
.notice-close:hover { background: var(--surface); color: var(--text); }
.notice.error { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }
.notice.error .notice-mark { background: color-mix(in srgb, var(--danger) 15%, var(--surface)); color: var(--danger); }
.notice.success { border-color: color-mix(in srgb, var(--success) 50%, var(--border)); }
.notice.success .notice-mark { background: color-mix(in srgb, var(--success) 15%, var(--surface)); color: var(--success); }
.notice.warning { border-color: var(--warning); }
.notice.warning .notice-mark { color: var(--warning); }
.notice.info { border-color: color-mix(in srgb, var(--accent) 48%, var(--border)); }
.notice.info .notice-mark, .notice.progress .notice-mark { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent); }
.notice.progress { border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); }
.notice.error .notice-title { color: var(--danger); }
.notice.success .notice-title { color: var(--success); }
.notice.warning .notice-title { color: var(--warning); }
@keyframes notice-enter { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.app-confirm-dialog { width: min(480px, calc(100vw - 28px)); max-height: min(90dvh, 720px); padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-dialog); }
.app-confirm-dialog::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
.app-confirm-dialog .dialog-head { margin-bottom: var(--space-3); }
.app-confirm-dialog .dialog-head h2 { margin: 0; font-size: 20px; }
.confirm-message { margin: 0 0 22px; color: var(--muted); line-height: 1.6; }
.app-confirm-dialog .dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.button-danger { background: var(--danger-strong); color: #fff; }
.button-danger:not(:disabled):hover { background: var(--danger-hover); }
.vpn-operation-message { min-height: 1.5em; padding: 10px var(--space-3); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--surface-2); line-height: 1.5; }
.vpn-operation-message.error { border-left-color: var(--danger); color: var(--danger); }
.vpn-operation-message.pending { border-left-color: var(--accent); color: var(--text); }
.vpn-operation-message.success { border-left-color: var(--success); color: var(--success); }
.badge { display: inline-flex; align-items: center; max-width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.35; white-space: normal; }
.badge.success { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); color: var(--success); }
.badge.fail { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); color: var(--danger); }

.welcome { display: flex; align-items: center; min-height: 210px; margin-bottom: 18px; padding: clamp(26px, 3vw, 40px); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: var(--radius-lg); background: linear-gradient(115deg, var(--accent-soft), var(--surface) 75%); }
.welcome h1 { max-width: 700px; margin: 9px 0; font-size: clamp(28px, 3vw, 43px); line-height: 1.12; letter-spacing: -.045em; }
.welcome p { max-width: 620px; margin: 0 0 20px; color: var(--muted); font-size: 16px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin-bottom: 18px; }
.metric-card { position: relative; min-height: 154px; padding: var(--space-5); overflow: hidden; }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 15px; font-weight: 600; }
.metric-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); color: var(--accent); font-size: 19px; }
.metric-icon.green { color: var(--success); }
.metric-value { font-variant-numeric: tabular-nums; margin: 10px 0 1px; font-size: clamp(30px, 3vw, 40px); font-weight: 760; line-height: 1.15; letter-spacing: -.04em; }
.completeness-panel { margin-bottom: 18px; }
.completeness-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 15px 0; }
.completeness-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); font-size: 14px; }
.completeness-item strong { color: var(--text); font-size: 18px; white-space: nowrap; }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; margin-bottom: 18px; }
.recent-list { display: grid; }
.recent-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--border); }
.recent-row:first-child { border-top: 0; }
.recent-name { font-size: 15px; font-weight: 650; }
.recent-meta { margin-top: 3px; color: var(--muted); font-size: 13px; }
.category-list { display: grid; gap: 9px; }
.category-item { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; align-items: center; gap: var(--space-3); color: var(--muted); font-size: 14px; }
.category-item b { color: var(--text); font-variant-numeric: tabular-nums; }
.category-bar { height: 7px; overflow: hidden; border-radius: 7px; background: var(--surface-2); }
.category-bar i { display: block; height: 100%; border-radius: 7px; background: var(--accent-strong); }
.national-panel { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 18px; }
.national-status { display: grid; gap: 5px; margin-top: 15px; color: var(--muted); font-size: 14px; }
.national-status strong { color: var(--text); }
.error-text { color: var(--danger); }
.source-callout { display: flex; align-items: center; gap: 15px; padding: 18px 22px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.source-callout p { margin: var(--space-1) 0 0; color: var(--muted); font-size: 14px; }
.source-callout strong { font-size: 16px; }
.source-callout .button { margin-left: auto; flex: none; }
.callout-mark { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 750; }

.section-intro { margin: 5px 0 22px; }
.section-intro h1 { margin: 5px 0 5px; font-size: clamp(27px, 2.5vw, 35px); letter-spacing: -.035em; line-height: 1.2; }
.section-intro p { max-width: 690px; margin: 0; color: var(--muted); font-size: 15px; }
.row-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.search-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: 18px; align-items: start; }
.search-form { padding: clamp(20px, 3vw, 34px); }
.form-section-title { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 22px; }
.form-section-title h2 { margin: 0 0 3px; font-size: 20px; }
.form-section-title p { margin: 0; color: var(--muted); font-size: 14px; }
.step { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 750; }
.form-grid, .advanced-grid, .filter-primary, .filter-bottom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.field { display: grid; align-content: start; gap: 7px; min-width: 0; color: var(--text); font-size: 14px; font-weight: 620; }
.field-wide { grid-column: 1 / -1; }
.proxy-toggle { display: flex; align-items: center; gap: 10px; margin: var(--space-1) 0 18px; color: var(--text); font-weight: 650; }
.proxy-toggle input, .proxy-source-options input { width: auto; margin: 0; accent-color: var(--accent); }
.proxy-source-options { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); margin: 18px 0; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); }
.proxy-source-options legend { padding: 0 6px; color: var(--text); font-weight: 650; }
.proxy-source-options label { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--muted); }
.proxy-http-connect-warning { padding: 10px var(--space-3); border-left: 3px solid var(--warning); border-radius: 6px; background: color-mix(in srgb, var(--warning) 9%, var(--surface)); color: var(--text); }

.field input, .field select, .field textarea, .oab-form input, .oab-form select, .oab-form textarea { width: 100%; min-width: 0; min-height: 46px; padding: 10px var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--field); color: var(--text); font-size: 15px; font-weight: 400; outline: none; transition: border-color var(--motion) ease, box-shadow var(--motion) ease; }
.field input::placeholder, .oab-form input::placeholder { color: var(--subtle); opacity: 1; }
.field input:focus, .field select:focus, .oab-form input:focus, .oab-form select:focus, .oab-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.optional { color: var(--muted); font-weight: 450; }
.search-advanced, .advanced-filters { margin-top: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.search-advanced summary, .advanced-filters summary { display: flex; align-items: center; gap: 10px; padding: 15px 17px; color: var(--text); font-size: 15px; font-weight: 680; cursor: pointer; list-style: none; }
.search-advanced summary::-webkit-details-marker, .advanced-filters summary::-webkit-details-marker { display: none; }
.search-advanced summary::before, .advanced-filters summary::before { content: '＋'; color: var(--accent); font-size: 20px; line-height: 1; }
.search-advanced[open] summary::before, .advanced-filters[open] summary::before { content: '−'; }
.search-advanced summary span, .advanced-filters summary span { color: var(--muted); font-size: 13px; font-weight: 450; }
.search-advanced .advanced-grid, .advanced-filters .advanced-grid { padding: 0 17px 18px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--border); }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.search-aside { padding: 23px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.search-aside h3 { margin: 0 0 7px; font-size: 18px; }
.search-aside p { margin: 0 0 17px; color: var(--muted); font-size: 14px; }
.result-feedback { margin-top: 18px; }
.result-feedback h3 { margin: 7px 0 3px; font-size: 19px; }
.result-feedback p { margin: 0; color: var(--muted); font-size: 14px; }
.loading-line { color: var(--muted); font-size: 15px; }
.spinner { display: inline-block; width: 15px; height: 15px; margin-right: 7px; vertical-align: -2px; border: 2px solid #ffffff77; border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.filter-panel { margin-bottom: var(--space-4); }
.filter-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); margin-bottom: 18px; }
.filter-primary { grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr)); }
.filter-bottom { grid-template-columns: minmax(180px, 2fr) minmax(170px, 1fr); margin-top: 18px; }
.advanced-filters { margin-top: 17px; }
.selection-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 15px; margin: 0 0 14px; }
.selection-bar strong { font-size: 19px; }
#active-filter-summary { max-width: 340px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
#selected-count { margin-left: auto; color: var(--muted); font-size: 14px; }
.table-panel { padding: 0; overflow: hidden; }
.table-scroll { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 14px 15px; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
td { padding: var(--space-4) 15px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 14px; line-height: 1.45; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.results-table { min-width: 1050px; table-layout: fixed; }
.results-table th:first-child, .results-table td:first-child { width: 44px; padding-left: 17px; padding-right: 0; }
.results-table th:nth-child(2) { width: 260px; }
.results-table th:nth-child(3) { width: 130px; }
.results-table th:nth-child(4) { width: 190px; }
.results-table th:nth-child(5) { width: 160px; }
.results-table th:nth-child(6) { width: 105px; }
.results-table th:last-child { width: 160px; }
.results-table td { overflow-wrap: anywhere; }
.results-table th:last-child, .results-table td:last-child { position: sticky; right: 0; z-index: 1; border-left: 1px solid var(--border); background: var(--surface); }
.results-table th:last-child { z-index: 2; background: var(--surface-2); }
.company-cell { display: flex; align-items: center; gap: 11px; }
.company-avatar { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-size: 16px; font-weight: 750; }
.company-name { font-size: 15px; font-weight: 700; line-height: 1.35; }
.category-cell { color: var(--muted); }
.contact-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.contact-tag { display: inline-flex; padding: 3px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; }
.row-actions { display: grid; justify-items: start; gap: 6px; }
.tiny-action { min-height: 34px; padding: 6px 9px; font-size: 12px; }
.action-primary { border-color: var(--accent); color: var(--accent); }
.empty-state { padding: 35px !important; color: var(--muted); text-align: center; font-size: 15px; }
.import-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 18px 20px; border: 1px dashed var(--border); border-radius: var(--radius-md); }
.import-row strong, .import-row span { display: block; }
.import-row strong { font-size: 15px; }
.import-row span { margin-top: 3px; color: var(--muted); font-size: 14px; }
.file-button { position: relative; overflow: hidden; flex: none; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.settings-card { display: flex; gap: 17px; min-height: 155px; }
.settings-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-size: 20px; }
.settings-card a { font-size: 14px; }
.settings-card code, dialog code { padding: 3px 5px; border-radius: 4px; background: var(--surface-2); color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.route-settings-card { align-items: stretch; }
.route-settings-card > div { width: 100%; }
.route-settings-list { display: grid; gap: 10px; margin-top: 16px; }
.route-setting-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.2fr) minmax(180px, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.route-setting-row select { width: 100%; min-width: 0; }
.route-setting-state { color: var(--muted); font-size: 13px; }
@media (max-width: 760px) { .route-setting-row { grid-template-columns: 1fr; gap: 8px; } }
.theme-options { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 15px; font-size: 14px; }
.theme-options label { display: flex; align-items: center; gap: 7px; }
.hidden-records-panel { margin-top: 18px; }
.users-access-note { margin: 0 0 var(--space-4); padding: 13px 16px; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-md); background: var(--surface); color: var(--muted); font-size: 14px; line-height: 1.5; }
.users-access-note strong { color: var(--text); }
.user-metrics { margin-bottom: var(--space-4); }
.users-filters { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, .45fr) auto; align-items: end; gap: var(--space-3); }
.users-feedback { min-height: 25px; margin: var(--space-3) 0; color: var(--muted); font-size: 14px; }
.admin-users-table { min-width: 880px; }
.admin-users-table td { vertical-align: middle; }
.admin-users-table td:first-child { font-weight: 650; }
#admin-user-dialog, #admin-user-history-dialog { width: min(620px, calc(100vw - 24px)); max-height: min(88dvh, 760px); padding: var(--space-5); overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-dialog); }
#admin-user-dialog::backdrop, #admin-user-history-dialog::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
#admin-user-dialog form { display: grid; gap: var(--space-3); }
.users-form-error { min-height: 1.2em; color: var(--danger); font-size: 14px; }
.admin-user-history { display: grid; gap: var(--space-2); }
.admin-user-history-item { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.admin-user-history-item time, .admin-user-history-item p, .admin-user-history-item small { color: var(--muted); font-size: 13px; }
.admin-user-history-item p, .admin-user-history-item small { grid-column: 1 / -1; margin: 0; }
@media (max-width: 680px) { .users-filters { grid-template-columns: 1fr; } .users-filters > button { width: 100%; } #admin-user-dialog, #admin-user-history-dialog { padding: var(--space-4); } }

.footer { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--subtle); font-size: 13px; }
.footer span { color: var(--accent); }

/* Camada global em fluxo: avisos e tarefas reservam espaço, sem cobrir formulários. */
.topbar > div:first-child { min-width: 0; }
.notification-toggle { position: relative; }
.notification-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.notification-count { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 var(--space-1); border: 2px solid var(--bg); border-radius: var(--radius-lg); background: var(--accent-strong); color: #fff; font-size: 10px; font-weight: 800; }
.notice-link { justify-self: start; margin-top: var(--space-1); font-size: 13px; font-weight: 650; }
.notice.progress .notice-mark { animation: spin 2s linear infinite; }
#notification-dialog { width: min(620px, calc(100vw - 24px)); max-height: 85dvh; padding: var(--space-5); overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
#notification-dialog::backdrop { background: var(--scrim); }
.notification-history-item { padding: var(--space-4) 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.notification-history-item p { margin: 5px 0; color: var(--muted); font-size: 14px; }
.notification-history-item a { display: block; width: fit-content; }
.notification-history-item.error strong { color: var(--danger); }
.notification-history-item.warning strong { color: var(--warning); }
.notification-history-item.success strong { color: var(--success); }
.activity-center { flex: none; min-width: 0; border: 1px solid color-mix(in srgb, var(--border) 70%, var(--surface)); border-radius: var(--radius-md); background: var(--surface); }
.activity-center > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px var(--space-4); color: var(--text); cursor: pointer; list-style: none; font-size: 13px; }
.activity-center > summary::-webkit-details-marker { display: none; }
.activity-center > summary strong { font-weight: 750; }
#activity-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.activity-expand { margin-left: auto; font-size: 18px; }
.activity-center[open] .activity-expand { transform: rotate(180deg); }
.activity-indicator, .activity-pulse { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--subtle); }
.has-running .activity-indicator, .activity-pulse { background: var(--accent); animation: activity-pulse 1.8s ease-in-out infinite; }
.has-uncertain .activity-indicator { background: var(--warning); animation: none; }
.activity-availability { margin: 0; padding: 10px var(--space-4); border-top: 1px solid var(--border); color: var(--warning); font-size: 13px; }
.activity-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; gap: var(--space-3); max-height: min(26dvh, 250px); padding: var(--space-3); overflow: auto; border-top: 1px solid var(--border); scrollbar-gutter: stable; }
.activity-card { min-width: 0; padding: 14px; border: 1px solid color-mix(in srgb, var(--border) 65%, var(--surface-2)); border-radius: var(--radius-sm); background: var(--field); }
.activity-history-heading { grid-column: 1 / -1; padding: 3px 2px; color: var(--subtle); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.activity-card-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px var(--space-3); font-size: 14px; }
.task-state { color: var(--accent); font-size: 12px; font-weight: 700; }
.state-error .task-state { color: var(--danger); }
.state-paused .task-state, .state-interrupted .task-state, .state-partial .task-state, .state-unknown .task-state { color: var(--warning); }
.state-completed .task-state { color: var(--success); }
.state-cancelled .task-state { color: var(--muted); }
.activity-details { display: flex; flex-wrap: wrap; gap: 2px var(--space-4); margin-top: 6px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.activity-details span { display: block; }
.activity-progress-label { margin-top: var(--space-2); color: var(--muted); font-size: 12px; }
progress, .national-progress { display: block; width: 100%; height: 6px; margin-top: 6px; overflow: hidden; border: 0; border-radius: 999px; background: var(--surface-2); accent-color: var(--accent-strong); }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: inherit; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent-strong), var(--accent)); border-radius: inherit; }
progress::-moz-progress-bar { background: var(--accent-strong); border-radius: inherit; }
.activity-working { display: flex; align-items: center; gap: 7px; margin-top: var(--space-2); color: var(--muted); font-size: 12px; }
.activity-link { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; margin-top: 5px; font-size: 12px; font-weight: 650; }
.progress-confirmed { color: var(--success); }
.metric-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent-strong); }
@keyframes activity-pulse { 50% { opacity: .45; } }

@media (max-width: 1200px) {
  .filter-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .search-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 900px) {
  .sidebar { width: 220px; }
  .main { width: calc(100% - 220px); margin-left: 220px; padding-left: 22px; padding-right: 22px; }
  .search-layout { grid-template-columns: 1fr; }
  .metric-grid { gap: 10px; }
  .metric-card { padding: 17px; }
}
@media (max-width: 800px) {
  .sidebar { inset: auto 0 0; width: 100%; height: auto; padding: 5px max(var(--space-2), env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--border); box-shadow: 0 -12px 28px #0002; }
  .brand, .nav-label, .sidebar-bottom { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
  .nav-item { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; min-height: 62px; padding: var(--space-2) 1px; border-radius: 9px; font-size: 11px; line-height: 1.15; text-align: center; }
  .nav-group-toggle { flex-direction: column; justify-content: center; }
  .nav-group-chevron { display: none; }
  .nav-subnav { position: absolute; z-index: 20; bottom: 78px; left: 50%; display: none; min-width: 190px; margin: 0; padding: 8px; transform: translateX(-50%); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-dialog); }
  .nav-group:focus-within .nav-subnav:not([hidden]) { display: grid; }
  .nav-subitem { min-height: 42px; text-align: left; }
  .nav-icon { font-size: 22px; }
  .main { --mobile-nav-height: 86px; width: 100%; margin: 0; height: calc(100dvh - var(--mobile-nav-height) - env(safe-area-inset-bottom)); padding: 0 20px; }
  .topbar { min-height: 72px; margin-bottom: 0; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card:first-child { grid-column: 1 / -1; }
  .sidebar { min-height: 86px; }
  .nav-item.active { box-shadow: inset 0 2px 0 var(--accent); }
}
@media (max-width: 620px) {
  .main { padding-left: 14px; padding-right: 14px; }
  .topbar { gap: var(--space-2); }
  .topbar .eyebrow { display: none; }
  .page-title { font-size: 19px; }
  .top-actions { gap: 6px; }
  .top-actions .button { padding: var(--space-2) 10px; font-size: 12px; }
  .welcome { min-height: 0; padding: var(--space-5); }
  .welcome p { font-size: 15px; }
  .metric-grid, .settings-grid, .form-grid, .advanced-grid, .filter-primary, .filter-bottom { grid-template-columns: 1fr; }
  .metric-card:first-child { grid-column: auto; }
  .field-wide { grid-column: auto; }
  .metric-card { min-height: 125px; }
  .panel { padding: 18px; }
  .table-panel { padding: 0; }
  .row-intro { align-items: flex-start; flex-direction: column; }
  .export-actions { width: 100%; }
  .form-footer, .national-panel, .source-callout, .import-row { align-items: stretch; flex-direction: column; }
  .form-actions { width: 100%; }
  .form-actions .button, .search-aside .button, .national-panel .button, .import-row .button { flex: 1; }
  .selection-bar { gap: var(--space-2); }
  #selected-count { margin-left: 0; }
  #active-filter-summary { flex-basis: 100%; order: 2; }
  .category-item { grid-template-columns: minmax(0, 1fr) 60px auto; }
  .recent-row { flex-wrap: wrap; }
  .top-actions [data-go="pesquisa"] { display: none; }
  .activity-center > summary { padding: var(--space-2) var(--space-3); }
  .activity-list { grid-template-columns: 1fr; max-height: 22dvh; padding: var(--space-2); }
  .workspace-scroll { padding-top: 18px; }
}
@media (max-width: 480px) {
  .sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-item { min-height: 48px; flex-direction: row; justify-content: center; gap: 6px; font-size: 12px; }
  .nav-icon { font-size: 18px; }
  .main { --mobile-nav-height: 122px; }
  .sidebar { min-height: 122px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Visão geral: resumo compacto e alinhado aos painéis existentes. */
.admin-overview-intro { margin: 22px 0 18px; }
.admin-overview-intro h1 { margin: 5px 0 4px; font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -.035em; }
.admin-overview-intro p { margin: 0; max-width: 720px; color: var(--muted); font-size: 14px; }
.overview-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.overview-metric { min-height: 0; padding: 15px 17px; }
.overview-metric .metric-head { gap: 8px; font-size: 12px; }
.overview-metric .metric-icon { width: 30px; height: 30px; font-size: 17px; }
.overview-metric .metric-value { margin-top: 8px; font-size: clamp(23px, 2.2vw, 31px); line-height: 1.15; }
.overview-metric .overview-status-value { font-size: clamp(16px, 1.55vw, 21px); overflow-wrap: anywhere; }
.overview-metric .metric-caption { margin-top: 4px; font-size: 11px; line-height: 1.4; }
.overview-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr); align-items: start; gap: 14px; }
.overview-layout > .panel { min-width: 0; padding: 17px; }
.overview-layout .panel-heading { margin-bottom: 12px; }
.overview-layout .panel-heading h2 { font-size: 16px; }
.overview-layout .panel-heading p { margin-top: 3px; font-size: 12px; }
.overview-activity-list { display: grid; gap: 8px; min-width: 0; }
.overview-activity-list .activity-card { padding: 11px 12px; }
.overview-activity-list .activity-link { min-height: 28px; }
.overview-availability { margin: 0; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--warning) 38%, var(--border)); border-radius: var(--radius-sm); color: var(--warning); font-size: 12px; }
.overview-shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.overview-shortcut { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) 14px; grid-template-rows: auto auto; align-items: center; gap: 2px 9px; min-width: 0; min-height: 66px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--field); color: var(--text); text-align: left; text-decoration: none; transition: border-color var(--motion) ease, background-color var(--motion) ease, transform var(--motion) ease; }
.overview-shortcut > span:first-child { grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 17px; }
.overview-shortcut strong { min-width: 0; font-size: 12px; line-height: 1.25; }
.overview-shortcut small { grid-column: 2; min-width: 0; color: var(--muted); font-size: 10px; line-height: 1.3; }
.overview-shortcut .overview-arrow { grid-column: 3; grid-row: 1 / 3; color: var(--accent); font-size: 16px; }
.overview-shortcut:hover { transform: translateY(-1px); border-color: var(--accent); background: var(--surface-2); text-decoration: none; }
.overview-shortcut:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 1100px) {
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-layout { grid-template-columns: minmax(0, 1fr) minmax(260px, .85fr); }
}
@media (max-width: 800px) {
  .overview-layout { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .admin-overview-intro { margin-top: 17px; }
  .overview-metrics { gap: 8px; }
  .overview-metric { padding: 12px; }
  .overview-metric .metric-head { align-items: flex-start; font-size: 11px; }
  .overview-metric .metric-value { font-size: 22px; }
  .overview-metric .overview-status-value { font-size: 15px; }
  .overview-shortcut-grid { grid-template-columns: 1fr; }
}

/* Entrada administrativa: compartilha os tokens, campos e botões do produto. */
.auth-page { min-height: 100svh; overflow: auto; display: grid; place-items: center; padding: clamp(24px, 5vw, 80px); background: radial-gradient(ellipse at 12% 16%, #7034c944, transparent 52%), radial-gradient(ellipse at 92% 88%, #6d28d92b, transparent 46%), var(--bg); }
.auth-shell { width: min(1080px, 100%); display: grid; grid-template-columns: 1fr 440px; gap: clamp(32px, 7vw, 112px); align-items: center; }
.auth-brand { margin: 0 0 32px; }
.auth-intro h1 { font-size: clamp(36px, 4.6vw, 62px); line-height: 1.08; letter-spacing: -.055em; margin: 14px 0 24px; }
.auth-intro h1 span { color: var(--accent); }
.auth-description { color: var(--muted); max-width: 385px; font-size: 17px; line-height: 1.8; }
.auth-assurance { display: flex; align-items: center; gap: 14px; margin-top: 28px; color: var(--accent); }
.auth-assurance > span { font-size: 30px; }
.auth-assurance p { font-size: 13px; line-height: 1.8; }
.auth-assurance p span { color: var(--muted); }
.auth-orbit { width: 160px; height: 120px; display: grid; place-items: center; position: relative; margin: 12px 0 28px; }
.auth-orbit span { font-size: 48px; font-weight: 800; color: var(--accent); letter-spacing: -.09em; text-shadow: 0 10px 40px #9b68ff33; }
.auth-orbit::before, .auth-orbit::after { content: ''; position: absolute; inset: 15px 0; border: 1px solid #9e79e75c; border-radius: 50%; transform: rotate(-26deg); }
.auth-orbit::after { transform: rotate(26deg); border-color: #9e79e72b; }
.auth-orbit i { position: absolute; height: 7px; width: 7px; border-radius: 50%; background: var(--accent); top: 16px; right: 22px; box-shadow: 0 0 16px #c6a8ff66; }
.auth-card { background: linear-gradient(145deg, #2a1d3e, var(--surface) 65%); padding: clamp(26px, 4vw, 40px); border: 1px solid #8062a36b; border-radius: 26px; box-shadow: 0 30px 90px #07041077, inset 0 1px #e0ccff12; animation: auth-enter 320ms ease-out both; }
.auth-lock { height: 48px; width: 48px; display: grid; place-items: center; border: 1px solid #b28aef55; border-radius: 14px; color: var(--accent); background: #8051c92b; margin-bottom: 26px; }
.auth-lock svg { height: 25px; width: 25px; stroke: currentColor; stroke-width: 1.5; }
.auth-card h2 { font-size: 25px; line-height: 1.25; margin: 10px 0 12px; letter-spacing: -.035em; }
.auth-subtitle, .auth-recovery { color: var(--muted); font-size: 14px; line-height: 1.7; }
.auth-subtitle { margin-bottom: 26px; }
.auth-card .field { margin: 0 0 10px; }
.auth-card input { width: 100%; min-height: 48px; padding: 12px 14px; background: var(--field); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); transition: border-color var(--motion), box-shadow var(--motion); }
.auth-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #a275ee20; }
.auth-password { display: flex; position: relative; }
.auth-password input { padding-right: 86px; }
.auth-password button { position: absolute; right: 6px; top: 6px; bottom: 6px; padding: 0 10px; color: var(--accent); background: transparent; border: 0; border-radius: 6px; font-size: 12px; }
.auth-feedback { min-height: 24px; margin: 14px 0; font-size: 13px; color: var(--warning); line-height: 1.5; }
.auth-submit { width: 100%; min-height: 48px; display: flex; justify-content: space-between; }
.auth-recovery { font-size: 12px; margin: 24px 0; }
.auth-footer { border-top: 1px solid #745e8a55; padding-top: 18px; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--subtle); }
@keyframes auth-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 760px) { .auth-page { padding: 28px 20px; } .auth-shell { grid-template-columns: 1fr; max-width: 440px; gap: 24px; } .auth-orbit, .auth-assurance, .auth-description { display: none; } .auth-brand { margin-bottom: 20px; } .auth-intro h1 { font-size: 32px; margin-bottom: 0; } .auth-intro h1 br { display: none; } .auth-intro .eyebrow { font-size: 10px; } }
@media (prefers-reduced-motion: reduce) { .auth-card { animation: none; } .auth-card input { transition: none; } }
