/* Identidade global Milebs v0.7 — estilos compartilhados sem interferir na geometria Leaflet. */
:root {
  color-scheme: dark;
  --milebs-bg:#071321;
  --milebs-surface:#0c1b2d;
  --milebs-surface-2:#10233a;
  --milebs-surface-3:#142b45;
  --milebs-line:#233a55;
  --milebs-ink:#edf4fc;
  --milebs-subtle:#9aadc3;
  --milebs-faint:#7288a2;
  --milebs-accent:#1769ed;
  --milebs-focus:#54b7ff;
  --milebs-radius:12px;
}

html { background:var(--milebs-bg); }
body { background:var(--milebs-bg); color:var(--milebs-ink); }
main { min-height:100vh; background:var(--milebs-bg); }
.sidebar { width:220px; padding:19px 12px 14px; background:#0a192b; border-right:1px solid #1e344e; color:#aebed1; }
main { margin-left:220px; }
.brand { display:flex; min-height:48px; gap:10px; padding:2px 9px; text-decoration:none; }
.milebs-logo-symbol { display:block; width:42px; height:36px; flex:0 0 42px; overflow:visible; }
.brand-copy { gap:4px; }
.brand-product { margin:0; color:#f1f6fc; font-size:21px; line-height:1; }
.brand-company { color:#9fb4cd; font-size:8px; font-weight:700; letter-spacing:2.5px; }
.brand-copy small { display:none; }
.nav-caption { margin:27px 12px 9px; color:#69809a; font-size:9px; letter-spacing:1.4px; }
.sidebar nav { display:grid; gap:4px; }
.sidebar nav a { min-height:39px; padding:9px 11px; border:1px solid transparent; border-radius:9px; color:#aabbd0; }
.sidebar nav a svg { width:16px; height:16px; flex:0 0 16px; fill:none; stroke:currentColor; stroke-width:1.8; }
.sidebar nav a:hover { background:#132943; color:#f0f6ff; }
.sidebar nav a.active { border-color:#1e5ccc; background:#124eb0; color:white; box-shadow:0 5px 16px #03112666; }
.sidebar-note { margin-top:auto; border-color:#203750; color:#9aadc3; }
.sidebar-note i { background:#27c18e; }
.sidebar-footer { border-color:#203750; color:#a8bad0; }
.sidebar-footer small { color:#7e93ab; }
.topbar { position:sticky; top:0; z-index:1000; height:58px; padding:0 24px; border-color:#1d334c; background:#0a192beF; color:#97abc2; backdrop-filter:blur(12px); }
.topbar-identity { gap:8px; }
.topbar-identity>strong { color:#ecf3fb; }
.topbar-identity>b { color:#69a6ff; }
.topbar-identity>span:last-child { color:#a4b6ca; }
.environment { gap:8px; }
.environment button,.topbar .environment button { border:1px solid #29435f; border-radius:8px; background:#10243b; color:#dce8f6; }
.environment button:hover { border-color:#3e70b5; background:#173252; }
.avatar { background:#16365d; color:#d9e9ff; }
.page { width:100%; max-width:1900px; padding:22px 24px 28px; }
.page-heading { margin-bottom:16px; }
.page-heading h1 { color:var(--milebs-ink); }
.page-heading p:not(.eyebrow),.region-label { color:var(--milebs-subtle); }
.region-label { border-color:var(--milebs-line); background:var(--milebs-surface); }
.eyebrow { color:#65a3ff; }
.demo-notice,.simulation-disclaimer,.portal-simulation-banner,.portal-isolation-note { border-color:#29415c; background:#10243a; color:#c1d0e1; }
.data-toolbar { color:var(--milebs-subtle); }
.data-toolbar .check-label { color:var(--milebs-subtle); }
.data-toolbar .actions button,.page button:not(.primary):not(.danger):not(.route-operator-toggle):not(.leaflet-control-zoom-in):not(.leaflet-control-zoom-out) { border-color:#2a425e; background:#10243a; color:#dce8f6; }
.page button:hover,.page .actions button:hover { border-color:#3e6fa8; background:#173252; }
.page button.primary,.page .primary,.page .card-header button.primary,.dialog-actions .primary { border-color:#1769ed; background:#1769ed; color:#fff; }
.page button.primary:hover,.page .primary:hover { background:#0f58cf; }
button:disabled { opacity:.52; }
input,select,textarea { color:var(--milebs-ink); }
.page input:not([type=checkbox]):not([type=radio]):not([type=range]),.page select,.page textarea,
dialog input:not([type=checkbox]):not([type=radio]):not([type=range]),dialog select,dialog textarea {
  border-color:#2b435f; border-radius:8px; background:#0a192b; color:#edf4fc;
}
.page input::placeholder,dialog input::placeholder { color:#7187a1; }
.page input:focus-visible,.page select:focus-visible,.page textarea:focus-visible,
dialog input:focus-visible,dialog select:focus-visible,dialog textarea:focus-visible,
button:focus-visible,a:focus-visible { outline:3px solid #54b7ff; outline-offset:2px; }
.page label,.page .form-help,.page .empty-state,.page .page-footer { color:#9aadc3; }
.page .app-message,.page .form-error,.page .location-state,.page .map-privacy { border-radius:9px; }
.page .app-message { border-color:#1d634f; background:#10372f; color:#a6ead1; }
.page .app-message.error,.page .form-error { border-color:#7f3b49; background:#351c2a; color:#ffc1c5; }
.page .map-privacy { border-color:#213a54; background:#0e2034; color:#9aadc3; }
.page .location-state { border:1px solid #29415c; background:#10243a; color:#c4d1e0; }
.page .location-state.located { border-color:#1c634c; background:#10372f; color:#a5e9d0; }
.page .location-state.ambiguous,.page .location-state.error { border-color:#775b31; background:#302818; color:#f2d596; }
.directory,.operation-page,.operation-subpanel,.v04-page,.operation-block,
.map-card,.operator-panel,.intel-map-card,.intel-left-panel,.intel-detail-panel,
.intel-bottom-card,.route-controls,.route-map-panel,.route-result-panel,.saved-route-section {
  border-color:var(--milebs-line); border-radius:var(--milebs-radius); background:var(--milebs-surface); color:var(--milebs-ink); box-shadow:0 10px 26px #02091424;
}
.v04-page { overflow:visible; }
.card-header,.route-card-heading,.route-stops-heading,.intel-map-header,.route-map-header,.route-result-heading,
.operation-subpanel>header,.saved-route-section>header { border-color:#223950; background:transparent; color:var(--milebs-ink); }
.card-header h2,.card-header h3,.route-card-heading h2,.route-stops-heading h2,.route-map-header h2,.route-result-heading h2,
.intel-map-header h3,.intel-bottom-card h3,.operation-page h2,.operation-subpanel h3 { color:#edf4fc; }
.card-header p,.card-header .eyebrow,.route-card-heading p,.route-stops-heading p,.route-result-heading p,
.route-map-header p,.intel-map-header p,.intel-bottom-card small,.form-help { color:#91a7c0; }
.directory-filters,.route-company-filters,.intel-filter-stack,.route-advanced-settings,
.route-company-groups,.route-company-list-heading,.route-map-bottom,.route-provider-status,
.route-origin-summary,.route-manual-order,.distribution-undo { color:#b5c5d7; }
.directory-filters input,.directory-filters select,.route-company-filters input,.route-company-filters select,
.route-compact-fields input,.route-compact-fields select,.intel-filter-stack input,.intel-filter-stack select {
  border-color:#2b435f; background:#0a192b; color:#edf4fc;
}
.directory-grid { gap:12px; padding:18px; }
.directory-item,.appointment-card,.execution-visit-card,.portal-visit-card,.operation-company-card,
.route-company,.route-operator-row,.route-result-card,.operator-visit-card,.operator-summary-cards article,
.operator-route-summary article,.operator-route-sequence li,.portal-summary-cards article {
  border-color:#263e59; border-radius:10px; background:#10243a; color:#e6eff9; box-shadow:0 5px 16px #02091422;
}
.directory-item h3,.directory-item strong,.directory-item h2,.visit-card-title h3,.portal-visit-card h3,
.visit-card-meta,.visit-card-reason,.appointment-card strong,.operation-company-card strong { color:#eaf2fb; }
.directory-item p,.directory-item span,.directory-item small,.appointment-card span,.appointment-card small,
.visit-card-meta,.visit-card-reason,.portal-visit-card p,.visit-detail-grid span { color:#9aadc3; }
.directory-item,.appointment-card,.execution-visit-card,.portal-visit-card { border-left-color:#263e59; }
.directory-item:hover,.appointment-card:hover,.execution-visit-card:hover,.portal-visit-card:hover { border-color:#3b5d80; background:#132b45; }
.badge { background:#123b36; color:#9be6ce; }
.badge.inactive { background:#243449; color:#b5c2d2; }
.badge.demo { background:#3b321d; color:#e7cf8c; }
.visit-status.pending { background:#263449; color:#c0cbd7; }
.visit-status.progress { background:#183963; color:#a8ccff; }
.visit-status.completed { background:#123b31; color:#99e5c7; }
.visit-status.not-completed { background:#453319; color:#f3cd86; }
.visit-status.cancelled { background:#46232d; color:#ffb8c0; }
.empty-state,.visit-empty,.exec-empty-visual { border-color:#29415c; background:#0d2034; color:#9aadc3; }
.empty-state strong,.visit-empty strong { color:#e8f0fa; }
.details-grid dt,.details-grid dd,.form-section-note,.record-id { color:#c6d3e1; }
.form-section-note,.record-id { border:1px solid #263e59; border-radius:8px; background:#0d2034; }
.dialog-actions { border-color:#263e59; }
dialog,.remote-dialog { border:1px solid #2a425e; border-radius:14px; background:#0d1e31; color:#eaf2fb; box-shadow:0 22px 72px #0009; }
dialog::backdrop { background:#020914ba; backdrop-filter:blur(3px); }
.dialog-heading h2,dialog h1,dialog h2,dialog h3 { color:#edf4fc; }
dialog p,dialog label,.auth-note { color:#9aadc3; }
.auth-screen { background:radial-gradient(ellipse at 50% 10%,#102b49 0,#071321 58%); color:#edf4fc; }
.auth-card { border:1px solid #2a425e; border-radius:18px; background:#0c1b2d; color:#edf4fc; box-shadow:0 28px 80px #0007; }
.auth-card h1,.auth-card h2 { color:#f0f6fd; }
.auth-card>p:not(.eyebrow):not(.form-error):not(.auth-note) { color:#9aadc3; }
.auth-card>label { color:#c9d6e5; }
.auth-card input,.auth-card select { border-color:#2b435f; border-radius:8px; background:#071522; color:#edf4fc; }
.auth-brand { display:flex; align-items:center; gap:11px; }
.auth-brand .milebs-logo-symbol { width:42px; height:35px; }
.auth-brand strong { color:#f1f6fc; font-size:18px; letter-spacing:-.25px; }
.auth-brand small { display:block; color:#91a7c0; font-size:9px; letter-spacing:.45px; }
.auth-screen .auth-switch a,.auth-card a { color:#7eb5ff; }
.auth-card button.primary { border-color:#1769ed; background:#1769ed; }
.operator-authenticated { min-height:100vh; background:var(--milebs-bg); color:var(--milebs-ink); }
.operator-app-header { border-color:#1e344e; background:#0a192b; color:#edf4fc; }
.operator-app-main { max-width:1400px; margin:0 auto; padding:22px clamp(14px,3vw,32px) 40px; }
.operator-app-heading h1 { color:#edf4fc; }
.operator-app-heading p,.operator-app-heading .eyebrow { color:#9aadc3; }
.operator-app-tabs { border-color:#243a53; border-radius:11px; background:#0c1b2d; }
.operator-app-tabs button { min-height:42px; border-color:transparent; border-radius:8px; background:transparent; color:#aebed1; }
.operator-app-tabs button[aria-selected="true"],.operator-app-tabs button.active { background:#124eb0; color:white; }
.operator-app-content,.operator-app-section,.operator-portal-section,.operator-route-panel,.operator-visit-panel,
.operator-home-panel,.operator-subpanel,.portal-subpanel { border-color:#243a53; border-radius:12px; background:#0c1b2d; color:#eaf2fb; box-shadow:0 10px 26px #02091424; }
.operator-portal-section>header h2,.operator-visit-groups>section>h3,.operator-summary-cards strong,
.operator-route-summary strong,.operator-route-map-heading strong,.operator-visit-card h3 { color:#edf4fc; }
.operator-summary-cards article,.operator-route-summary article,.operator-visit-card,.operator-route-sequence li,
.portal-summary-cards article,.portal-subpanel,.portal-tabs { border-color:#243a53; background:#0f2136; color:#eaf2fb; }
.operator-visit-card button,.operator-detail-actions button,.operator-map-actions a,.operator-map-actions button,
.operator-route-map-heading button { border-color:#29435f; border-radius:8px; background:#132943; color:#dce8f6; }
.operator-route-sequence li.is-active { background:#122c49; box-shadow:inset 3px 0 #1769ed; }
.operator-route-map,#portal-route-map { border-color:#29415c; background:#12243a; }
.operator-route-summary span,.operator-route-sequence li small,.operator-visit-instruction,
.portal-subpanel p,.portal-day-heading time,.portal-day-heading p,.portal-identity-note { color:#9aadc3; }
.portal-header { border-color:#243a53; border-radius:13px; background:linear-gradient(120deg,#10243a,#0b1a2c); }
.portal-header h1,.portal-subpanel>h2,.portal-day-heading h2,.portal-home-visits h2 { color:#edf4fc; }
.portal-header p,.portal-header label { color:#9aadc3; }
.portal-header select { border-color:#2b435f; background:#071522; color:#edf4fc; }
.portal-admin-return { border-color:#29415c; background:#132943; color:#dce8f6; }
.portal-tabs { padding:5px; }
.portal-tabs a { border-radius:8px; color:#9aadc3; }
.portal-tabs a[aria-selected="true"] { background:#124eb0; color:#fff; box-shadow:none; }
.portal-summary-cards span,.portal-summary-cards small { color:#9aadc3; }
.portal-summary-cards strong { color:#eaf2fb; }
.portal-route-status { border-color:#243a53; background:#0d2034; color:#9aadc3; }
.portal-route-sequence li>span { background:#183963; color:#d5e7ff; }
.page-footer { border-color:#203750; }
.section-tabs { border-color:#233a55; background:#0c1b2d; }
.section-tabs a[role="tab"] { border-color:transparent; background:transparent; color:#9aadc3; }
.section-tabs a[role="tab"][aria-selected="true"],.section-tabs a[role="tab"].active { border-color:#1e5ccc; background:#124eb0; color:#fff; }
.intelligence-dashboard .intel-metric { border-color:#263e59; border-radius:11px; background:#10243a; box-shadow:0 6px 18px #02091422; }
.intelligence-dashboard .intel-metric>div>span,.intelligence-dashboard .intel-metric small { color:#9aadc3; }
.intelligence-dashboard .intel-metric strong { color:#edf4fc; }
.intel-list-tabs { border-color:#233a55; }
.intel-list-tabs button { border-color:transparent; background:#0c1b2d; color:#9aadc3; }
.intel-list-tabs button[aria-selected="true"] { border-bottom-color:#4f93ff; background:#10243a; color:#9cc5ff; }
.intel-filter-stack label,.intel-date-filter label { color:#a9bad0; }
.intel-filter-summary,.intel-map-status,.intel-list-heading span { color:#9aadc3; }
.intel-list-heading { border-color:#233a55; }
.intel-list-heading h3 { color:#edf4fc; }
.intel-company-row,.intel-operator-row { border-color:#263e59; background:#0f2136; color:#eaf2fb; }
.intel-company-row:hover,.intel-operator-row:hover { border-color:#3a5e84; background:#142b45; }
.intel-company-row.is-selected { border-color:#477fc7; background:#132d4b; }
.intel-company-name { color:#edf4fc!important; }
.intel-company-row>span,.intel-operator-row>span,.intel-operator-row>small,.intel-company-kpis,.intel-company-rate,.intel-company-updated { color:#aabbd0!important; }
.intel-map-header,.intel-bottom-card>header { border-color:#233a55; }
.intel-map-header h3,.intel-bottom-card h3,.intel-detail-header h3 { color:#edf4fc; }
.intel-map-header p,.intel-bottom-card>header small,.intel-detail-address,.intel-detail-operator,.intel-detail-freshness,.intel-detail-observation,.intel-aggregate-note { color:#9aadc3; }
.intel-detail-actions button,.intel-detail-section>button,.intel-priority button { border-color:#29415c; background:#132943; color:#dce8f6; }
.intel-detail-metrics>div,.intel-report-facts>div,.intel-history li,.intel-visits li { border-color:#263e59; background:#0f2136; }
.intel-detail-metrics span,.intel-report-facts dt,.intel-visits li>button span,.intel-visits li>button small { color:#9aadc3; }
.intel-detail-metrics strong,.intel-report-facts dd,.intel-visits li>button strong { color:#eaf2fb; }
.intel-no-report,.intel-warning { border-color:#705931; background:#302818; color:#f0d292; }
.intel-bottom-card { border-color:#263e59; }
.intel-update-row { border-color:#263e59; }
.intel-update-row strong,.intel-priority>div>strong { color:#dce8f6; }
.intel-update-row span,.intel-priority span { color:#9aadc3; }
.intel-trend-chart line { stroke:#2b425c; }
.intel-trend-chart text { fill:#9aadc3; }
.intel-trend-chart circle { fill:#10243a; }
.intel-distribution-bar { background:#20344a; }
.intel-legend-item { color:#b8c8d9; }
#operations-panel>.card-header { border:1px solid #243a53; border-radius:12px; background:#0c1b2d; }
.operation-tabs { border-color:#243a53; background:#0c1b2d; }
.operation-tabs a[role="tab"] { border-radius:8px; color:#9aadc3; }
.operation-tabs a[role="tab"]:hover { background:#132943; color:#eaf2fb; }
.operation-tabs a[aria-selected="true"] { border:1px solid #1e5ccc; background:#124eb0; color:#fff; box-shadow:none; }
.operation-metrics .metric { border-color:#263e59; border-radius:11px; background:#10243a; color:#edf4fc; box-shadow:0 6px 18px #02091422; }
.operation-metrics .metric p,.operation-metrics .metric small { color:#9aadc3; }
.operation-metrics .metric strong { color:#edf4fc; }
.operation-metrics .metric-icon { background:#17365a; color:#8bbaff; }
.operation-company,.operation-company-card,.operation-detail-card { border-color:#263e59; border-radius:10px; background:#10243a; color:#eaf2fb; }
.operation-company h3,.operation-company strong,.operation-company-card h3,.operation-company-card strong { color:#edf4fc; }
.operation-company p,.operation-company span,.operation-company small,.operation-company-card p,.operation-company-card small { color:#9aadc3; }
.operation-count { border-color:#29415c; background:#132943; color:#b8c8d9; }
.operation-tabs+section,.operation-subpanel { border-color:#243a53; }
.distribution-summary article,.distribution-table,.distribution-operator-card,.agenda-day,.appointment-slot { border-color:#263e59; background:#10243a; color:#eaf2fb; }
.distribution-summary article span,.distribution-summary article small,.distribution-table p { color:#9aadc3; }
.distribution-summary article strong,.distribution-operator-card strong { color:#edf4fc; }
.operation-subpanel .empty-state,.operation-block .empty-state { border-color:#29415c; background:#0d2034; }
#map,#route-preview-map,#location-picker-map,#portal-route-map,.operator-route-map { background:#0b1b2e!important; }
.leaflet-tile-pane { filter:invert(.86) hue-rotate(180deg) saturate(.82) brightness(.88) contrast(.94); }
.route-map-metrics article { border-color:#28425f; background:#0c1b2deF; color:#edf4fc; }
.route-map-metrics strong,.route-map-metrics small { color:#edf4fc; }
.route-map-metrics .metric-icon { background:#17365a; color:#8bbaff; }
.route-map-metrics .metric-saving { background:#123c32; color:#65ddb4; }
.route-result-empty,.route-result-panel .route-result-empty { border-color:#28415d; background:#0c1d30; color:#a9bad0; }
.operator-authenticated .operator-app-header #authenticated-operator-name { color:#edf4fc; }
.operator-authenticated button,.operator-authenticated .operator-detail-actions button,
.operator-authenticated .operator-map-actions button,.operator-authenticated .operator-map-actions a,
.operator-authenticated .operator-app-shortcuts button { border-color:#29435f; border-radius:8px; background:#132943; color:#dce8f6; }
.operator-authenticated button.primary,.operator-authenticated .operator-app-shortcuts button.primary { border-color:#1769ed; background:#1769ed; color:#fff; }
.operator-authenticated button.primary:hover,.operator-authenticated .operator-app-shortcuts button.primary:hover { background:#0f58cf; }
.operator-authenticated .operator-app-tabs button[aria-current="page"],.operator-authenticated .operator-app-tabs button[aria-selected="true"],.operator-authenticated .operator-app-tabs button.active { border-color:#1e5ccc; background:#124eb0; color:#fff; }
.operator-authenticated .operator-summary-cards article,.operator-authenticated .operator-route-summary article { border-color:#263e59; background:#10243a; }
.leaflet-popup-content-wrapper,.leaflet-popup-tip { background:#0c1b2d; color:#edf4fc; }
.leaflet-popup-content strong { color:#85b7ff; }
.leaflet-popup-content small { color:#9aadc3; }
.leaflet-control-zoom a { border-color:#29415c!important; background:#0d2036!important; color:#eaf2fc!important; }
.leaflet-control-attribution { background:#0b192bd9!important; color:#aabbd0!important; }
.leaflet-control-attribution a { color:#87b8ff!important; }
.mobile-nav-toggle { border-color:#29415e; border-radius:8px; background:#10243a; color:#e5effb; }
.sidebar-backdrop:not([hidden]) { background:#020914b8; }

@media (max-width:900px) {
  .sidebar { width:210px; }
  main { margin-left:210px; }
  .page { padding:18px 16px 26px; }
  .appointment-filters,.visit-admin-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
  main { margin-left:0; }
  .sidebar { width:min(280px,84vw); padding:20px 14px; }
  .topbar { min-height:54px; height:54px; padding:0 12px; }
  .operator-app-header { position:sticky; top:0; z-index:1000; }
  .operator-app-main { padding:14px 12px 30px; }
  .operator-app-tabs { overflow:auto; }
}
@media (max-width:520px) {
  .page { padding:12px 10px 22px; }
  .auth-card { width:min(calc(100% - 24px),460px); padding:22px; }
  .operator-app-heading { display:grid; gap:12px; }
  .operator-app-shortcuts { display:grid; grid-template-columns:1fr 1fr; }
  .operator-app-shortcuts button { min-height:44px; }
  .operator-visit-card,.execution-visit-card { align-items:stretch; flex-direction:column; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; animation:none!important; }
}
