/* Shared module finish, based on the observed patient/charge and settings screens.
   Screen only. Layout, visibility, clinical states and print documents stay owned
   by their existing modules. */
@media screen {
 .patient-workspace,.patient-profile,.billing-workspace,.billing-reference-dialog,
 .settings-layout,.report-workspace,.smart-workspace,.smart-patient-context,
 .record-search,.search-result,.stage-plan-manager,.stock-detail {
  --line:var(--ui-line,#dedfe2);
  --muted:var(--ui-muted,#777c84);
  --teal:var(--ui-accent,#00a6c4);
 }
 .smart-workspace,.smart-patient-context {
  --smart-ink:var(--ui-ink,#303339);
  --smart-muted:var(--ui-muted,#777c84);
  --smart-line:var(--ui-line,#dedfe2);
  --smart-blue:var(--ui-accent,#00a6c4);
  --smart-blue-tint:#f0fafc;
 }
 .report-workspace .mobile-report-line-path,
 .report-workspace .mobile-report-line-dot {stroke:#ff7900}
 .report-workspace .mobile-report-line-dot.is-current {fill:#ff7900}
 .report-workspace .mobile-report-line-area {fill:#fff1e3}
 .report-workspace .mobile-report-current-band {fill:#fff8f1}
 .report-workspace .mobile-report-line-card .mobile-report-line-value {color:#a95400}

 @media (min-width:721px) {
  /* Patient directory and the patient context carried into every record. */
  .patient-workspace .patient-center,.patient-workspace .patient-groups,
  .patient-workspace .patient-list-card,.patient-profile .patient-context-header,
  .patient-profile .patient-profile-summary {
   background:#fff;border-color:var(--ui-line,#dedfe2);border-radius:0;box-shadow:none;
  }
  .patient-workspace .patient-group-heading {
   background:#fff;color:var(--ui-ink,#303339);border-color:var(--ui-line,#dedfe2);
  }
  .patient-workspace .patient-groups button {
   color:var(--ui-ink,#303339);border-radius:0;background:transparent;
  }
  .patient-workspace .patient-groups button.active {
   background:#f2f2f4;color:var(--ui-ink,#303339);border-left-color:var(--ui-accent,#00a6c4);
  }
  .patient-workspace .patient-advanced-fields,.patient-workspace .patient-batch-footer {
   background:var(--ui-soft,#f5f6f8);border-color:var(--ui-line,#dedfe2);border-radius:2px;
  }
  .patient-workspace .patient-filter-summary span {
   background:#fff;color:var(--ui-muted,#777c84);border-color:var(--ui-line,#dedfe2);
  }
  .patient-workspace th {
   background:#fff;color:var(--ui-muted,#777c84);border-color:var(--ui-line,#dedfe2);
  }
  .patient-workspace td {color:#60656e;border-color:var(--ui-line,#dedfe2)}
  .patient-workspace tbody tr:nth-child(even) {background:#fafafa}
  .patient-workspace tbody tr:hover,.patient-workspace tr:has([data-select-patient]:checked) {background:#f0fafc}
  .patient-workspace .patient-name-link,.patient-workspace .patient-row-actions button,
  .patient-workspace .patient-row-more summary,.patient-workspace #patient-advanced {
   color:var(--ui-accent,#00a6c4);
  }
  .patient-profile .patient-context-header {border-top-width:1px}
  .patient-profile .patient-profile-summary {color:#60656e}
  .patient-profile>.tabs {border-bottom-color:var(--ui-accent,#00a6c4)}
  .patient-profile>.tabs button {
   color:#60656e;background:#fff;border-color:var(--ui-line,#dedfe2);border-radius:3px 3px 0 0;
  }
  .patient-profile>.tabs button.active {
   color:#fff;background:var(--ui-accent,#00a6c4);border-color:var(--ui-accent,#00a6c4);
  }
  .recent-patients {border-color:var(--ui-line,#dedfe2)}
  .recent-patients>strong {color:var(--ui-muted,#777c84)}
  .recent-patients button {background:#fff;color:#60656e;border-color:var(--ui-line,#dedfe2);border-radius:3px}
  .recent-patients button.active {background:var(--ui-accent,#00a6c4);border-color:var(--ui-accent,#00a6c4);color:#fff}
  .recent-patients button:not(.active) small {color:var(--ui-muted,#777c84)}
  .followup-batch {background:var(--ui-soft,#f5f6f8);border-color:var(--ui-line,#dedfe2);border-radius:2px}

  /* Charge list and composer retain the wide editor and persistent settlement. */
  .billing-workspace,.billing-workspace .billing-metric {
   background:#fff;border-color:var(--ui-line,#dedfe2);border-radius:0;box-shadow:none;
  }
  .billing-workspace .billing-metric.arrears {background:#fff;border-color:var(--ui-line,#dedfe2)}
  .billing-workspace .billing-metric span {color:var(--ui-muted,#777c84)}
  .billing-workspace .billing-view-tabs {border-color:var(--ui-line,#dedfe2)}
  .billing-workspace .billing-view-tabs button {
   color:#60656e;background:#fff;border-color:var(--ui-line,#dedfe2);border-radius:0;
  }
  .billing-workspace .billing-view-tabs button.active {
   background:#fff;color:var(--ui-accent,#00a6c4);border-top-color:var(--ui-accent,#00a6c4);
  }
  .billing-workspace .billing-filters {
   background:#fff;border-color:var(--ui-line,#dedfe2);border-radius:0;
  }
  .billing-workspace th,.billing-reference-dialog .billing-composer .billing-table th {
   background:#fff;color:var(--ui-muted,#777c84);border-color:var(--ui-line,#dedfe2);
  }
  .billing-workspace .tablewrap,.billing-reference-dialog .billing-tablewrap {border-radius:0;border-color:var(--ui-line,#dedfe2)}
  .billing-reference-dialog #modal-content>h2 {
   background:#fff;color:var(--ui-ink,#303339);border-color:var(--ui-line,#dedfe2);
  }
  .billing-reference-dialog .billing-desk-context,
  .billing-reference-dialog .billing-composer>.billing-picker-column,
  .billing-reference-dialog .billing-composer>.billing-editor-column {
   background:#fff;border-color:var(--ui-line,#dedfe2);
  }
  .billing-reference-dialog .billing-directory-title,
  .billing-reference-dialog .billing-composer .billing-desk-search {
   background:#ededee;color:#60656e;border-color:var(--ui-line,#dedfe2);
  }
  .billing-reference-dialog .billing-catalog-branch>summary {
   color:var(--ui-accent,#00a6c4);
  }
  .billing-reference-dialog .billing-composer .billing-lines-heading {
   background:#fff;border-bottom-color:var(--ui-accent,#00a6c4);color:var(--ui-ink,#303339);
  }
  .billing-reference-dialog .billing-mode-tabs button {
   color:#60656e;background:#fff;border-color:var(--ui-line,#dedfe2);border-radius:2px;
  }
  .billing-reference-dialog .billing-mode-tabs button.active {
   color:var(--ui-accent,#00a6c4);background:#f0fafc;border-color:var(--ui-accent,#00a6c4);
  }
  .billing-reference-dialog .billing-discount-tools,
  .billing-reference-dialog .billing-payment {
   background:var(--ui-soft,#f5f6f8);border-color:var(--ui-line,#dedfe2);border-radius:2px;box-shadow:none;
  }
  .billing-reference-dialog .billing-own-project {border-color:var(--ui-line,#dedfe2);border-radius:2px;background:#fff}
  .billing-reference-dialog .charge-metric.due strong,
  .billing-reference-dialog .billing-footer-total {color:var(--ui-accent,#00a6c4)}
  .billing-reference-dialog .billing-quick-payment button {
   background:#fff;color:var(--ui-accent,#00a6c4);border-color:var(--ui-line,#dedfe2);border-radius:2px;
  }
  .billing-reference-dialog #modal-form>.actions {
   background:#fff;border-color:var(--ui-line,#dedfe2);box-shadow:none;
  }
  .billing-reference-dialog #modal-form>.actions>button.primary,
  .billing-reference-dialog button.primary:not(:disabled) {
   background:var(--ui-accent,#00a6c4);border-color:var(--ui-accent,#00a6c4);color:#fff;box-shadow:none;
  }

  /* Settings: a restrained directory, plain white detail sheets and cyan tabs. */
  .settings-layout .settings-sidebar {
   background:#fff;border-color:var(--ui-line,#dedfe2);border-radius:0;box-shadow:none;
  }
  .settings-layout .settings-search,.settings-layout .settings-group h2 {color:var(--ui-ink,#303339)}
  .settings-layout .settings-group button {color:var(--ui-ink,#303339);border-radius:2px;box-shadow:none}
  .settings-layout .settings-group button:hover {background:var(--ui-soft,#f5f6f8)!important}
  .settings-layout .settings-group button.active {
   background:#f2f2f4!important;color:var(--ui-ink,#303339)!important;box-shadow:inset 2px 0 var(--ui-accent,#00a6c4);
  }
  .settings-layout .settings-context {color:var(--ui-muted,#777c84)}
  .settings-layout .settings-main .card,.settings-layout .settings-preset-cards details,
  .settings-layout .clinic-name-preview {
   background:#fff;border-color:var(--ui-line,#dedfe2);border-radius:0;box-shadow:none;
  }
  .settings-layout .settings-scope {
   background:var(--ui-soft,#f5f6f8);border-left:2px solid var(--ui-accent,#00a6c4);color:#60656e;
  }
  .settings-layout .settings-combo-tabs button {background:#fff;border-color:var(--ui-line,#dedfe2);color:#60656e;border-radius:2px}
  .settings-layout .settings-combo-tabs button.active {color:#fff;background:var(--ui-accent,#00a6c4);border-color:var(--ui-accent,#00a6c4)}
  .settings-layout .settings-preset-cards summary,.settings-layout .clinic-name-preview strong {color:var(--ui-accent,#00a6c4)}

  /* Reporting cards and tables use the same chrome, while values and chart
     series keep their semantic colors and their original dimensions. */
  .report-workspace .report-sidebar {
   background:#fff;border-color:var(--ui-line,#dedfe2);border-radius:0;box-shadow:none;
  }
  .report-workspace .report-sidebar h2 {color:var(--ui-ink,#303339)}
  .report-workspace .report-sidebar button {color:#60656e;background:#fff;border-radius:0}
  .report-workspace .report-sidebar button.active {
   color:var(--ui-accent,#00a6c4);background:#f5f6f8;border-left-color:var(--ui-accent,#00a6c4);
  }
  .report-workspace .report-view-heading {
   background:#fff;border-bottom:1px solid var(--ui-line,#dedfe2);border-radius:0;
  }
  .report-workspace .report-view-heading h2 {color:var(--ui-ink,#303339)}
  .report-workspace .report-view-heading span {color:var(--ui-muted,#777c84)}
  .report-workspace .report-main .report-controls,
  .report-workspace .report-main .report-metric,
  .report-workspace .mobile-report-more-metrics,
  .report-workspace .desktop-report-source-details,
  .report-workspace .desktop-report-notes,
  .report-workspace .report-hero.mobile-report-line-card,
  .report-workspace .mobile-report-donut-card {
   background:#fff;border-color:var(--ui-line,#dedfe2);border-radius:2px;box-shadow:none;
  }
  .report-workspace.desktop-reports .mobile-report-overview>.report-metrics>.report-metric:first-child {
   background:#fff;border-color:var(--ui-line,#dedfe2);
  }
  .report-workspace .report-main .report-metric:hover {background:#fafafa;border-color:#b9dce3}
  .report-workspace .mobile-report-overview>h2,
  .report-workspace .mobile-report-line-card .report-hero-heading h2,
  .report-workspace .mobile-report-donut-card>h2 {color:var(--ui-ink,#303339)}
  .report-workspace .report-main th {
   color:var(--ui-muted,#777c84);background:#fff;border-color:var(--ui-line,#dedfe2);
  }
  .report-workspace .report-main td {border-color:var(--ui-line,#dedfe2)}
  .report-workspace .report-total {background:var(--ui-soft,#f5f6f8);border-radius:2px}

  /* Smart combination structure is unchanged. The three charge types retain
     their blue / amber / purple coding, unlike decorative container colors. */
  .smart-patient-context,.smart-workspace .smart-match-form,
  .smart-workspace .smart-options-panel,.smart-workspace .smart-wide-bill,
  .smart-workspace .smart-library,.smart-workspace .smart-documents-fold,
  .smart-workspace .smart-match-cards article {
   background:#fff;border:1px solid var(--ui-line,#dedfe2);border-radius:2px;box-shadow:none;
  }
  .smart-workspace .smart-match-cards article:nth-child(2),
  .smart-workspace .smart-match-cards article:nth-child(3) {border-top-color:var(--ui-line,#dedfe2)}
  .smart-patient-context h2,.smart-workspace .smart-match-form h2,
  .smart-workspace .smart-options-panel h2,.smart-workspace .smart-match-heading h3,
  .smart-workspace .smart-match-cards h3 {color:var(--ui-ink,#303339)}
  .smart-workspace .smart-wide-bill h2 {
   background:#fff;color:var(--ui-ink,#303339);border-color:var(--ui-line,#dedfe2);
  }
  .smart-workspace .smart-match-shortcuts {border-color:var(--ui-line,#dedfe2)}
  .smart-workspace .smart-match-shortcuts button {
   background:#fff;color:#60656e;border-color:var(--ui-line,#dedfe2);border-radius:2px;
  }
  .smart-workspace .smart-match-shortcuts button[aria-pressed=true],
  .smart-workspace .smart-match-shortcuts button.active,
  .smart-workspace .smart-match-cards article>button:not(:disabled) {
   color:#fff;background:var(--ui-accent,#00a6c4);border-color:var(--ui-accent,#00a6c4);box-shadow:none;
  }
  .smart-workspace .smart-match-inputs label:first-child input {
   border:1px solid var(--ui-accent,#00a6c4);background:#fff;
  }
  .smart-workspace .smart-related-toolbar button {border-radius:2px}
  .smart-workspace .smart-match-heading,.smart-workspace .smart-candidate-changes {border-color:var(--ui-line,#dedfe2)}

  /* Shared care records, inventory detail and handover surfaces. Warnings,
     completed/pending states and financial values are intentionally excluded. */
  .workflow-next,.stage-plan-manager .stage-progress,.stage-plan-manager .stage-plan-row,
  .stock-invoice-notice,.charge-teeth-panel,.admin-access-summary,
  .permission-groups fieldset,.permission-role-grid article,
  .record-search,.search-result,.visit-reference,.coordination-reference {
   background:#fff;border-color:var(--ui-line,#dedfe2);border-radius:2px;box-shadow:none;
  }
  .workflow-next {border-left:2px solid var(--ui-accent,#00a6c4)}
  .workflow-next strong,.stage-plan-manager .stage-plan-row>header strong {color:var(--ui-ink,#303339)}
  .stage-plan-manager .stage-invoices details {background:var(--ui-soft,#f5f6f8);border-radius:2px}
  #inventory-results th,.stock-detail .stock-dispatch-table th,
  #handover-current th,#handover-history th,#tasks-results th,
  #global-list th,.visit-reference th {
   background:#fff;color:var(--ui-muted,#777c84);border-color:var(--ui-line,#dedfe2);
  }
  #inventory-results td,.stock-detail .stock-dispatch-table td,
  #handover-current td,#handover-history td,#tasks-results td,
  #global-list td,.visit-reference td {border-color:var(--ui-line,#dedfe2)}
 }

 /* Phone retains its dedicated navigation, touch controls and card layouts. */
 @media (max-width:720px) {
  .settings-layout .settings-sidebar,.settings-layout .settings-main .card,
  .settings-layout .clinic-name-preview,.patient-profile .patient-profile-summary,
  .stage-plan-manager .stage-plan-row,.record-search,.search-result {
   border-color:var(--ui-line,#dedfe2);box-shadow:none;
  }
  .settings-layout .settings-scope {background:var(--ui-soft,#f5f6f8);color:#60656e}
  .settings-layout .settings-group button.active {
   background:#f0fafc!important;color:var(--ui-accent,#00a6c4)!important;box-shadow:inset 2px 0 var(--ui-accent,#00a6c4);
  }
  .report-workspace.mobile-reports .mobile-report-primary button.active,
  .billing-workspace.mobile-billing-list-minimal .billing-view-tabs>button.active {
   color:var(--ui-accent,#00a6c4);border-bottom-color:var(--ui-accent,#00a6c4);background:#fff;
  }
  .mobile-billing-simple .mobile-billing-steps>button.active,
  .mobile-billing-simple .billing-mode-tabs>button.active {
   color:var(--ui-accent,#00a6c4);border-bottom-color:var(--ui-accent,#00a6c4);
  }
  .smart-patient-context,.smart-workspace .smart-match-form,.smart-workspace .smart-options-panel,
  .smart-workspace .smart-wide-bill,.smart-workspace .smart-match-cards article {
   border-color:var(--ui-line,#dedfe2);box-shadow:none;
  }
 }
}
