/* V1.9.4 — refinamento do painel administrativo. Portal do Operador e Tadeu ficam fora do escopo. */
:root {
  --v194-surface: #0d2035;
  --v194-surface-raised: #112943;
  --v194-line: #284866;
  --v194-text: #eef5ff;
  --v194-muted: #adbed2;
  --v194-accent: #39a6ff;
  --v194-radius: 14px;
}

#primary-sidebar { background: linear-gradient(180deg, #09182a 0%, #071321 100%); }
#primary-sidebar .nav-caption { margin-top: 30px; margin-bottom: 10px; color: #8299b4; }
#primary-sidebar nav { gap: 5px; }
#primary-sidebar nav a { min-height: 42px; padding: 10px 13px; border: 1px solid transparent; border-radius: 9px; }
#primary-sidebar nav a.active { box-shadow: inset 3px 0 #50caff, 0 6px 18px #006be52b; }
#primary-sidebar .sidebar-note { padding: 14px 8px; color: #c2d2e4; }
#primary-sidebar .sidebar-note small { color: #8fa5bd; line-height: 1.45; }
#primary-sidebar .sidebar-footer { padding-top: 18px; }

#admin-workspace .topbar { min-height: 62px; height: 62px; padding-inline: clamp(16px, 2.4vw, 36px); }
#admin-workspace .topbar-identity { color: #d2dfed; }
#admin-workspace .topbar-identity #breadcrumb { color: #f4f8ff; font-weight: 650; }
#admin-workspace .environment button { min-height: 36px; padding: 0 13px; border: 1px solid #294866; border-radius: 9px; background: #10243a; color: #e6f1fc; letter-spacing: 0; }
#admin-workspace .page { width: min(100%, 1840px); padding: clamp(18px, 2vw, 30px) clamp(16px, 2.2vw, 34px) 28px; }
#admin-workspace .page-heading { min-height: 68px; margin-bottom: 20px; }
#admin-workspace .page-heading h1 { margin-bottom: 6px; font-size: clamp(24px, 2vw, 31px); line-height: 1.15; }
#admin-workspace .page-heading p:not(.eyebrow) { max-width: 760px; color: #afc1d5; font-size: 13px; line-height: 1.55; }
#admin-workspace .page-heading .eyebrow { margin-bottom: 7px; color: #49c9f2; }
#admin-workspace .region-label { border-color: #294866; border-radius: 9px; background: #10243a; color: #c4d5e8; }

/* Dados de recuperação continuam disponíveis, mas não ocupam o espaço do conteúdo. */
#admin-workspace .admin-data-tools { margin: 0 0 16px auto; width: fit-content; max-width: 100%; border: 1px solid #203d59; border-radius: 10px; background: #0a192a; color: #c4d5e8; }
#admin-workspace .admin-data-tools summary { padding: 9px 13px; cursor: pointer; color: #a9c7e4; font-size: 11px; font-weight: 650; }
#admin-workspace .admin-data-tools[open] { width: 100%; }
#admin-workspace .admin-data-tools .data-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 0 12px 12px; }
#admin-workspace .admin-data-tools .check-label { margin: 0; color: #b9c9db; }
#admin-workspace .admin-data-tools .actions { display: flex; flex-wrap: wrap; gap: 8px; }
#admin-workspace .admin-data-tools button { min-height: 36px; }
#admin-workspace #humyn-overview-summary { display: none !important; }

