/* Shared operational theme. Existing routes, permissions and data remain authoritative. */
body:has(#app:not(.hidden)) {
  color-scheme: dark;
  --bg: var(--ui-color-0b171e);
  --surface: var(--ui-color-0e1d26);
  --ink: var(--ui-color-e9f2fb);
  --muted: var(--ui-color-a8bfd1);
  --line: var(--ui-color-1b313e);
  --border: var(--ui-color-1b313e);
  --nav: var(--ui-color-0c1921);
  --blue: var(--ui-color-51d5af);
  --green: var(--ui-color-2ddba2);
  --primary: var(--ui-color-00af7b);
  --primary-dark: var(--ui-color-008c65);
  background: var(--bg);
  color: var(--ink);
}
#app {background: var(--bg); color: var(--ink); font-size: 14px;}
#app h1 {font-size: 26px; font-weight: 600; letter-spacing: -.02em;}
#app h2 {font-weight: 600;}
#app :is(.premium-customer-card>div>span,.premium-cpe-card>div>span,.detail-breadcrumb button) {color: var(--ui-color-69cfb2);}
#app .overline {font-weight: 600; color: var(--ui-color-69cfb2); letter-spacing: .1em;}
#app .content {padding: 0 18px 28px; background: var(--bg);}
#app .content>header {padding: 22px 0 0; margin-bottom: 20px;}
#app .app-topbar {height: 68px; min-height: 68px; display: flex; align-items: center; gap: 16px; margin: 0 -18px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--ui-color-0a161e); box-shadow: none;}
#app .global-search {max-width: 465px; flex: 1; min-width: 0; margin-right: auto;}
#app .global-search input {width: 100%; height: 34px; min-height: 34px; padding: 7px 12px 7px 36px; font-size: 12px; background: var(--ui-color-10212b); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;}
#app .global-search::before {content: ''; position: absolute; left: 15px; top: 10px; width: 10px; height: 10px; border: 1.5px solid var(--ui-color-abc6d9); border-radius: 50%; pointer-events: none;}
#app .global-search::after {content: ''; position: absolute; left: 25px; top: 21px; width: 6px; border-top: 1.5px solid var(--ui-color-abc6d9); transform: rotate(45deg); pointer-events: none;}
#app .topbar-action {padding: 9px 4px; border: 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 400; box-shadow: none;}
#app .topbar-action strong {background: var(--ui-color-da465b); color: white; font-size: 10px; min-width: 18px; height: 18px; padding: 2px 4px;}
#app .topbar-help {display: inline-flex; align-items: center; gap: 8px;}
#app .topbar-profile {max-width: 220px; padding: 4px 0 4px 18px; background: transparent; color: var(--ink); border: 0; border-left: 1px solid var(--line); border-radius: 0;}
#app .topbar-profile strong {font-size: 12px; font-weight: 500;}
#app .topbar-profile small {font-size: 11px; color: var(--muted);}
#app #topbar-avatar {border-radius: 50%; width: 34px; height: 34px; min-width: 34px; background: linear-gradient(120deg,var(--ui-color-70d4ae),var(--ui-color-168659)); color: white;}
#app #app-sidebar {align-self: start; background: linear-gradient(120deg,var(--ui-color-0c1921),var(--ui-color-0b1720)); color: var(--ink); gap: 0; padding: 0; border-right: 1px solid var(--line); overflow-x: hidden;}
#app #app-sidebar>.brand-line {position: relative; padding: 14px 28px 14px 16px; margin: 0; min-height: 80px; gap: 12px; flex-shrink: 0; border-bottom: 1px solid var(--line);}
#app .brand-mark {width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px; font-size: 28px; font-weight: 600; box-shadow: none;}
#app .brand-copy-short strong {font-size: 20px; white-space: nowrap; font-weight: 600;}
#app .brand-line small {color: var(--ui-color-93aebf); font-size: 11px; letter-spacing: .04em;}
#app .sidebar-toggle {position: absolute; right: 4px; padding: 0; width: 18px; min-width: 18px; background: transparent; color: var(--ui-color-89a8b9); border: 0;}
#app .nav-catalog-title {display: none;}
#app #app-sidebar>nav {padding: 16px 14px; gap: 8px; align-content: start;}
#app .nav-root,#app .nav-group-toggle,#app .nav-submenu .nav-item {font-size: 13px; line-height: 20px; font-weight: 400; color: var(--ui-color-c1d5e5); border-radius: 7px; min-height: 38px; padding: 9px 10px;}
#app .nav-group-toggle {gap: 12px;}
#app .nav-icon {display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; width: 18px; height: 18px; margin-right: 8px; color: var(--ui-color-68cbb7);}
#app .nav-icon svg {width: 18px; height: 18px;}
#app .nav-group-toggle>.nav-icon {margin-right: 0;}
#app .nav-submenu {margin: 0; padding: 0; border: 0; gap: 4px;}
#app .nav-section.contains-active>.nav-group-toggle {background: transparent; color: white;}
#app .nav-item.active {background: var(--ui-color-152f39); color: white; border-left: 2px solid var(--ui-color-00d79a);}
#app .nav-submenu .nav-item.active::before {display: none;}
#app .nav-submenu .nav-item.active .nav-icon {color: var(--ui-color-00d79a);}
#app #app-sidebar>.endpoint-disclosure {margin: auto 14px 10px; border-color: var(--line); background: transparent;}
#app .endpoint-disclosure summary {font-weight: 500; font-size: 11px; color: var(--ui-color-a5c3d1);}
#app .endpoint-card {background: var(--ui-color-10212a); border-color: var(--line);}
#app #app-sidebar>.aside-foot {margin: 0 14px 14px; padding: 14px; background: var(--ui-color-10212a); border: 1px solid var(--line); border-radius: 10px; gap: 8px;}
#app .aside-foot span {font-size: 13px; font-weight: 500;}
#app .aside-foot small {color: var(--ui-color-a8bfd1); font-size: 10px; line-height: 1.5;}
#app :is(.panel,.metric,.customer-card,.service-card,.customer-hero,.customer-summary-card,.customer-equipment-main,.customer-equipment-metric,.customer-service-equipment,.customer-equipment-tab-panel,.integration-fact,.premium-customer-card,.premium-cpe-card,.premium-actions,.health-card,.assessment-domain,.device-side-rail>section,.hubsoft-device-card,.parameter-toolbar,.report-card,.user-row,.user-card,.empty-card,.wizard-step,.objective-grid label,.fiber-overview,.service-overview,.wifi-overview,.capability-card,.profile-validation-note,.genieacs-summary article,.parameter-explorer-row,.selection-list label,.user-metrics article,.search-result,.notification-item) {background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: none;}
#app :is(.customer-service-facts,.customer-equipment-metric,.assessment-disclaimer,.dashboard-toolbar,.compact-facts,.facts,.help-accordion details,.integration-summary) {background: var(--ui-color-10232d); color: var(--ink); border-color: var(--line);}
#app :is(.section-title,.assessment-heading,.parameter,.session,.customer-technical-details,.customer-equipment-inline,.assessment-domain dl>div) {border-color: var(--line);}
#app :is(.secondary,.ghost,.icon-button,.inspect-button,.customer-rail-action,.customer-equipment-tabs button,.pagination button,.page-button) {background: var(--ui-color-10232d); color: var(--ui-color-d6e6f2); border: 1px solid var(--ui-color-25404e); border-radius: 7px; font-weight: 500; box-shadow: none;}
#app :is(.secondary,.ghost,.icon-button,.inspect-button):hover:not(:disabled) {background: var(--ui-color-19333e); border-color: var(--ui-color-397061);}
#app :is(.primary-action,[data-customer-survey-device],#open-device-survey) {background: var(--ui-color-009c71); color: #fff; border-color: var(--ui-color-00b383); font-weight: 500;}
#app :is(button,input,select,textarea):focus-visible {outline: 2px solid var(--ui-color-64edc4); outline-offset: 3px;}
#app button:disabled {opacity: .5; cursor: not-allowed;}
#app :is(input,select,textarea) {background: var(--ui-color-0d202a); color: var(--ink); border: 1px solid var(--ui-color-294451); border-radius: 7px;}
#app :is(input,textarea)::placeholder {color: var(--ui-color-8ea8ba); opacity: 1;}
#app :is(table,tbody,tr,td) {background: transparent; color: var(--ink); border-color: var(--line);}
#app th {background: var(--ui-color-10232d); color: var(--ui-color-a9c1d2); border-color: var(--line); font-weight: 500;}
#app tbody tr:hover {background: var(--ui-color-142b36);}
#app :is(.state,.empty-inline,.parameter code,.assessment-domain>p,.assessment-domain-head span,.assessment-domain-head strong,.assessment-domain dt,.assessment-domain dd,.assessment-domain dt small,.assessment-domain dd small,.health-card p,.health-card small,.health-card>span,.premium-customer-card p,.premium-cpe-card p,.help-checklist li,.customer-equipment-heading p) {color: var(--muted);}
#app :is(.health-card strong,.premium-customer-card h2,.premium-cpe-card h2,.assessment-domain h3,.customer-equipment-heading h3) {color: var(--ink);}
#app :is(.status-pill,.assessment-level.healthy) {background: var(--ui-color-073d2d); color: var(--ui-color-54e6ab);}
#app :is(.status-pill.inactive,.status-pill.stale,.assessment-level.attention,.attention-state,.offline-data-banner,.customer-reconciliation-warning) {background: var(--ui-color-342a15); color: var(--ui-color-f6c568); border-color: var(--ui-color-66501e);}
#app :is(.assessment-level.critical,.error-state) {background: var(--ui-color-361d26); color: var(--ui-color-ff9daa);}
#app :is(.action-block-reason,.queued-action-note,.inline-reason) {color: var(--ui-color-f1bd68);}
#app .assessment-coverage span {background: var(--ui-color-122732); color: var(--ui-color-b8cfdf); border-color: var(--line);}
#app :is(.global-search-results,.profile-menu,.notification-center,.notification-head,.notification-list) {background: var(--ui-color-10222d); color: var(--ink); border-color: var(--ui-color-28414f);}
#app :is(.search-result,.notification-item) {color: var(--ink); border-color: var(--line);}
#app :is(.search-result:hover,.notification-item:hover) {background: var(--ui-color-1a3542);}
#app .customer-equipment-tabs button[aria-selected="true"] {background: var(--ui-color-10382e); border-color: var(--ui-color-128f6b); color: var(--ui-color-7af0c9);}
#app .customer-service-management .customer-equipment-top {align-items: center;}
#app .customer-service-management .customer-summary-card {border: 1px solid var(--line);}
#app .customer-service-management .customer-service-title .overline {font-size: 10px;}
#app .customer-service-management .customer-service-facts {padding: 12px 16px;}
#app .customer-service-management .customer-equipment-heading h3 {font-weight: 600;}
body:has(#app:not(.hidden)) dialog {background: var(--ui-color-0e1e28); color: var(--ui-color-e9f2fb); border: 1px solid var(--ui-color-294653);}
body:has(#app:not(.hidden)) dialog :is(input,select,textarea,.secondary) {background: var(--ui-color-102731); color: var(--ui-color-e9f2fb); border-color: var(--ui-color-36535e);}
body:has(#app:not(.hidden)) dialog :is(p,small,label) {color: var(--ui-color-bacfdd);}
body:has(#app:not(.hidden)) dialog::backdrop {background: #020a12bb;}
@media(min-width:761px) {
  #app:not(.sidebar-collapsed) {grid-template-columns: 260px minmax(0,1fr);}
  #app #app-sidebar {position: sticky; top: 0; height: 100dvh;}
  #app.sidebar-collapsed {grid-template-columns: 76px minmax(0,1fr);}
  #app.sidebar-collapsed .nav-icon {margin: 0;}
}
@media(max-width:1000px) {#app .topbar-help {display:none;} #app .topbar-profile {max-width:180px;} #app .app-topbar {gap:10px;}}
@media(max-width:760px) {
  #app .content {padding: 0 12px 20px;}
  #app .app-topbar {margin: 0 -12px; padding: 0 12px; height: 62px; min-height: 62px;}
  #app .app-topbar .global-search input {font-size: 12px;}
  #app .topbar-profile {border:0; padding:0;}
  #app #app-sidebar {position:fixed; height:100dvh; z-index:60;}
  #app .content>header {padding-top:18px;}
  #app .nav-item {display:flex;align-items:center;}
  #app .customer-service-management .customer-equipment-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
  #app .customer-service-management .customer-equipment-actions button {width:100%;}
}

#app :is(.activity-card,.device-row,.activity-card dl>div,.summary-lead,.chart-card,.help-topic,.help-section,.help-security,.help-support-card,.help-checklist){background:var(--ui-color-10232d);color:var(--ink);border-color:var(--line)}
#app :is(.activity-card h3,.activity-card strong,.summary-lead strong){color:var(--ink)}
#app :is(.activity-card p,.activity-card dt,.activity-card small){color:var(--muted)}
#app .survey-context h1,#app .survey-context h2{font-size:14px;font-weight:600;line-height:1.4}
#app .wifi-survey-workspace .survey-card{background:linear-gradient(130deg,var(--ui-color-10202a),var(--ui-color-0d1b23))}
#app .wifi-survey-workspace .survey-own{background:var(--ui-color-123650)}
#app .wifi-survey-workspace .survey-own td:first-child{color:var(--ui-color-48a5ff)}
#app .wifi-survey-workspace .survey-equipment-tabs{display:flex}
#app .wifi-survey-workspace .survey-summary .survey-primary{color:white;background:var(--ui-color-009b71)}
#app .wifi-survey-workspace .survey-network-card th{background:var(--ui-color-0c1c26)}
#app :is(.customer-service-devices,.customer-web-shortcut,.customer-equipment-image,.customer-summary-icon,.customer-symbol,.customer-avatar,.cpe-illustration){background:var(--ui-color-122a34);color:var(--ui-color-72d9b8);border-color:var(--line)}

#app .wifi-survey-workspace .survey-spectrum{height:auto;aspect-ratio:940/300}
#app .wifi-survey-workspace .survey-network-card td{padding:3px 7px;font-size:12px;line-height:17px}
#app .wifi-survey-workspace .survey-table-scroll{max-height:244px}
@media(max-width:760px){#app .wifi-survey-workspace .survey-spectrum{height:auto;min-height:180px}}

@media(min-width:1251px){
 #app .wifi-survey-workspace .survey-table-scroll{max-height:220px}
 #app .survey-recommendation>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 12px}
 #app .survey-recommendation h2{grid-column:1}
 #app .survey-recommendation p{grid-column:1/-1}
 #app .survey-recommendation small{grid-column:1;font-size:10px}
 #app .survey-recommendation details{grid-column:2;grid-row:1}
 #app .survey-recommendation summary{margin-top:0;font-size:10px}
 #app .survey-recommendation details[open]{grid-row:auto;grid-column:1/-1}
}

#app .customer-operations{grid-template-columns:minmax(0,1fr)}
#app .customer-operations>*{min-width:0}
#app #customer-summary>article{background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:10px}
#app #customer-summary>article :is(span,small){color:var(--muted)}
#app .customer-search-form :is(label,input,select){min-width:0;max-width:100%}
@media(max-width:620px){#app .customer-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#app .customer-summary>article{padding:12px}#app .customer-summary>article strong{font-size:23px}#app .customer-operations .section-title{flex-wrap:wrap}}

/* Shared dialogs preserve readable operation and risk messages. */
body:has(#app:not(.hidden)) dialog :is(.task-help,.current-password-card,.current-password-row,.profile-summary,.task-progress-item,.task-progress-outcome){background:var(--ui-color-142b36);color:var(--ui-color-d7e6ef);border-color:var(--ui-color-345362)}
body:has(#app:not(.hidden)) dialog :is(.task-help.write,.task-progress-item.downloading,.task-progress-item.verifying-version){background:var(--ui-color-122e49);color:var(--ui-color-a9d7ff);border-color:var(--ui-color-315b80)}
body:has(#app:not(.hidden)) dialog :is(.task-help.critical,.task-help.destructive,.confirmation-line,.task-progress-outcome.partial,.task-progress-item.scheduled,.task-progress-item.prevalidating){background:var(--ui-color-342a15);color:var(--ui-color-f6c568);border-color:var(--ui-color-66501e)}
body:has(#app:not(.hidden)) dialog :is(.task-progress-item.completed,.task-progress-outcome:not(.failed):not(.partial)){background:var(--ui-color-10382e);color:var(--ui-color-93ebc9);border-color:var(--ui-color-24684e)}
body:has(#app:not(.hidden)) dialog :is(.task-progress-item.failed,.task-progress-item.expired,.task-progress-item.canceled,.task-progress-outcome.failed){background:var(--ui-color-361d26);color:var(--ui-color-ffb0bc);border-color:var(--ui-color-713544)}
body:has(#app:not(.hidden)) dialog :is(.task-help,.confirmation-line,.task-progress-item,.task-progress-outcome) :is(p,small,label,time){color:inherit}
body:has(#app:not(.hidden)) dialog .task-progress-outcome h3{color:inherit}
body:has(#app:not(.hidden)) dialog :is(p.error,.error){color:var(--ui-color-ff9daa)}
body:has(#app:not(.hidden)) dialog .icon-button{background:var(--ui-color-203945);color:var(--ui-color-e9f2fb)}

/* Compact navigation must override the shared expanded menu sizing. */
@media(min-width:761px){
 #app.sidebar-collapsed #app-sidebar>nav{padding:16px 10px}
 #app.sidebar-collapsed :is(.nav-root,.nav-group-toggle){width:100%;min-width:0;justify-content:center;padding:9px;font-size:0;gap:0}
 #app.sidebar-collapsed .nav-root>span:not(.nav-icon){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 #app.sidebar-collapsed .nav-icon{margin:0}
}
#app .help-hero{background:linear-gradient(135deg,var(--ui-color-10382e),var(--ui-color-10232d));border-color:var(--ui-color-285b50)}
#app :is(.help-topics button,.help-config-grid>div,.help-field-list>div,.help-api-summary>div,.help-accordion details){background:var(--ui-color-10232d);border-color:var(--line);color:var(--ink)}
#app .help-topics button:hover{background:var(--ui-color-173a3d);border-color:var(--ui-color-3b8a75)}
#app :is(.help-config-grid code,.help-field-list strong,.help-field-list code,.help-checklist li){color:var(--ink)}
#app :is(.help-note,.help-security){background:var(--ui-color-123346);color:var(--ui-color-b9ddf2);border-color:var(--ui-color-2d5972)}
#app .help-warning{background:var(--ui-color-342a15);color:var(--ui-color-f6c568);border-color:var(--ui-color-66501e)}
#app .help-accordion details[open] summary{color:var(--ui-color-7de9c1)}

:root[data-theme="light"] body:has(#app:not(.hidden)){color-scheme:light}
#app .appearance-control{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:12px;flex-shrink:0}
#app .appearance-control select{height:36px;min-width:88px;padding:6px 10px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:8px;cursor:pointer}
/* O seletor de cor entrou numa topbar que ja estava no limite: medido em 768px, os dois rotulos
   juntos transbordavam 9px. Entre 621px e 1000px o de cor mostra so o campo — o nome continua no
   aria-label, para leitor de tela. Abaixo de 620px a regra que ja existia encolhe os dois. */
@media(max-width:1000px){#app .appearance-control:has(#appearance-accent)>span{display:none}#app .appearance-control select{min-width:76px}}
#app #customer-search-form{display:grid;grid-template-columns:minmax(150px,.65fr) minmax(180px,1fr) minmax(220px,2fr) auto;align-items:end;gap:14px;padding:20px 0}
#app #customer-search-form label{display:grid;gap:8px;min-width:0}
#app #customer-search-form :is(input,select,button){width:100%;height:44px;min-height:44px;padding:10px 12px;border-radius:8px;font:inherit;box-sizing:border-box}
#app #customer-search-form :is(input,select){background:var(--surface);color:var(--ink);border:1px solid var(--line)}
#app #customer-search-form button{background:var(--ui-color-007d5b);color:#fff;border:1px solid var(--ui-color-007d5b);font-weight:600}
#app .customer-inventory-table button{background:var(--surface);color:var(--ink);border:1px solid var(--line);min-height:38px;padding:8px 14px;border-radius:8px;font-weight:600}
#app .customer-inventory-table button:hover{border-color:var(--ui-color-007d5b);color:var(--ui-color-007d5b)}
#app .customer-inventory-table :is(th,td):last-child{background:var(--surface)}
#app #customers-view .section-title{padding:12px 0 18px}
#app #customers-view .section-title :is(.overline,h2){display:none}
#app .survey-spectrum{height:auto;max-height:none;aspect-ratio:940/300;width:100%;display:block}
#app .survey-callout rect{fill:var(--surface)}
#app .survey-callout text{fill:var(--ink)}
#app .survey-chart-card{min-width:0}
#app .survey-card-heading{flex-wrap:wrap;gap:12px}
#app .survey-chart-tools{position:static;justify-content:flex-end;margin:10px 0 0}
:root[data-theme="light"] #app :is(.survey-subtabs button,.survey-equipment-tabs button,.survey-state-line){color:var(--ink)}
:root[data-theme="light"] #app .survey-own-row{background:#e8f2fc}
@media(max-width:1000px){#app #customer-search-form{grid-template-columns:1fr 1fr}#app #customer-search-form label:last-of-type{grid-column:1/-1}}
@media(max-width:620px){#app #customer-search-form{grid-template-columns:1fr}#app #customer-search-form label:last-of-type{grid-column:auto}#app .appearance-control>span{display:none}#app .appearance-control select{min-width:70px;width:70px;padding:5px}#app .app-topbar{gap:8px}#app #open-faults{gap:3px;padding:6px 0}#app #open-faults>span{display:none}}

:root[data-theme="light"] #app :is(.nav-item.active,.nav-section.contains-active>.nav-group-toggle,.aside-foot strong){color:var(--ui-color-11634f)}
:root[data-theme="light"] #app .endpoint-disclosure{background:var(--ui-color-edf5f2)!important}
:root[data-theme="light"] #app .endpoint-disclosure summary{color:var(--ui-color-245b4e)}
:root[data-theme="light"] #app :is(.status-pill.active,.online-state,.positive-state,.customer-status.online){color:var(--ui-color-12664b);background:var(--ui-color-e3f4eb)}
#app #customers-view .section-title{margin-bottom:0;border-bottom:0}
#app #customers-view .section-title>div p{margin:0}

:root[data-theme="light"]{--ui-color-54e6ab:var(--ui-color-12664b);--ui-color-68cbb7:var(--ui-color-257660);--ui-color-51d5af:var(--ui-color-12664b);--ui-color-2ddba2:var(--ui-color-12664b);--ui-color-b9ddf2:#244b62}

:root[data-theme="light"] #app #app-sidebar>.endpoint-disclosure{background:var(--ui-color-edf5f2)!important}
:root[data-theme="light"] #app .survey-card{background:#fff;border-color:#d5e0e6}
:root[data-theme="light"] #app .survey-grid-line{stroke:#b7c9d4}
:root[data-theme="light"] #app .survey-recommendation h2{color:#8b5900}
:root[data-theme="light"] #app .survey-recommendation .survey-bulb{color:#8b5900}
#app .survey-chart-card>.survey-card-heading{padding-right:0;display:flex;min-height:0}
#app .survey-legend{position:static;margin-left:auto;flex-wrap:wrap}

:root[data-theme="light"]{--ui-color-a9d7ff:#244b62}

:root[data-theme="light"]{--ui-color-23df97:var(--ui-color-12664b);--ui-color-f1bd68:#855400;--ui-color-fac878:#855400;--ui-color-ff6880:#b32442}
#app :is(.primary-action,.survey-primary,[data-customer-survey-device],#open-device-survey){background:var(--ui-color-007d5b);color:#fff}

#app #app-sidebar > .sidebar-signout {margin-top:auto;padding:14px;}
#app .sidebar-signout #logout {width:100%;}
#app .profile-tenant-details {padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid var(--line);}
#app .profile-tenant-details strong,#app .profile-tenant-details small {display:block;overflow-wrap:anywhere;}
#app .profile-tenant-details strong {font-size:14px;margin-bottom:6px;}
#app .profile-tenant-details small {font-size:12px;line-height:1.6;color:var(--muted);}
#app #profile-summary {overflow-wrap:anywhere;}
/* Tema escuro: superfícies que ainda tinham fundo claro fixo (white, var(--ui-color-f6fbf8), var(--ui-color-f7fbf9) em
   cpe-premium.css e resources.css) e deixavam texto claro sobre branco — itens de Alertas,
   painel "Filtrar equipamentos" e cartões de CPE em Operações em massa. Só o escuro; o claro
   (:root[data-theme="light"]) continua usando as cores originais. */
:root:not([data-theme="light"]) #app .notification-item {background: var(--ui-color-10222d); border-color: var(--line); color: var(--ink);}
:root:not([data-theme="light"]) #app .notification-item:hover {background: var(--ui-color-1a3542);}
:root:not([data-theme="light"]) #app .mass-filter-panel {background: var(--ui-color-10232d); border-color: var(--line); color: var(--ink);}
:root:not([data-theme="light"]) #app .mass-selection-toolbar {border-top-color: var(--line);}
:root:not([data-theme="light"]) #app .selection-list label {background: var(--ui-color-10232d); border-color: var(--line); color: var(--ink);}
:root:not([data-theme="light"]) #app .selection-list label:has(input:checked) {background: var(--ui-color-0c352d); border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset;}
:root:not([data-theme="light"]) #app :is(.selection-list small,.mass-filter-heading small,.mass-selection-summary small) {color: var(--muted);}

/* Official vector mark and compact customer context, shared by both themes. */
.brand-line .brand-mark,#app .brand-mark{background:transparent;box-shadow:none}
.brand-mark img{display:block;width:100%;height:100%;object-fit:contain}
#customer-assignment-status:empty,.customer-readings-status:empty{display:none}
.customer-readings-status{margin:12px 0;padding:10px 14px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--muted);font-size:13px;line-height:1.5}
#customer-detail-content>.secondary{margin-bottom:12px}
#app .customer-context-line{gap:10px;flex-wrap:wrap;margin-bottom:12px}
#app .profile-row{gap:18px;padding:22px 20px;border-color:var(--line)}
#app .profile-row .row-actions{gap:8px;flex-wrap:wrap}
#app .profile-row small{line-height:1.6}
#app .profile-row .write-validation-chip{padding:5px 9px}
@media(max-width:620px){#app .profile-row{padding:16px 12px}.customer-readings-status{padding:10px}.profile-account-links button{min-height:44px}}

#app #profiles-view .resource-toolbar{background:var(--surface);color:var(--ink);border:1px solid var(--line)}
#app #profiles-view .resource-toolbar span{color:var(--muted)}

@media(max-width:620px){
 #app:has(#customer-detail:not(.hidden)) #page-title{white-space:normal;overflow-wrap:anywhere;line-height:1.2}
 #app .customer-context-line strong{min-width:0;overflow-wrap:anywhere}
 #app .customer-service-management .customer-summary-card>div{flex-wrap:wrap;min-width:0}
}

/* Guided choices and supporting surfaces use the same operational palette. */
#app .objective-grid label:has(input:checked){background:var(--ui-color-10382e);border-color:var(--ui-color-128f6b);box-shadow:0 0 0 1px var(--ui-color-128f6b)}
#app .objective-grid label:hover{border-color:var(--ui-color-397061)}
#app :is(.wizard-step strong,.objective-grid strong){color:var(--ink)}
#app :is(.step-number,.assistant-status,.assignment-summary,.invitation-result,.capability-card.available){background:var(--ui-color-10382e);color:var(--ui-color-7af0c9);border-color:var(--ui-color-24684e)}
#app :is(.connected-head,.connected-empty-state .connected-empty-icon,.rpc-method-strip span,.capability-pill,.capability-card.unavailable){background:var(--ui-color-10232d);color:var(--muted);border-color:var(--line)}
#app :is(.parameter-explorer-row:hover,.search-result:focus-visible){background:var(--ui-color-142b36)}

#app .genieacs-summary strong{color:var(--ink)}
#app .genieacs-summary :is(span,small){color:var(--muted)}

/* Optical cards share the active theme, including unavailable readings. */
#app .signal-value{background:var(--surface);border-color:var(--line);color:var(--ink)}
#app .signal-value.available{box-shadow:inset 3px 0 0 var(--brand-end)}
#app .signal-value.unavailable strong{color:var(--muted)}
/* Catálogo de sistemas homologados e assistente de conexão. Tokens do tema, claro e escuro. */
#app .integration-catalog {display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; padding: 0 16px 16px;}
#app .integration-card {display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--ui-color-10232d); color: var(--ink); min-width: 0;}
:root[data-theme="light"] #app .integration-card {background: #fff;}
#app .integration-card-head {display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;}
#app .integration-card-head strong {display: block; font-size: 15px;}
#app .integration-card-head small, #app .integration-card p {color: var(--muted); font-size: 12px; margin: 0;}
#app .integration-capabilities {margin: 0; padding-left: 18px; display: grid; gap: 2px; color: var(--ink); font-size: 12px;}
#app .integration-limitation {color: var(--muted); font-size: 11px; margin: 0;}
#app .integration-card-actions {display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px;}
#app .integration-card-actions button {width: auto;}
#app .integration-state.ready {background: var(--ui-color-0c352d); color: var(--ui-color-23df97);}
dialog.integration-wizard {width: min(560px, calc(100vw - 2rem));}
dialog.integration-wizard form {display: grid; gap: 12px;}
dialog.integration-wizard label {display: grid; gap: 4px; font-size: 13px; font-weight: 600;}
dialog.integration-wizard small {color: var(--muted); font-weight: 400;}
dialog.integration-wizard .wizard-steps {display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--muted);}
dialog.integration-wizard .wizard-steps li {padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;}
dialog.integration-wizard .wizard-steps li.active {border-color: var(--primary); color: var(--ink);}
dialog.integration-wizard .dialog-actions {display: flex; justify-content: flex-end; gap: 8px;}

/* Funções liberadas da chave de integração. A lista herdava o campo de formulário de
   .integration-settings-grid: a caixa virava um bloco de 211x44 acima do rótulo, a borda do
   fieldset ficava clara (#dbe4ee) sobre fundo escuro e a legenda caía para 2,24:1 de contraste.
   Mesma forma do seletor .selection-list, com tokens que acompanham a troca de tema.
   O diálogo é filho de <body>, fora de #app, por isso estas regras não levam o prefixo #app. */
#integration-key-dialog {width: min(680px, calc(100vw - 2rem));}
#integration-key-dialog form {max-height: 88vh; overflow: auto;}
#integration-key-dialog fieldset {display: block; border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 14px; min-width: 0;}
#integration-key-dialog legend {padding: 0 6px; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);}
#integration-key-scopes {display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 8px;}
#integration-key-scopes label {display: flex; align-items: center; gap: 10px; margin: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--ui-color-10212b); font-size: .82rem; font-weight: 500; line-height: 1.35; cursor: pointer; transition: border-color .12s, background .12s;}
#integration-key-scopes label:hover {border-color: var(--primary);}
#integration-key-scopes label:has(input:checked) {background: var(--ui-color-0c352d); border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset;}
#integration-key-scopes label:focus-within {outline: 2px solid var(--primary); outline-offset: 2px;}
#integration-key-scopes input[type="checkbox"] {flex: none; width: 17px; height: 17px; min-height: 0; margin: 0; padding: 0; accent-color: var(--primary); cursor: pointer;}
/* No tema claro o token 0c352d resolve para var(--ui-color-edf5f3), quase igual ao fundo do item não
   marcado: o verde de var(--ui-color-ecfdf5) é o mesmo que .selection-list já usa para marcado. */
:root[data-theme="light"] #integration-key-scopes label:has(input:checked) {background: var(--ui-color-ecfdf5);}
/* A grade de .integration-settings-grid empilha rótulo sobre campo; a linha de validade
   indeterminada é caixa + texto na mesma linha, como as demais opções do painel. */
#integration-key-no-expiry {display: flex; align-items: center; gap: 10px; font-size: .8rem; font-weight: 500; color: var(--muted);}
#integration-key-no-expiry input[type="checkbox"] {flex: none; width: 17px; height: 17px; min-height: 0; margin: 0; padding: 0; accent-color: var(--primary); cursor: pointer;}
/* Campo de dias desligado pela validade indeterminada precisa parecer desligado. */
#integration-key-dialog input:disabled {opacity: .45; cursor: not-allowed;}
