/*
 * SIMCO green border rollout. Border-only styling; existing geometry, fills,
 * typography, status colors, and interaction behavior remain owned by pages.
 */
/* Important rules in this named layer outrank legacy unlayered !important
   borders. Keep semantic states in this same layer, after their base rules. */
@layer simco-green-borders {
@media screen {
  /* Disclosure framing is a base rule: a disclosure that is also a primary
     card must retain the stronger top edge from the card rules below. */
  body.admin-page main details.admin-disclosure-native,
  body.admin-page main .admin-disclosure,
  body.admin-page main .jobcard-section {
    border: 1px solid var(--green-action, #2E7E54) !important;
  }
  /* Major admin surfaces, including quote, settings, finance and operations. */
  body.admin-page main .ui-card:not([role="status"]):not([role="alert"]),
  body.admin-page main .ui-panel:not([role="status"]):not([role="alert"]),
  body.admin-page main .panel:not([role="status"]):not([role="alert"]),
  body.admin-page main .ui-kpi,
  body.admin-page main .ci-card,
  body.admin-page main .qe-card:not([role="status"]),
  body.admin-page main .qe-results-card,
  body.admin-page main .qe-crew-card,
  body.admin-page main .qe-comp-card,
  body.admin-page main .qe-send-card,
  body.admin-page main .qe-history-card,
  body.admin-page main .qe-intel-card,
  body.admin-page main .sh-section,
  body.admin-page main .settings-panel,
  body.admin-page main .overview-card,
  body.admin-page main .admin-card,
  body.admin-page main .info-card,
  body.admin-page main .ops-panel,
  body.admin-page main .admin-ops-card,
  body.admin-page main .admin-ops-action-panel:not(.payslip-delete-panel),
  body.admin-page main .admin-user-card,
  body.admin-page main .simco-auth-card,
  body.admin-page main .simco-error,
  body.admin-page main .qcard,
  body.admin-page main .svc-avail-card,
  body.admin-page main .insight-card,
  body.admin-page main .traffic-stat,
  body.admin-page main .branding-summary-card,
  body.admin-page main .branding-candidate-card,
  body.admin-page main .ts-total-card,
  body.admin-page main .analytics-card,
  body.admin-page main .source-chart-container,
  body.admin-page main .table-wrapper,
  body.admin-page main .booking-card-mobile,
  body.admin-page main .booking-media-section,
  body.admin-page main .backup-action,
  body.admin-page main .emp-hero,
  body.admin-page main .emp-clock-card,
  body.admin-page main .emp-hours-summary-card,
  body.admin-page main .emp-login-card,
  body.admin-page main .emp-profile-card,
  body.admin-page main .emp-section:not([hidden]),
  body.employee-portal main .emp-hero,
  body.employee-portal main .emp-clock-card,
  body.employee-portal main .emp-week-card,
  body.employee-portal main .emp-previous-week-card,
  body.employee-portal main .emp-invoice-card,
  body.employee-portal main .jc-card-full,
  body.employee-portal main .emp-hours-summary-card,
  body.employee-portal main .emp-login-card,
  body.employee-portal main .emp-profile-card,
  body.employee-portal main .emp-profile-page > div[style*="background"],
  body.employee-portal main .emp-section:not([hidden]),
  body.public-page main .pbx-panel,
  body.public-page main .pbx-thanks-card,
  body.public-page main .public-journey-panel,
  body.public-page main .quote-panel,
  body.public-page main .quote-detail-box,
  body.public-page main .quote-scope-box {
    border: 1px solid var(--green-action, #2E7E54) !important;
    border-top: 3px solid var(--green-deep, #1F4934) !important;
  }

  /* Smaller/inset surfaces use a quiet outline, never another top stripe. */
  body.admin-page main .qe-freq-card,
  body.admin-page main .admin-choice-card:not(.week-day-check),
  body.admin-page main .fin-link-card,
  body.public-page main .pf-service-card,
  body.admin-page main .admin-signature-panel,
  body.admin-page main .admin-disclosure,
  body.admin-page main details.admin-disclosure-native,
  body.admin-page main fieldset,
  body.employee-portal main .week-day-panel,
  body.employee-portal main .emp-hours-table,
  body.employee-portal main .jobcard-worker,
  body.public-page main .public-note-box,
  body.public-page main .public-info-box {
    border-color: var(--green-action, #2E7E54) !important;
  }

  /* Selected and active controls remain legible as selected; status colors stay semantic. */
  body.admin-page main .qe-freq-card.is-selected,
  body.admin-page main .admin-choice-card.is-selected,
  body.admin-page main .admin-choice-card[aria-checked="true"],
  body.admin-page main .qe-freq-card.selected,
  body.admin-page main .qe-freq-card.active,
  body.employee-portal main .week-day-panel.is-active,
  body.public-page main .pf-service-card.is-selected,
  body.public-page main .pf-service-card[aria-pressed="true"],
  body.public-page main .pf-service-card.selected {
    border-color: var(--green-deep, #1F4934) !important;
  }
  body.admin-page main .fin-pipe-card {
    border-left-color: var(--green-action, #2E7E54) !important;
    border-right-color: var(--green-action, #2E7E54) !important;
    border-bottom-color: var(--green-action, #2E7E54) !important;
  }
  body.admin-page main .fin-pipe-card.fin-pipe-active,
  body.admin-page main .fin-pipe-card.active,
  body.admin-page main .fin-pipe-card.is-active,
  body.admin-page main .fin-pipe-card[aria-current="page"] {
    border-left-color: var(--green-deep, #1F4934) !important;
    border-right-color: var(--green-deep, #1F4934) !important;
    border-bottom-color: var(--green-deep, #1F4934) !important;
  }

  /* Public quote and booking information boxes also appear outside the main
     content wrapper in some standalone public journeys. */
  body.public-page .public-note-box,
  body.public-page .public-info-box {
    border-color: var(--green-action, #2E7E54) !important;
  }

  /* Shared form controls across page and modal scopes. Buttons, checks, color
     swatches, ranges, and file inputs are intentionally omitted. */
  body.admin-page main input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"])),
  body.admin-page main select,
  body.admin-page main textarea,
  body.employee-portal main input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"])),
  body.employee-portal main select,
  body.employee-portal main textarea,
  body.public-page main input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"])),
  body.public-page main select,
  body.public-page main textarea,
  body.auth-shell main input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"])),
  body.auth-shell main select,
  body.auth-shell main textarea,
  body.admin-page .modal-overlay input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"])),
  body.admin-page .modal-overlay select,
  body.admin-page .modal-overlay textarea,
  body.admin-page .sched-modal-box input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"])),
  body.admin-page .sched-modal-box select,
  body.admin-page .sched-modal-box textarea,
  body.employee-portal .modal-overlay input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"])),
  body.employee-portal .modal-overlay select,
  body.employee-portal .modal-overlay textarea,
  body.public-page .modal-overlay input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"])),
  body.public-page .modal-overlay select,
  body.public-page .modal-overlay textarea {
    border-color: var(--green-action, #2E7E54) !important;
  }
  /* Controls in portalled dialogs and standalone documents have no main
     ancestor. This low-specificity fallback leaves state rules authoritative. */
  body:is(.admin-page, .public-page, .employee-portal, .auth-shell, .simco-job-card-page, .simco-quote-photos-page)
  :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]), select, textarea) {
    border-color: var(--green-action, #2E7E54) !important;
  }
  body:is(.admin-page, .public-page, .employee-portal, .auth-shell, .simco-job-card-page, .simco-quote-photos-page)
  :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]), select, textarea):focus {
    border-color: var(--green-deep, #1F4934) !important;
    outline: 2px solid var(--green-deep, #1F4934);
    outline-offset: 2px;
  }

  body.admin-page main input:focus,
  body.admin-page main select:focus,
  body.admin-page main textarea:focus,
  body.employee-portal main input:focus,
  body.employee-portal main select:focus,
  body.employee-portal main textarea:focus,
  body.public-page main input:focus,
  body.public-page main select:focus,
  body.public-page main textarea:focus,
  body.auth-shell main input:focus,
  body.auth-shell main select:focus,
  body.auth-shell main textarea:focus,
  body.admin-page .modal-overlay :is(input, select, textarea):focus,
  body.admin-page .sched-modal-box :is(input, select, textarea):focus,
  body.employee-portal .modal-overlay :is(input, select, textarea):focus,
  body.public-page .modal-overlay :is(input, select, textarea):focus {
    border-color: var(--green-deep, #1F4934) !important;
  }
  body.admin-page main :is(input, select, textarea):focus-visible,
  body.employee-portal main :is(input, select, textarea):focus-visible,
  body.public-page main :is(input, select, textarea):focus-visible,
  body.auth-shell main :is(input, select, textarea):focus-visible,
  body.admin-page .modal-overlay :is(input, select, textarea):focus-visible,
  body.admin-page .sched-modal-box :is(input, select, textarea):focus-visible,
  body.employee-portal .modal-overlay :is(input, select, textarea):focus-visible,
  body.public-page .modal-overlay :is(input, select, textarea):focus-visible {
    outline: 2px solid var(--green-deep, #1F4934);
    outline-offset: 2px;
  }
  body.admin-page :is(input, select, textarea):is([aria-invalid="true"], .is-invalid, .invalid, :user-invalid):focus,
  body.employee-portal :is(input, select, textarea):is([aria-invalid="true"], .is-invalid, .invalid, :user-invalid):focus,
  body.public-page :is(input, select, textarea):is([aria-invalid="true"], .is-invalid, .invalid, :user-invalid):focus,
  body.auth-shell :is(input, select, textarea):is([aria-invalid="true"], .is-invalid, .invalid, :user-invalid):focus,
  body.admin-page :is(input, select, textarea):is([aria-invalid="true"], .is-invalid, .invalid, :user-invalid),
  body.employee-portal :is(input, select, textarea):is([aria-invalid="true"], .is-invalid, .invalid, :user-invalid),
  body.public-page :is(input, select, textarea):is([aria-invalid="true"], .is-invalid, .invalid, :user-invalid),
  body.auth-shell :is(input, select, textarea):is([aria-invalid="true"], .is-invalid, .invalid, :user-invalid) {
    border-color: var(--danger, #b83c37) !important;
  }
  body:is(.simco-job-card-page, .simco-quote-photos-page)
  :is(input, select, textarea):is([aria-invalid="true"], .is-invalid, .invalid, :user-invalid) {
    border-color: var(--danger, #b83c37) !important;
  }
  body.admin-page :is(input, select, textarea):disabled,
  body.employee-portal :is(input, select, textarea):disabled,
  body.public-page :is(input, select, textarea):disabled,
  body.auth-shell :is(input, select, textarea):disabled {
    border-color: var(--border-default, #DDE4DE) !important;
  }
  body:is(.simco-job-card-page, .simco-quote-photos-page) :is(input, select, textarea):disabled {
    border-color: var(--border-default, #DDE4DE) !important;
  }

  /* Real popup surfaces and their menus; option rows and navigation are excluded. */
  body.admin-page .modal-overlay .modal-box,
  body.admin-page .modal-overlay .sched-modal-box,
  body.admin-page .sched-modal-box,
  body.admin-page .ci-modal-dialog,
  body.admin-page .tmpl-modal,
  body.admin-page .light-modal .modal-box,
  body.admin-page .notif-panel,
  body.employee-portal .notif-panel {
    border: 1px solid var(--green-action, #2E7E54) !important;
    border-top: 3px solid var(--green-deep, #1F4934) !important;
  }
  body.admin-page .modal-overlay .modal-box,
  body.admin-page .modal-overlay .sched-modal-box,
  body.admin-page .sched-modal-box {
    border-top: 3px solid var(--green-deep, #1F4934) !important;
  }
  body.admin-page main .sched-search-results,
  body.admin-page main .admin-chip-menu,
  body.admin-page main .notif-cat-dropdown,
  body.admin-page .modal-overlay .sched-search-results,
  body.admin-page .sched-modal-box .sched-search-results {
    border-color: var(--green-action, #2E7E54) !important;
  }

  /* Interactive standalone job card and quote-photo page use scoped body
     classes; print rules in the job-card template remain untouched. */
  body.simco-job-card-page .jc-card {
    border: 1px solid var(--green-action, #2E7E54) !important;
    border-top: 3px solid var(--green-deep, #1F4934) !important;
  }
  body.simco-job-card-page .jobcard-section {
    border-color: var(--green-action, #2E7E54) !important;
  }
  body.simco-job-card-page .jc-box:not(.jc-admin) h3 {
    border-bottom-color: var(--green-action, #2E7E54) !important;
  }
  body.simco-quote-photos-page .card {
    border-color: var(--green-action, #2E7E54) !important;
    border-top: 3px solid var(--green-deep, #1F4934) !important;
  }
  body.simco-quote-photos-page .photo-item {
    border-color: var(--green-action, #2E7E54) !important;
  }
  body.error-shell .simco-error {
    border-color: var(--green-action, #2E7E54) !important;
    border-top: 3px solid var(--green-deep, #1F4934) !important;
  }
}
}