/* Shared visual language for administrative cards, forms, tables and feedback. */
#admin-workspace .page :is(.directory, .operation-page, .operation-subpanel, .operation-block, .data-quality-page, .humyn-id-page, .humyn-overview-summary, .scope-page, .radar-page, .appointment-page, .humyn-company-directory, .humyn-bulk-assignment, .humyn-location-review) {
  border-color: var(--v194-line);
}
#admin-workspace .page :is(.card-header, .scope-heading, .data-quality-heading, .humyn-id-heading, .radar-heading, .appointment-page-heading, .operation-page-heading) { gap: 16px; }
#admin-workspace .page :is(.card-header h2, .scope-heading h2, .data-quality-heading h2, .humyn-id-heading h2, .radar-heading h2, .appointment-page-heading h2) { color: var(--v194-text); font-size: 16px; line-height: 1.3; }
#admin-workspace .page :is(.card-header p, .scope-heading p, .data-quality-heading p, .humyn-id-heading p, .radar-heading p, .appointment-page-heading p) { max-width: 780px; color: var(--v194-muted); font-size: 12px; line-height: 1.55; }
#admin-workspace .page .eyebrow:not(.tadeu-chat-panel .eyebrow) { color: #48c8f0; font-size: 10px; letter-spacing: 1.2px; }
#admin-workspace .page :is(button, input, select, textarea):not(.tadeu-assistant-open) { font-size: 12px; }
#admin-workspace .page :is(button, select, input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea):not(.tadeu-assistant-open) { border-radius: 9px; }
#admin-workspace .page :is(input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea):not(.tadeu-assistant-open) { min-height: 42px; }
#admin-workspace .page :is(button, .primary):not(.tadeu-assistant-open) { min-height: 38px; padding-inline: 12px; }
#admin-workspace .page :is(table th, table td) { line-height: 1.5; }
#admin-workspace .page :is(.empty-state, .humyn-empty, .exec-empty-visual, .route-empty-state) { color: #b1c2d5; }
#admin-workspace .page :is([role=status], .app-message, .humyn-message, .scope-message, .radar-status) { line-height: 1.55; }
#admin-workspace .page :is(.card-header, .scope-heading, .data-quality-heading, .humyn-id-heading, .radar-heading, .appointment-page-heading) { border-color: #203c58; }
#admin-workspace .page :is(.directory-item, .appointment-card, .operation-company-card, .humyn-map-company-row, .management-operator-card, .radar-alert, .scope-company-row) { border-color: #294965; }
#admin-workspace .page :is(.directory-item, .appointment-card, .operation-company-card, .humyn-map-company-row, .management-operator-card, .radar-alert, .scope-company-row):hover { border-color: #3b80ad; }

