/* Approved Órbita contrast study · 2026-09-20.
   Load after the dashboard component styles. Materials only: no geometry,
   visibility, typography, interaction, status colours or permission changes.
   Agenda owns the equivalent rules inside its ShadowRoot stylesheet. */
:root {
  --aura-clarity-contact: inset 0 1px 0 #fff,0 2px 5px #6342750a,0 12px 24px -18px #764d9652;
  --aura-clarity-support: linear-gradient(128deg,#f4edf9,#ece3f6);
  --aura-clarity-work: #fff;
  --aura-clarity-divider: #e7d9ee;
}

/* Forced-colour users retain the component/system palette without overrides. */
@media (forced-colors: none) {
  /* Hoy: operational planes stay white; secondary rails recede. */
  #v-resumen .today .today-panel:not(.deep):not(.today-finance) {
    background: var(--aura-clarity-work);
    box-shadow: var(--aura-clarity-contact);
  }
  #v-resumen .today-toolbar {
    background: var(--aura-clarity-support);
    box-shadow: inset 0 1px 0 #fff;
  }
  #v-resumen .today-launch {
    background: #fff;
    box-shadow: var(--aura-clarity-contact);
  }

  /* Pipeline: recessed lanes, white records. Priority/selected/blocked cards
     and the dark next-action panel retain their existing signals. */
  body.aura-pipeline-orbita-active #pipelinePlusRoot .op-column {
    background: var(--aura-clarity-support);
    box-shadow: inset 0 1px 0 #fff;
  }
  body.aura-pipeline-orbita-active #pipelinePlusRoot .op-lead:not(.selected):not(.urgent):not(.is-priority):not(.is-blocked) {
    background: #fff;
    box-shadow: var(--aura-clarity-contact);
  }

  /* Pacientes: one directory plane, never individual row shadows. */
  #v-pacientes #patientsPlusRoot .patx-directory {
    background: #fff;
    box-shadow: var(--aura-clarity-contact);
  }
  #v-pacientes #patientsPlusRoot .patx-head {
    background: #f0e7f7;
  }

  /* Caja: preserve the approved financial focus and KPI colours. Only the
     inner session support gains an opaque material. */
  #v-caja #cajaV2Root.aura-caja-look .cx-session-metrics {
    background: var(--aura-clarity-support);
    border-color: var(--aura-clarity-divider);
  }

  /* Facturas: retain paper/stage and semantic badges; no row elevations. */
  #v-facturas .aura-billing-orbita .ab2-list-card {
    background: #fff;
    box-shadow: var(--aura-clarity-contact);
  }
  #v-facturas .aura-billing-orbita .ab2-table thead {
    background: #f0e7f7;
  }
  #v-facturas .aura-billing-orbita .ab2-side-card {
    background: var(--aura-clarity-support);
    box-shadow: inset 0 1px 0 #fff;
  }

  /* WhatsApp: only auxiliary rails. Beige conversation, green outgoing
     messages, white incoming messages and all delivery states are untouched.
     Existing workspace rules use !important for the context background. */
  body.wa-workspace-active #v-whatsapp #waGrid #waCtx {
    background: var(--aura-clarity-support) !important;
    border-left-color: var(--aura-clarity-divider) !important;
  }
  body.wa-workspace-active #v-whatsapp #waWorkspaceTools.wa-workspace-tools {
    background: var(--aura-clarity-support);
  }

  /* Inventario: same KPI grid and table; semantic text/alerts remain intact. */
  #v-inventario #invBody .inv-kpi-grid > .card {
    background: linear-gradient(128deg,#fbfaff,#ece3fb 68%,#e5d5f8);
    border-color: #ffffffed;
    box-shadow: var(--aura-clarity-contact);
  }
  #v-inventario #invBody .inv-kpi-grid > .card:nth-child(2) {
    background: linear-gradient(130deg,#fffdf7,#fdefdf 66%,#fbe2d1);
  }
  #v-inventario #invBody .inv-kpi-grid > .card:nth-child(3) {
    background: linear-gradient(128deg,#fffafd,#fbe8f4 72%,#f5d8ed);
  }
  #v-inventario #invBody > .card:has(> table) {
    background: #fff;
    border-color: #ffffffed;
    box-shadow: var(--aura-clarity-contact);
  }
  #v-inventario #invBody > .card:not(:has(> table)) {
    background: var(--aura-clarity-support);
    border-color: #ffffffed;
    box-shadow: inset 0 1px 0 #fff;
  }
  #v-inventario #invBody > .card > table > thead > tr > th {
    background: #f0e7f7;
    border-bottom-color: var(--aura-clarity-divider);
  }

  /* Portal: the CRM editor only, not the patient app or its phone preview. */
  #v-portal .pv-publication-bar {
    background: var(--aura-clarity-support);
    border-color: #ffffffed;
    box-shadow: inset 0 1px 0 #fff;
  }
  #v-portal .pv-settings-card,
  #v-portal .pv-feature-list,
  #v-portal .pv-overview-steps > button,
  #v-portal #portalClientsCard {
    background: #fff;
    box-shadow: var(--aura-clarity-contact);
  }

  /* Embudo: rails support the existing work canvas, not a new layout. The
     landing and its chosen clinic palette are deliberately not targeted. */
  #v-embudo .aura-funnel-ui .editor-rail,
  #v-embudo .aura-funnel-ui .outline-panel,
  #v-embudo .aura-funnel-ui .inspector {
    background: var(--aura-clarity-support);
    box-shadow: inset 0 1px 0 #fff;
  }
  #v-embudo .aura-funnel-ui .funnel-card {
    background: #fff;
    box-shadow: var(--aura-clarity-contact);
  }

  /* Instagram: approved lilac editor is retained; campaign translucency no
     longer merges with the canvas. Selection rings/status notes stay intact. */
  #v-instagram .aura-instagram .aig-campaign {
    background: linear-gradient(128deg,#fffafd,#fbe8f4 72%,#f5d8ed);
    box-shadow: var(--aura-clarity-contact);
  }
  #v-instagram .aura-instagram .aig-campaign:nth-child(even) {
    background: linear-gradient(128deg,#fbfaff,#ece3fb 68%,#e5d5f8);
  }
  #v-instagram .aura-instagram .aig-connection,
  #v-instagram .aura-instagram .aig-preview-bubble {
    background: #fff;
    box-shadow: var(--aura-clarity-contact);
  }
  #v-instagram .aura-instagram .aig-studio-step.aig-panel {
    box-shadow: var(--aura-clarity-contact);
  }
  #v-instagram .aura-instagram .aig-studio-preview,
  #v-instagram .aura-instagram .aig-studio .aigm-section {
    background: var(--aura-clarity-support);
    box-shadow: inset 0 1px 0 #fff;
  }

  /* Contenido: keep coloured posters and the dark challenge focus. */
  #v-contenido .contenido .panel:not(.deep):not(.rose):not(.peach):not(.lilac):not(.mint),
  #v-contenido .contenido .ct-feed-card {
    background: #fff;
    box-shadow: var(--aura-clarity-contact);
  }
  #v-contenido .contenido .ct-tabs,
  #v-contenido .contenido .ct-week-date,
  #v-contenido .contenido .ct-empty-days > div {
    background: var(--aura-clarity-support);
    box-shadow: inset 0 1px 0 #fff;
  }
  #v-contenido .contenido .ct-script {
    background: #fff;
    border-color: var(--aura-clarity-divider);
  }

  /* Formación: course palette, progress and current lesson remain unchanged. */
  #v-formacion .formacion .fm-route-panel,
  #v-formacion .formacion .fm-filters {
    background: var(--aura-clarity-support);
    box-shadow: inset 0 1px 0 #fff;
  }

  /* Equipo: one elevated directory and quiet auxiliary surfaces. */
  #v-equipo .equipo .eq-directory {
    background: #fff;
    box-shadow: var(--aura-clarity-contact);
  }
  #v-equipo .equipo .eq-tabs,
  #v-equipo .equipo .eq-schedule-impact {
    background: var(--aura-clarity-support);
    box-shadow: inset 0 1px 0 #fff;
  }

  /* Ajustes: lavender support surrounding white forms. Active navigation,
     disabled/read-only fields and warning colours keep their own rules. */
  #v-ajustes.view .settings-nav,
  #v-ajustes.view .as-subnav,
  #v-ajustes.view .as-fold,
  #v-ajustes.view .as-relocated {
    background: var(--aura-clarity-support);
    box-shadow: inset 0 1px 0 #fff;
  }
  #v-ajustes.view .card {
    background: #fff;
    box-shadow: var(--aura-clarity-contact);
  }

  /* Administración: the existing white clinic rows retain their status
     colours and hover behaviour. Only workbench support/work planes change. */
  dialog.aao-dialog .aao-steps {
    background: var(--aura-clarity-support);
    box-shadow: inset 0 1px 0 #fff;
  }
  dialog.aao-dialog .aao-detail,
  #v-admin #adminViralCenter .card {
    background: #fff;
    box-shadow: var(--aura-clarity-contact);
  }
}