/* Visão Geral: indicadores e títulos legíveis sem alterar os dados apresentados. */
body.executive-dashboard-active #admin-workspace .page { padding-top: 16px; }
body.executive-dashboard-active .exec-heading { gap: 16px; margin-bottom: 12px; }
body.executive-dashboard-active .exec-title h1 { font-size: clamp(22px, 1.8vw, 28px); }
body.executive-dashboard-active .exec-title p { color: #b4c7dc; font-size: 11px; line-height: 1.5; }
body.executive-dashboard-active .exec-metrics { gap: 10px; }
body.executive-dashboard-active .exec-metric { min-height: 78px; padding: 12px 14px; }
body.executive-dashboard-active .exec-metric-copy > span { color: #c0d0e2; font-size: 10px; }
body.executive-dashboard-active .exec-metric-copy strong { font-size: clamp(19px, 1.8vw, 25px); }
body.executive-dashboard-active .exec-metric-copy small { color: #a5bad0; font-size: 9px; line-height: 1.4; }
body.executive-dashboard-active .exec-card > header { padding: 13px 15px; }
body.executive-dashboard-active .exec-card h2 { font-size: 13px; }
body.executive-dashboard-active .exec-card > header p { color: #a9bdd2; font-size: 10px; }
body.executive-dashboard-active .exec-activity-copy strong,
body.executive-dashboard-active .exec-activity-copy > span { font-size: 10px; }
body.executive-dashboard-active .exec-activity-copy small,
body.executive-dashboard-active .exec-activity-item time { font-size: 9px; }
body.executive-dashboard-active .exec-empty-visual p { font-size: 12px; }
body.executive-dashboard-active .exec-empty-visual small { color: #a9bdd2; font-size: 10px; }

/* Mapas: os símbolos de precisão continuam distintos e visíveis sobre o mapa. */
#admin-workspace .page :is(.intel-map-card, .humyn-map-card, .exec-map-card, .route-map-panel) { min-width: 0; overflow: hidden; border-color: #2b4b69; border-radius: var(--v194-radius); }
#admin-workspace .page :is(.intel-map-header, .humyn-map-card > header, .exec-map-card > header, .route-map-header) { min-width: 0; }
#admin-workspace .page :is(.intel-map-header h3, .humyn-map-card h3, .route-map-header h2) { color: #f0f6ff; font-size: 14px; }
#admin-workspace .page :is(.intel-map-header p, .humyn-map-card header p, .route-map-header p) { color: #b1c4d8; font-size: 11px; line-height: 1.5; }
#humyn-map { min-height: 390px; isolation: isolate; }
#humyn-map .leaflet-marker-icon.humyn-map-pin, #humyn-map .leaflet-tooltip.humyn-map-cluster-label { opacity: 1 !important; visibility: visible !important; }
#humyn-map .leaflet-control-container { z-index: 800; }
#humyn-map .leaflet-control-zoom, #humyn-map .leaflet-control-attribution { filter: drop-shadow(0 2px 5px #00101f99); }
#admin-workspace .page .humyn-map-note { padding: 9px 12px; color: #c2d1e2; font-size: 11px; line-height: 1.5; }
#admin-workspace .page .humyn-map-counts { color: #eff6ff; font-size: 12px; }
#admin-workspace .page .humyn-map-status { color: #a9bdd2; font-size: 11px; }
#admin-workspace .page .humyn-map-company-copy strong { color: #eff6ff; font-size: 12px; }
#admin-workspace .page .humyn-map-company-copy small { color: #adbed2; font-size: 10px; line-height: 1.45; }
#admin-workspace .page .humyn-map-location-state.state-confirmed { color: #63dfb1; }
#admin-workspace .page .humyn-map-location-state.state-approximate,
#admin-workspace .page .humyn-map-location-state.state-municipality { color: #f2c46d; }
#admin-workspace .page .humyn-map-location-state.state-missing,
#admin-workspace .page .humyn-map-location-state.state-review { color: #aebed0; }

/* Humyn ID: elimina o ruído de identificadores na lista sem removê-los dos dados ou ações. */
#admin-workspace .page .humyn-record code { display: none; }
#admin-workspace .page .humyn-record { min-height: 76px; align-items: center; padding: 13px 5px; }
#admin-workspace .page .humyn-record strong { font-size: 12px; }
#admin-workspace .page .humyn-record p { color: #b8c8da; font-size: 11px; line-height: 1.45; }
#admin-workspace .page .humyn-record small { color: #a4b8cc; font-size: 10px; }
#admin-workspace .page .humyn-company-table-wrap tbody td:nth-child(2) small { display: none; }
#admin-workspace .page .humyn-metrics article { min-height: 108px; align-content: start; }
#admin-workspace .page .humyn-metrics span { font-size: 11px; }
#admin-workspace .page .humyn-metrics strong { font-size: 19px; }
#admin-workspace .page .humyn-metrics small { color: #a9bdd2; font-size: 10px; line-height: 1.45; }

/* Reduce motion remains controlled by the user's operating-system preference. */
@media (max-width: 1100px) {
  #admin-workspace .page { padding-inline: 18px; }
  #admin-workspace .page :is(.humyn-layout, .scope-layout, .radar-layout) { grid-template-columns: minmax(0, 1fr); }
  body.executive-dashboard-active .exec-metric-copy small { font-size: 9px; }
}
@media (max-width: 760px) {
  #admin-workspace .topbar { padding-inline: 12px; }
  #admin-workspace .page { padding: 14px 12px 24px; }
  #admin-workspace .page-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  #admin-workspace .page-heading .region-label { display: none; }
  #admin-workspace .page :is(.card-header, .scope-heading, .data-quality-heading, .humyn-id-heading, .radar-heading, .appointment-page-heading) { align-items: stretch; flex-direction: column; }
  #admin-workspace .page :is(.card-header .actions, .data-quality-actions, .appointment-page-heading button) { width: 100%; }
  #admin-workspace .page :is(.card-header .actions, .data-quality-actions) { display: flex; flex-wrap: wrap; }
  #admin-workspace .page .admin-data-tools { width: 100%; }
  #admin-workspace .page .admin-data-tools .data-toolbar { align-items: stretch; flex-direction: column; }
  #admin-workspace .page .admin-data-tools .actions > button { flex: 1; }
  #humyn-map { min-height: 330px; }
  #admin-workspace .page .humyn-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.executive-dashboard-active .exec-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.executive-dashboard-active .exec-metric { min-height: 76px; }
}
@media (max-width: 420px) {
  #admin-workspace .page { padding-inline: 10px; }
  #admin-workspace .page .humyn-id-page { padding: 10px; }
  #admin-workspace .page .humyn-metrics { gap: 7px; }
  #admin-workspace .page .humyn-metrics article { min-height: 96px; padding: 10px; }
  #admin-workspace .page .humyn-metrics strong { font-size: 16px; }
  #admin-workspace .page .humyn-company-directory > header { padding: 13px; }
  #admin-workspace .page .humyn-company-pagination { flex-wrap: wrap; }
  /* Keep wide official catalog tables inside their own horizontal scroller. */
  #admin-workspace .page .humyn-company-directory,
  #admin-workspace .page .humyn-company-directory > header,
  #admin-workspace .page .humyn-company-table-wrap { width: 100%; min-width: 0; max-width: 100%; }
  #admin-workspace .page .humyn-company-table-wrap { display: block; overflow-x: auto; overscroll-behavior-inline: contain; }
}
@media (prefers-reduced-motion: reduce) {
  #primary-sidebar nav a, #admin-workspace .page *:not(.tadeu-assistant-open), #admin-workspace .topbar * { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
#map-panel #humyn-location-review,
#map-panel .intel-bottom-grid { display: none !important; }
#map-panel .humyn-map-directory-pane { display: grid; }
#map-panel .humyn-map-directory-pane[hidden] { display: none; }

/* V2.2: o mapa é o foco; filtros ficam na lateral e os detalhes sobrepõem o mapa sem bloquear sua leitura. */
#map-panel .intel-page-heading,
#map-panel #intel-date-status,
#map-panel #intel-demo-notice,
#map-panel #intelligence-metrics,
#map-panel .intel-bottom-grid,
#map-panel #map-privacy { display: none !important; }
#map-panel .intel-main-grid { position: relative; display: grid; grid-template-columns: minmax(270px, 310px) minmax(0, 1fr); gap: 14px; align-items: stretch; }
#map-panel .intel-left-panel { min-width: 0; max-height: min(76vh, 820px); overflow: auto; overscroll-behavior: contain; }
#map-panel .humyn-map-directory-pane { min-height: 0; grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
#map-panel .humyn-map-company-list { max-height: none; min-height: 0; overflow: auto; }
#map-panel .intel-map-card { grid-column: 2; min-width: 0; min-height: min(76vh, 820px); }
#map-panel .map-shell, #map-panel #map { width: 100%; height: min(68vh, 740px); min-height: 480px; }
#map-panel #map-company-card { position: absolute; z-index: 700; top: 14px; right: 14px; width: min(310px, 32%); max-height: min(58vh, 600px); overflow: auto; box-shadow: 0 12px 34px #020b15a8; }
#map-panel #map-company-card[hidden] { display: none; }
#map-panel #map-company-card:not([hidden]) { z-index: 1200; }
#map-panel #map-company-card [data-map-detail-drag] { flex: 0 0 30px; width: 30px; min-width: 30px; height: 30px; padding: 0; border: 1px solid #2b5579; border-radius: 7px; background: #102b45; color: #9edbff; cursor: grab; touch-action: none; user-select: none; }
#map-panel #map-company-card [data-map-detail-drag]:active { cursor: grabbing; }
#map-panel #map-company-card .intel-detail-header { grid-template-columns: 30px minmax(0,1fr) auto; align-items: start; }
#map-panel #map-company-card .intel-detail-header > div { min-width: 0; }
#map-panel #map-company-card .official-map-detail > header { display: grid; grid-template-columns: 30px minmax(0,1fr) 32px; align-items: start; }
#map-panel #map-company-card .official-map-detail > header > div { min-width: 0; }
#map-panel .intel-map-legends { max-width: 100%; }
.milebs-map-popup { width: min(245px, 68vw); max-width: min(245px, 68vw); overflow-wrap: anywhere; line-height: 1.4; }
.milebs-map-popup > strong { display: block; margin-bottom: 4px; }
.milebs-map-popup > div, .milebs-map-popup > small { display: block; margin-top: 3px; color: #30445a; font-size: 11px; }
.official-map-detail { display: grid; gap: 10px; }
.official-map-detail header { display:flex; align-items:start; justify-content:space-between; gap:8px; }
.official-map-detail h3 { margin:3px 0; overflow-wrap:anywhere; }
.official-map-detail p { margin:0; color:#c3d3e5; font-size:12px; line-height:1.45; overflow-wrap:anywhere; }
.official-map-detail dl { display:grid; gap:7px; margin:0; }
.official-map-detail dl div { display:grid; grid-template-columns:90px minmax(0,1fr); gap:8px; }
.official-map-detail dt { color:#94acc4; font-size:10px; }
.official-map-detail dd { margin:0; color:#ecf5ff; font-size:11px; overflow-wrap:anywhere; }
@media (max-width: 900px) {
  #map-panel .intel-main-grid { grid-template-columns: minmax(0, 1fr); }
  #map-panel .intel-left-panel { max-height: 34vh; }
  #map-panel .intel-map-card { grid-column: 1; min-height: 58vh; }
  #map-panel .map-shell, #map-panel #map { height: 58vh; min-height: 360px; }
  #map-panel #map-company-card { top: 10px; right: 10px; width: min(300px, 70%); max-height: 38vh; }
}
@media (max-width: 520px) {
  #map-panel .page-heading { margin-bottom: 8px; }
  #map-panel .intel-left-panel { max-height: 30vh; }
  #map-panel .map-shell, #map-panel #map { height: 55vh; min-height: 320px; }
  #map-panel #map-company-card { width: min(265px, 82%); max-height: 36vh; }
}

/* Route planning: clear desktop hierarchy and a useful state when no operator is active. */
body.route-planning-active #route-planning-panel .route-workspace { grid-template-columns: minmax(290px,.82fr) minmax(0,1.18fr); gap: 14px; align-items: start; }
body.route-planning-active #route-planning-panel .route-controls,
body.route-planning-active #route-planning-panel .route-map-panel,
body.route-planning-active #route-planning-panel .route-result-panel { min-width: 0; border-radius: 13px; }
body.route-planning-active #route-planning-panel #route-preview-map { min-height: 500px; }
body.route-planning-active #route-planning-panel .route-empty-operators { display: grid; gap: 8px; padding: 18px; border: 1px dashed #3d6282; border-radius: 12px; background: #0b1d30; color: #e8f4ff; }
body.route-planning-active #route-planning-panel .route-empty-operators p { margin: 0; color: #a8bed4; line-height: 1.55; }
body.route-planning-active #route-planning-panel .route-empty-operators a { justify-self: start; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 8px; background: #126ee6; color: white; font-weight: 700; text-decoration: none; }
#map-panel #humyn-map-company-list .humyn-map-operator-candidate { color: #f5c66a; }
@media (max-width: 900px) {
  body.route-planning-active #route-planning-panel .route-workspace { display: flex; flex-direction: column; gap: 11px; }
  body.route-planning-active #route-planning-panel #route-preview-map { min-height: 360px; }
}
