/* ASW visual theme. Load after style.css and invoices.css.
   Screen-only overrides preserve the invoice print/export layouts. */
@media screen {
  @font-face {
    font-family: Inter;
    src: url('/brand/inter-latin.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
  }
  :root {
    --asw-primary: hsl(215 65% 45%);
    --asw-primary-hover: hsl(215 66% 37%);
    --asw-primary-soft: #eef4fd;
    --asw-primary-line: #cbdcf3;
    --asw-secondary: hsl(215 25% 27%);
    --asw-ink: #0f1729;
    --asw-muted: #5c6b80;
    --asw-cyan: #76dce8;
    --asw-navy: #14335d;
    --asw-border: #e0e7ef;
    --asw-surface: #fff;
    --asw-background: #f4f7fb;
    --asw-radius: 12px;
    --asw-sidebar-width: 244px;
    --bg: var(--asw-background);
    --panel: var(--asw-surface);
    --ink: var(--asw-ink);
    --muted: var(--asw-muted);
    --border: var(--asw-border);
    --green: var(--asw-primary);
    --green-light: var(--asw-primary-soft);
    --sidebar: var(--asw-navy);
    --shadow: 0 6px 24px #18315308;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    color: var(--asw-ink);
    background: var(--asw-background);
  }
  body { font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.5; }
  a { color: var(--asw-primary); }
  :focus-visible { outline: 3px solid #80a9de; outline-offset: 3px; }
  h1 { margin-bottom: 8px; font-size: 28px; line-height: 1.25; font-weight: 650; letter-spacing: -.8px; }
  .subtitle { color: var(--asw-muted); font-size: 14px; line-height: 1.7; }
  .eyebrow { color: #60738e; font-size: 11px; font-weight: 650; letter-spacing: 1.3px; }
  .page-heading { align-items: center; gap: 18px; margin-bottom: 25px; }
  .skip-link { position: fixed; top: 10px; left: 12px; z-index: 100; padding: 11px 16px; border: 2px solid var(--asw-primary); border-radius: 7px; background: #fff; color: var(--asw-primary); font-size: 13px; font-weight: 600; transform: translateY(-180%); }
  .skip-link:focus { transform: translateY(0); }

  /* Original ASW Tech Solutions artwork supplied by the owner, unchanged.
     The layout excludes only the square export's transparent outer margins. */
  .brand-logo-frame { position: relative; display: block; flex: 0 0 auto; width: 190px; height: 66px; overflow: hidden; background: #fff; }
  .brand-logo-frame img { position: absolute; top: 50%; left: 0; display: block; width: 100%; max-width: none; height: auto; transform: translateY(-51.8%); }
  .product-label { display: block; margin-top: 8px; color: #53647c; font-size: 10px; font-weight: 650; letter-spacing: 1.9px; line-height: 1.5; }
  .sidebar { width: var(--asw-sidebar-width); padding: 22px 16px 16px; border-right: 1px solid var(--asw-border); background: #fff; color: #5b6a80; box-shadow: 2px 0 12px #1a365006; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d1ddec transparent; }
  .sidebar > * { flex-shrink: 0; }
  .sidebar .brand { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin: 0 8px 22px; padding: 0 0 23px; border-bottom: 1px solid #e8edf4; color: var(--asw-ink); }
  .sidebar .brand-logo-frame { width: 188px; height: 64px; }
  .sidebar .product-label { margin-top: 8px; }
  .nav-label { margin: 22px 13px 10px; color: #78859a; font-size: 10px; font-weight: 650; letter-spacing: 1.4px; }
  .nav-link,
  button.nav-link { position: relative; display: flex; align-items: center; min-height: 46px; gap: 11px; margin: 4px 0; padding: 12px 14px; border-radius: 8px; color: #52637c; background: transparent; font-size: 13px; font-weight: 500; line-height: 1.5; }
  .nav-link svg { width: 19px; height: 19px; color: #788ca8; }
  .nav-link:hover,
  button.nav-link:hover { background: #f4f7fc; color: var(--asw-primary); }
  .nav-link.active,
  button.nav-link.active { color: var(--asw-primary); background: #eaf2ff; font-weight: 650; }
  .nav-link.active::before { position: absolute; top: 11px; bottom: 11px; left: 0; width: 3px; border-radius: 0 3px 3px 0; background: var(--asw-primary); content: ''; }
  .nav-link.active svg { color: var(--asw-primary); }
  .nav-bottom { padding-top: 22px; }
  .workspace { margin-top: 19px; padding: 14px; border: 1px solid #dfe7f2; border-radius: 10px; background: #f7faff; }
  .workspace-label { color: #71819a; font-size: 10px; letter-spacing: 1px; }
  .workspace-name { color: #3d536d; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
  .workspace .dot { flex-shrink: 0; background: #368467; }
  .workspace-company-icon { display: grid; place-items: center; flex: 0 0 31px; width: 31px; height: 31px; border-radius: 7px; background: #e6effc; color: #5880b3; }
  .workspace-company-icon svg { width: 17px; height: 17px; }
  .sidebar-footer { margin: 16px 10px 0; color: #77869a; font-size: 11px; line-height: 1.6; }
  .sidebar-footer a { color: #4c6e98; }
  .main { width: calc(100% - var(--asw-sidebar-width)); margin-left: var(--asw-sidebar-width); min-width: 0; }
  .topbar { position: sticky; top: 0; z-index: 15; height: 76px; gap: 18px; padding: 0 34px; border-bottom: 1px solid var(--asw-border); background: #fff; }
  .breadcrumb { min-width: 0; gap: 11px; color: #7b899b; font-size: 12px; }
  .breadcrumb b { color: #4b5c73; font-weight: 600; }
  .breadcrumb > span:first-child { color: var(--asw-primary); font-weight: 650; }
  .topbar-right { min-width: 0; gap: 17px; }
  .institutional-link { display: inline-flex; align-items: center; gap: 6px; color: #526d91; font-size: 12px; font-weight: 500; white-space: nowrap; }
  .institutional-link:hover { color: var(--asw-primary-hover); text-decoration: underline; text-underline-offset: 4px; }
  .institutional-link svg { width: 15px; height: 15px; }
  .environment-switch { gap: 8px; color: #68798e; font-size: 12px; }
  .environment-switch select { min-height: 40px; max-width: 160px; padding: 8px 12px; border: 1px solid #d2dfef; border-radius: 7px; background: #f4f8ff; color: #2a578f; font-size: 12px; font-weight: 600; }
  .env-badge { color: #82601e; background: #fff8e9; border-color: #ecddb9; font-size: 11px; }
  .userbox { gap: 10px; padding-left: 17px; border-left-color: #e0e7ef; }
  .userbox strong { color: #35475e; font-size: 12px; }
  .userbox small { color: #7a889b; font-size: 11px; }
  .avatar { background: #edf3fc; color: #47668f; font-size: 12px; }
  .content { max-width: 1560px; padding: 30px 34px 38px; }
  .page-footer { margin-top: 27px; color: #7b899c; font-size: 11px; line-height: 1.6; }

  /* Buttons and inputs share the same comfortable baseline height. */
  .btn,
  .btn.small,
  .invoice-detail-dialog .btn,
  .invoice-row-actions .btn { min-height: 44px; padding: 10px 15px; border-color: #d6e0ed; border-radius: 8px; background: #fff; color: #425773; font-size: 13px; font-weight: 600; line-height: 1.5; box-shadow: none; }
  .btn:hover { background: #f4f7fc; border-color: #c2d3e8; color: #315b8e; }
  .btn.primary,
  .invoice-detail-dialog .btn.primary { border-color: var(--asw-primary); background: var(--asw-primary); color: #fff; box-shadow: 0 3px 6px #205da414; }
  .btn.primary:hover,
  .invoice-detail-dialog .btn.primary:hover { border-color: var(--asw-primary-hover); background: var(--asw-primary-hover); color: #fff; }
  .btn.subtle { border-color: transparent; background: transparent; }
  .btn.subtle:hover { border-color: #e2eaf5; background: #f0f5fc; }
  .btn.danger,
  .invoice-detail-dialog .btn.danger { border-color: #e2c6c2; background: #fff8f6; color: #9d4238; }
  .btn.danger:hover,
  .invoice-detail-dialog .btn.danger:hover { border-color: #ccaaa3; background: #ffefeb; color: #87352e; }
  .btn svg { width: 17px; height: 17px; }
  .btn:disabled { box-shadow: none; }
  .form-control,
  input,
  select,
  textarea { min-height: 44px; padding: 11px 12px; border-color: #d2dce8; border-radius: 7px; background: #fff; color: #263c57; font-size: 14px; line-height: 1.5; }
  textarea { min-height: 106px; }
  input::placeholder,
  textarea::placeholder { color: #8794a6; }
  label { color: #4d5e75; font-size: 12px; font-weight: 600; }
  label > input,
  label > select,
  label > textarea { margin-top: 7px; }
  .form-grid { gap: 19px; }
  .form-grid > *,
  .form-grid label { min-width: 0; }
  .field-help { color: #687a90; font-size: 12px; line-height: 1.65; }
  .checkbox { color: #536981; font-size: 13px; }
  .checkbox input { width: 17px; height: 17px; min-height: 0; accent-color: var(--asw-primary); }
  .check-field { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; font-size: 13px; line-height: 1.6; }
  .check-field input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; min-height: 18px; margin: 2px 0 0; accent-color: var(--asw-primary); }
  input[readonly] { background: #f3f6fb; color: #4b6485; }
  .form-actions { gap: 10px; padding-top: 20px; margin-top: 23px; border-top-color: #e1e8f1; }
  .filters { gap: 12px; padding: 19px 23px; }
  .filters .search { max-width: 410px; }
  .search svg { top: 14px; left: 12px; color: #8495aa; }
  .search input { padding-left: 37px; }
  .filters select { max-width: 185px; }
  .postal-lookup .btn { min-height: 44px; }

  /* Panels, data and feedback. Fiscal success/error colours stay semantic. */
  .card,
  .stat { border: 1px solid var(--asw-border); border-radius: var(--asw-radius); background: #fff; box-shadow: 0 3px 14px #243a5504; }
  .card-header { gap: 15px; padding: 23px 24px 20px; }
  .card-header h2 { color: #283b55; font-size: 15px; font-weight: 650; }
  .card-header p { color: #77869a; font-size: 12px; line-height: 1.6; }
  .card-body { padding: 0 24px 24px; }
  .period-label { padding: 7px 10px; border-color: #dde5ee; border-radius: 6px; color: #63768e; font-size: 11px; }
  .section-link { gap: 7px; color: var(--asw-primary); font-size: 12px; font-weight: 500; }
  table { font-size: 14px; }
  th { padding: 14px 20px; border-color: #e3e9f1; background: #f8fafd; color: #70819a; font-size: 11px; font-weight: 600; letter-spacing: .5px; }
  td { padding: 17px 20px; border-bottom-color: #e9eef5; color: #4d6079; }
  tbody tr:hover { background: #f8faff; }
  .table-name { color: #304762; font-weight: 500; }
  .td-secondary { color: #718299; font-size: 12px; line-height: 1.5; }
  .mini-avatar { width: 33px; height: 33px; border-radius: 8px; background: #edf3fb; color: #587da9; font-size: 11px; }
  .amount { color: #273e5b; }
  .table-footer { padding: 16px 23px; border-top-color: #e4ebf3; color: #75869d; font-size: 12px; }
  .badge { padding: 5px 8px; border-radius: 5px; font-size: 11px; }
  .badge.authorized,
  .badge.paid,
  .badge.active,
  .badge.simulated { color: #23734f; background: #e8f5ed; }
  .badge.rejected,
  .badge.overdue { color: #a14436; background: #fff0eb; }
  .badge.unknown,
  .badge.cancelling,
  .badge.processing { color: #89621b; background: #fff5db; }
  .badge.cancelled,
  .badge.inactive { color: #796a70; background: #f2edf0; }
  .badge.draft,
  .badge.open,
  .badge.partial { color: #866422; background: #fcf5e4; }
  .notice { padding: 14px 16px; border-radius: 8px; color: #806220; background: #fffaf0; border-color: #ebdfc5; font-size: 13px; line-height: 1.75; }
  .notice p { margin: 5px 0 0; }
  .notice.green,
  .notice.success { color: #316d50; background: #f0f8f2; border-color: #cee4d5; }
  .notice.info { color: #345e91; background: #f0f6ff; border-color: #d3e2f6; }
  .error-inline { color: #9d4036; background: #fff0ed; border: 1px solid #f0d2cb; border-radius: 8px; font-size: 13px; }
  .error-inline:empty { display: none; }
  .empty { padding: 56px 24px; }
  .empty svg { color: #90a8c5; }
  .empty h3 { color: #3b5574; font-size: 17px; }
  .empty p { color: #718198; font-size: 14px; }
  .loading { color: #607b9e; font-size: 14px; }
  #toast { background: #254b7c; color: #fff; border-radius: 9px; font-size: 13px; }
  #toast.error { background: #943f38; }
  dialog { border-color: #d7e1ee; border-radius: 14px; color: var(--asw-ink); box-shadow: 0 22px 90px #0d244b30; }
  dialog::backdrop { background: #10264180; }
  .modal-head { position: sticky; top: 0; z-index: 2; padding: 23px 27px 20px; border-color: #e0e7ef; background: #fff; }
  .modal-head h2 { color: #243b58; font-size: 21px; font-weight: 650; }
  .modal-head p { color: #71839a; font-size: 13px; }
  .close-btn { display: grid; place-items: center; flex-shrink: 0; min-width: 40px; min-height: 40px; margin: -6px -9px 0 0; border-radius: 7px; color: #74879f; }
  .close-btn:hover { background: #f0f5fc; color: #456a9c; }
  .modal-body { padding: 24px 27px; }
  .modal-summary { background: #f1f6fd; border: 1px solid #dce7f6; border-radius: 9px; }
  .modal-summary span { color: #687f9b; font-size: 12px; }
  .modal-summary b { color: #315887; }
  .detail-grid dt { color: #6b7e95; font-size: 12px; }
  .detail-grid dd { color: #344d6b; font-size: 14px; }
  .payment-row { gap: 12px; font-size: 13px; }
  .payment-row span { color: #6f8299; font-size: 12px; }

  /* Dashboard banner and operational cards. */
  .dashboard-hero { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 28px; min-height: 174px; padding: 27px 31px; margin: 0 0 25px; border: 1px solid #21456f; border-radius: 14px; background: linear-gradient(112deg, #143159, #1b4677); color: #fff; overflow: hidden; }
  .dashboard-hero::after { position: absolute; top: -160px; right: -120px; width: 480px; height: 480px; border: 1px solid #95c1e41a; border-radius: 50%; box-shadow: 0 0 0 55px #96c2df06; pointer-events: none; content: ''; }
  .dashboard-hero-copy { position: relative; z-index: 1; flex: 1 1 auto; min-width: 0; max-width: 610px; }
  .dashboard-hero-copy .eyebrow { color: #a8c4e6; font-size: 10px; letter-spacing: 1.4px; margin-bottom: 10px; }
  .dashboard-hero-copy h2 { margin: 0 0 10px; color: #fff; font-size: clamp(23px, 2vw, 29px); font-weight: 600; line-height: 1.3; letter-spacing: -.6px; }
  .dashboard-hero-copy h2 span { color: var(--asw-cyan); }
  .dashboard-hero-copy p { max-width: 560px; margin: 0; color: #c4d5eb; font-size: 13px; line-height: 1.75; }
  .dashboard-hero-status { position: relative; z-index: 1; display: flex; flex: 0 0 246px; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; padding-left: 28px; border-left: 1px solid #d4e6ff26; }
  .dashboard-hero-status > span,
  .dashboard-hero-status .hero-provider,
  .dashboard-hero-status .provider-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid #c5def42e; border-radius: 5px; color: #c7dbf1; font-size: 10px; line-height: 1.5; }
  .dashboard-hero-status .hero-provider svg { width: 13px; height: 13px; }
  .dashboard-hero-status > strong,
  .dashboard-hero-status h3 { margin: 0; color: #fff; font-size: 16px; font-weight: 600; line-height: 1.4; }
  .dashboard-hero-status p { margin: 0; color: #bfd4ec; font-size: 12px; line-height: 1.6; }
  .dashboard-hero-status .btn { min-height: 38px; padding: 8px 12px; border-color: #dce9f4; background: #fff; color: #284f7e; font-size: 12px; }
  .dashboard-hero-status .btn:hover { background: #edf5ff; border-color: #edf5ff; }
  .stats { gap: 17px; margin-bottom: 24px; }
  .stat { min-width: 0; padding: 21px 22px; }
  .stat-top { margin-bottom: 17px; color: #667991; font-size: 12px; }
  .stat-icon { width: 35px; height: 35px; border-radius: 9px; background: #eaf2ff; color: #4675b4; }
  .stat-icon svg { width: 18px; height: 18px; }
  .stat:nth-child(2) .stat-icon { color: #478368; background: #edf7f0; }
  .stat:nth-child(3) .stat-icon { color: #b18531; background: #fff7e7; }
  .stat:nth-child(4) .stat-icon { color: #b76956; background: #fff0eb; }
  .stat-value { color: #213a5b; font-size: clamp(23px, 2vw, 29px); font-weight: 650; letter-spacing: -.8px; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere; }
  .stat-foot,
  .stat-foot.green { align-items: flex-start; margin-top: 11px; color: #788aa0; font-size: 11px; line-height: 1.55; }
  .stat-foot svg { margin-top: 2px; }
  .grid-dashboard { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 22px; }
  .grid-dashboard > * { min-width: 0; }
  .flow-summary { gap: 34px; padding: 0 24px 15px; }
  .flow-summary span { color: #8090a5; font-size: 11px; }
  .flow-summary b { margin-top: 4px; color: #345785; font-size: 19px; font-weight: 600; }
  .chart { height: 205px; }
  .chart text { fill: #7e90a9; font-size: 11px; }
  .chart .grid { stroke: #e4ebf4; }
  .chart g rect:nth-of-type(1) { fill: #477dc6; }
  .chart g rect:nth-of-type(2) { fill: #c2d7f2; }
  .legend { gap: 20px; color: #687f9a; font-size: 11px; }
  .legend i { background: #477dc6; }
  .legend .soft { background: #c2d7f2; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .quick-action { min-width: 0; padding: 16px 15px; border-color: #e1e9f3; border-radius: 9px; background: #f9fbfe; color: #436085; }
  .quick-action:hover { border-color: #c4d7f0; background: #f0f6ff; }
  .quick-action svg { width: 20px; height: 20px; color: #4b7bb6; margin-bottom: 12px; }
  .quick-action b { color: #3c5575; font-size: 12px; font-weight: 600; }
  .quick-action span { color: #8191a7; font-size: 11px; line-height: 1.6; }
  .provider-mini { gap: 9px; margin-top: 18px; padding-top: 16px; border-top-color: #e3ebf5; color: #6e85a1; font-size: 11px; }
  .welcome-strip { border-color: #d3e2f5; background: #f1f7ff; color: #456a99; border-radius: 10px; }
  .welcome-strip > svg { color: #5c8dc5; }
  .welcome-strip strong { color: #335e94; }
  .welcome-strip p { color: #607d9f; font-size: 13px; }

  /* Settings, fiscal catalogues and integration documentation. */
  .settings-card { padding: 25px; }
  .settings-card h2 { color: #2b4465; font-size: 17px; }
  .settings-card > p { color: #71839a; font-size: 13px; }
  .provider-card { padding: 18px; border-color: #dfe7f1; border-radius: 9px; }
  .provider-card h3 { color: #354e6f; font-size: 14px; }
  .provider-card p,
  .provider-card ul,
  .provider-card a { font-size: 12px; line-height: 1.8; }
  .provider-card p,
  .provider-card ul { color: #6a7e99; }
  .code { border-radius: 9px; background: #172d4b; color: #d3e1f4; font-size: 12px; line-height: 1.75; }
  .endpoint { gap: 10px; padding: 14px 0; font-size: 12px; }
  .endpoint b { padding: 4px 7px; border-radius: 4px; color: #3367a7; background: #edf4ff; font-size: 10px; }
  .secret-box { border-color: #b3cbe9; background: #eef5ff; color: #315c92; font-size: 13px; }
  summary { color: #3e6699; font-size: 13px; }
  .service-catalog { border-color: #dbe5f1; border-radius: 10px; padding: 16px; }
  .catalog-results { border-color: #dbe5f0; border-radius: 8px; }
  .catalog-results table { font-size: 12px; }
  .catalog-results th { padding: 12px 10px; background: #f1f6fc; color: #617a9a; font-size: 10px; }
  .catalog-results td { padding: 12px 10px; font-size: 12px; line-height: 1.6; }
  .selected-service-code { padding: 12px; border-radius: 8px; color: #45688f; background: #f0f6fe; font-size: 13px; }
  .audit-entry { padding: 15px 0; border-color: #e3eaf3; }
  .audit-entry svg { color: #708fb6; }
  .audit-entry strong { color: #435f82; font-size: 13px; }
  .audit-entry p { color: #7b8da5; font-size: 12px; }

  /* Rebrand navigation and financial panels; preserve fiscal tone modifiers. */
  .invoice-metrics,
  .invoice-workspace,
  .invoice-detail-dialog { --invoice-ink: var(--asw-ink); --invoice-muted: #64768d; --invoice-line: var(--asw-border); --invoice-soft: #f4f7fc; --invoice-green: var(--asw-primary); }
  .invoice-metric:not(.success):not(.warning) > strong { color: #243f62; }
  .invoice-tabs { border-bottom-color: #e0e8f3; }
  .invoice-tab { color: #657c97; }
  .invoice-tab:hover { background: #f5f8fd; color: #376da9; }
  .invoice-tab.is-active { color: #2b64ab; background: #f1f6fe; }
  .invoice-tab.is-active::after { background: var(--asw-primary); }
  .invoice-tab .tab-count { color: #6e819b; background: #eef2f7; }
  .invoice-tab.is-active .tab-count { color: #3b6ba9; background: #dfebfb; }
  .invoice-reference { color: #2c62a5; }
  .invoice-reference:hover { color: #1d4d87; }
  .invoice-table th { background: #f7f9fd; color: #6b809a; }
  .invoice-table tbody tr:hover { background: #f7faff; }
  .invoice-table tbody tr:focus-within { background: #eef5ff; }
  .invoice-table .amount { color: #29496f; }
  .invoice-client > strong { color: #334e70; }
  .invoice-client small,
  .invoice-status-note { color: #6d819c; }
  .invoice-section h3,
  .invoice-party > strong { color: #314e73; }
  .invoice-section p,
  .invoice-section dd,
  .invoice-party { color: #516b8b; }
  .invoice-amount { border-color: #d8e5f5; background: #f3f7fd; }
  .invoice-amount .money-value { color: #2e619f; }
  .invoice-amount > span,
  .invoice-amount > small,
  .invoice-amount .field-help,
  .invoice-amount dt { color: #6b84a4; }
  .invoice-amount dl { border-top-color: #d8e5f5; }
  .invoice-amount dd { color: #3f638f; }
  .invoice-doc-panel { border-color: #d8e5f5; background: #f4f8fe; }
  .invoice-doc-panel > div > span { color: #7288a5; }
  .invoice-doc-panel > div > strong { color: #315784; }
  .invoice-detail-dialog .invoice-toolbar.actions [data-action="invoice-pdf"],
  .invoice-row-actions [data-action="invoice-pdf"] { border-color: #c3d7f0; background: #eef5ff; color: #3569a9; }
  .invoice-detail-dialog .invoice-toolbar.actions [data-action="invoice-pdf"]:hover,
  .invoice-row-actions [data-action="invoice-pdf"]:hover { border-color: #a6c2e6; background: #e2eeff; color: #28568e; }
  .invoice-detail-dialog .close-btn:hover { background: #eef4fc; color: #426d9f; }
  .invoice-detail-dialog .technical-details,
  .invoice-detail-dialog .technical-details pre { background: #f3f6fb; border-color: #dbe4f0; color: #486380; }
  .invoice-detail-dialog .technical-details > summary { color: #56759b; }
  .invoice-loading { border-color: #d7e4f5; background: #f4f8fe; color: #4c729f; }
  .invoice-loading::before { border-color: #d2e1f3; border-top-color: #5484bd; }

  /* ASW Tech Solutions access page: original artwork, clear product copy and focused form. */
  .auth-page { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); min-height: 100dvh; background: #f5f7fb; }
  .auth-story { display: flex; flex-direction: column; justify-content: space-between; gap: 38px; min-width: 0; padding: 32px clamp(34px, 4.6vw, 76px); background: radial-gradient(ellipse at 5% 5%, #1d4a79 0, transparent 55%), linear-gradient(150deg, #163658, #0c203a); color: #fff; }
  .auth-story::after { width: 600px; height: 600px; bottom: -400px; left: auto; right: -290px; border-color: #8bbfde24; box-shadow: 0 0 0 80px #8bbfde07, 0 0 0 160px #8bbfde04; }
  .auth-brand-header { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
  .auth-brand-home { display: block; flex: 0 0 auto; border-radius: 4px; }
  .auth-logo { position: relative; display: block; width: 116px; height: 114px; overflow: hidden; background: transparent; }
  .auth-logo img { position: absolute; top: 50%; left: 50%; display: block; width: 166.6667%; max-width: none; height: auto; transform: translate(-50%, -49.5%); }
  .auth-product-tag { padding: 8px 12px; border: 1px solid #91b7d538; border-radius: 6px; background: #91b7d509; color: #dce9f5; font-size: 11px; font-weight: 500; white-space: nowrap; }
  .auth-brand-copy { position: relative; z-index: 1; width: 100%; max-width: 495px; padding: 0; }
  .auth-kicker { display: flex; align-items: center; gap: 10px; color: #a9c7de; font-size: 10px; font-weight: 600; letter-spacing: 1.6px; line-height: 1.7; }
  .auth-kicker::before { content: ''; display: block; width: 24px; height: 2px; background: #71d2df; }
  .auth-story h1 { max-width: 520px; margin: 19px 0 22px; color: #fff; font-size: clamp(38px, 3.5vw, 55px); font-weight: 600; line-height: 1.15; letter-spacing: -1.7px; }
  .auth-story h1 em { color: #83d7e0; font-style: normal; }
  .auth-story .auth-intro { max-width: 405px; margin: 0; color: #c0d0e0; font-size: 14px; line-height: 1.85; }
  .auth-benefits { display: grid; gap: 22px; padding: 28px 0 0; margin: 27px 0 0; border-top: 1px solid #a6c0d526; list-style: none; }
  .auth-benefits li { display: flex; align-items: center; gap: 14px; min-width: 0; }
  .auth-benefit-icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border: 1px solid #9ec4eb24; border-radius: 9px; background: #92b8d90d; color: #8ecbdf; }
  .auth-benefit-icon svg { width: 18px; height: 18px; }
  .auth-benefits strong { display: block; margin: 0 0 4px; color: #f2f6fb; font-size: 13px; font-weight: 600; }
  .auth-benefits li > div > span { color: #b0c4d8; font-size: 12px; line-height: 1.6; }
  .auth-story .auth-brand-footer { position: relative; z-index: 1; display: block; padding: 22px 0 0; border-top: 1px solid #a6c0d526; }
  .auth-provider-label { color: #9ab4cb; font-size: 9px; font-weight: 600; letter-spacing: 1.5px; }
  .auth-providers { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; margin-top: 9px; color: #dfebf5; font-size: 11px; font-weight: 500; }
  .auth-providers span + span { padding-left: 20px; border-left: 1px solid #a6c0d540; }
  .auth-form-wrap { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 32px; min-width: 0; padding: 38px clamp(28px, 4vw, 64px) 30px; background: radial-gradient(ellipse at top right, #eaf0fa, transparent 65%), #f5f7fb; }
  .auth-utility { display: flex; justify-content: flex-end; width: 100%; max-width: 480px; }
  .auth-utility a { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; color: #586d86; font-size: 11px; font-weight: 500; }
  .auth-utility svg { width: 14px; height: 14px; }
  .auth-utility a:hover { color: #225dad; text-decoration: underline; text-underline-offset: 4px; }
  .auth-access { width: 100%; max-width: 450px; padding: 35px 34px 0; border: 1px solid #e0e7f0; border-radius: 16px; background: #fff; box-shadow: 0 18px 56px #18396108, 0 2px 6px #18396103; }
  .auth-form { width: 100%; max-width: none; padding-bottom: 33px; }
  .auth-form-heading { margin-bottom: 28px; }
  .auth-form-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 24px; border: 1px solid #dce7f7; border-radius: 11px; color: #326bb5; background: #f0f5fc; }
  .auth-form-symbol svg { width: 21px; height: 21px; }
  .auth-form .eyebrow { color: #56769e; font-size: 9px; font-weight: 650; letter-spacing: 1.6px; }
  .auth-form h2 { margin: 12px 0 10px; color: #162f4e; font-size: 29px; font-weight: 650; line-height: 1.25; letter-spacing: -.9px; }
  .auth-form-heading p { margin: 0; color: #63748a; font-size: 13px; line-height: 1.75; }
  .auth-form label { margin-bottom: 20px; color: #344b68; font-size: 12px; font-weight: 550; }
  .auth-form input { min-height: 48px; margin-top: 9px; padding: 12px 14px; border-color: #d7e0ec; border-radius: 7px; background: #fcfdff; font-size: 14px; }
  .auth-form input::placeholder { color: #8090a5; }
  .auth-form input:focus { border-color: #658dc5; outline: 3px solid #2866bd17; outline-offset: 0; background: #fff; }
  .auth-form .auth-submit { display: flex; width: 100%; min-height: 49px; justify-content: space-between; margin-top: 25px; padding: 12px 16px; border-radius: 7px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 10px #2866bd1a; }
  .auth-form .auth-submit:disabled { opacity: .72; cursor: wait; }
  .auth-access-help { margin: 0 -34px; padding: 20px 34px; border-top: 1px solid #e8edf4; border-radius: 0 0 16px 16px; background: #fafbfd; }
  .auth-access-help strong { color: #49617d; font-size: 11px; font-weight: 600; }
  .auth-access-help p { margin: 5px 0 0; color: #64768c; font-size: 11px; line-height: 1.7; }
  .auth-form-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 18px; width: 100%; max-width: 450px; margin: 0; padding: 0; border: 0; color: #65788f; font-size: 10px; line-height: 1.6; }
  .auth-form-footer a { color: #576f8d; font-size: 10px; }
  .auth-form-footer a:hover { color: #225dad; text-decoration: underline; text-underline-offset: 4px; }
}

@media screen and (min-width: 1550px) {
  .content { padding-top: 36px; }
  .dashboard-hero { min-height: 187px; padding: 31px 34px; }
  .stat { padding: 23px 25px; }
  .stat-value { font-size: 31px; }
  .chart { height: 230px; }
  .quick-action { padding: 19px 16px; }
}

@media screen and (max-width: 1180px) {
  :root { --asw-sidebar-width: 220px; }
  .sidebar { padding-right: 13px; padding-left: 13px; }
  .sidebar .brand-logo-frame { width: 173px; height: 60px; }
  .content { padding: 26px 25px 34px; }
  .topbar { padding: 0 25px; }
  .topbar-right { gap: 12px; }
  .institutional-link { font-size: 11px; }
  .environment-switch { font-size: 11px; }
  .userbox { gap: 8px; padding-left: 12px; }
  .stat { padding: 18px; }
  .stat-top { font-size: 11px; }
  .stats { gap: 13px; }
  .dashboard-hero { padding: 25px; gap: 22px; }
  .dashboard-hero-status { flex-basis: 210px; padding-left: 23px; }
  .dashboard-hero-copy h2 { font-size: 24px; }
  .grid-dashboard { grid-template-columns: minmax(0, 1fr) minmax(270px, .86fr); gap: 18px; }
  .card-header { padding: 20px; }
  .card-body { padding: 0 20px 20px; }
  .flow-summary { padding-left: 20px; gap: 20px; }
  .flow-summary b { font-size: 17px; }
  .quick-action { padding: 14px 12px; }
  .quick-action b { font-size: 11px; }
}

@media screen and (max-width: 980px) {
  .grid-dashboard { grid-template-columns: minmax(0, 1fr); }
  .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 28px; }
  .dashboard-hero { align-items: stretch; flex-direction: column; gap: 21px; }
  .dashboard-hero-status { flex: 1 1 auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; padding: 17px 0 0; border-left: 0; border-top: 1px solid #d4e6ff26; }
  .dashboard-hero-status .btn { margin-left: auto; }
  .userbox strong,
  .userbox small { display: none; }

}

@media screen and (max-width: 680px) {
  :root { --asw-sidebar-width: 244px; }
  .sidebar { z-index: 30; width: var(--asw-sidebar-width); padding: 21px 16px; visibility: hidden; pointer-events: none; transform: translateX(-100%); transition: transform .2s ease, visibility 0s linear .2s; box-shadow: 14px 0 35px #142c4b18; }
  .sidebar.open { visibility: visible; pointer-events: auto; transform: translateX(0); transition-delay: 0s; }
  .sidebar .brand-logo-frame { width: 188px; height: 64px; }
  .main { width: 100%; margin-left: 0; }
  .mobile-shade.open { z-index: 29; background: #142a4680; }
  .topbar { height: 66px; gap: 8px; padding: 0 16px; }
  .topbar-right { gap: 8px; }
  .breadcrumb { gap: 7px; font-size: 12px; }
  .breadcrumb > span { display: none; }
  .menu-toggle { display: grid; place-items: center; min-width: 36px; min-height: 40px; padding: 7px; color: #58749a; }
  .environment-switch { gap: 5px; font-size: 10px; }
  .environment-switch select { min-height: 38px; max-width: 129px; padding: 8px; font-size: 11px; }
  .institutional-link { display: none; }
  .env-badge { font-size: 10px; }
  .userbox { display: none; }
  .content { padding: 25px 17px 30px; }
  .page-heading { align-items: flex-start; gap: 16px; margin-bottom: 22px; }
  .page-heading h1 { font-size: 26px; }
  .subtitle { font-size: 13px; }
  .page-heading .actions { width: 100%; gap: 9px; }
  .page-heading .actions > .btn { flex: 1 1 auto; }
  .btn,
  .btn.small { min-height: 44px; padding: 10px 13px; font-size: 13px; }
  .stats { gap: 12px; margin-bottom: 20px; }
  .stat { padding: 17px 15px; }
  .stat-top { gap: 7px; margin-bottom: 14px; font-size: 11px; }
  .stat-icon { width: 29px; height: 29px; border-radius: 7px; }
  .stat-icon svg { width: 16px; height: 16px; }
  .stat-value { font-size: clamp(23px, 5.6vw, 29px); }
  .stat-foot { font-size: 11px; }
  .dashboard-hero { gap: 18px; min-height: 0; padding: 22px; margin-bottom: 21px; border-radius: 12px; }
  .dashboard-hero-copy h2 { font-size: 23px; }
  .dashboard-hero-copy p { font-size: 12px; }
  .dashboard-hero-status { gap: 10px; padding-top: 16px; }
  .dashboard-hero-status > strong,
  .dashboard-hero-status h3 { font-size: 14px; }
  .dashboard-hero-status .btn { min-height: 40px; margin-left: 0; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-action { padding: 17px 14px; }
  .quick-action b { font-size: 12px; }
  .card-header { gap: 10px; padding: 20px 18px; }
  .card-header h2 { font-size: 15px; }
  .card-header p { font-size: 12px; }
  .card-body { padding: 0 18px 20px; }
  .flow-summary { flex-wrap: wrap; gap: 14px 25px; padding-left: 18px; }
  .flow-summary b { font-size: 17px; }
  .period-label { font-size: 10px; }
  .filters { padding: 16px; }
  .filters .search { max-width: none; }
  .filters select { max-width: 155px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .modal-head { padding: 21px 20px 18px; }
  .modal-head h2 { font-size: 20px; }
  .modal-head p { font-size: 12px; }
  .modal-body { padding: 20px; }
  .close-btn { min-width: 44px; min-height: 44px; }
  .page-footer { flex-wrap: wrap; gap: 9px; font-size: 11px; }

}


@media screen and (max-width: 1100px) and (min-width: 861px) {
  .auth-story { gap: 30px; padding: 27px 32px; }
  .auth-form-wrap { padding: 32px 28px 27px; }
  .auth-access { padding: 28px 26px 0; }
  .auth-access-help { margin-right: -26px; margin-left: -26px; padding-right: 26px; padding-left: 26px; }
  .auth-story h1 { font-size: 39px; }
  .auth-benefits { gap: 18px; }
}
@media screen and (max-width: 860px) {
  .auth-page { grid-template-columns: minmax(0, 1fr); }
  .auth-story { gap: 25px; padding: 24px max(25px, calc((100vw - 560px) / 2)) 27px; }
  .auth-brand-header { gap: 18px; }
  .auth-logo { width: 88px; height: 86px; }
  .auth-product-tag { font-size: 10px; }
  .auth-brand-copy { max-width: none; }
  .auth-kicker { font-size: 9px; letter-spacing: 1.2px; }
  .auth-story h1 { max-width: none; margin: 12px 0 14px; font-size: 36px; line-height: 1.15; letter-spacing: -1px; }
  .auth-story h1 br { display: none; }
  .auth-story .auth-intro { display: block; max-width: 480px; font-size: 13px; line-height: 1.7; }
  .auth-benefits { display: none; }
  .auth-story .auth-brand-footer { padding-top: 18px; }
  .auth-provider-label { display: none; }
  .auth-providers { margin-top: 0; font-size: 10px; gap: 8px 15px; }
  .auth-providers span + span { padding-left: 15px; }
  .auth-form-wrap { gap: 23px; padding: 24px 25px; }
  .auth-utility { justify-content: center; max-width: 450px; }
  .auth-access { max-width: 450px; padding: 29px 28px 0; }
  .auth-form { padding-bottom: 29px; }
  .auth-form-symbol { display: none; }
  .auth-form h2 { font-size: 28px; }
  .auth-access-help { margin-right: -28px; margin-left: -28px; padding: 19px 28px; }
}
@media screen and (max-width: 420px) {
  .auth-story { padding-right: 22px; padding-left: 22px; }
  .auth-story h1 { font-size: 33px; }
  .auth-form-wrap { padding-right: 18px; padding-left: 18px; }
  .auth-access { padding-right: 23px; padding-left: 23px; }
  .auth-access-help { margin-right: -23px; margin-left: -23px; padding-right: 23px; padding-left: 23px; }
  .auth-form h2 { font-size: 26px; }
}

@media screen and (prefers-reduced-motion: reduce) {
  .sidebar,
  .quick-action { transition: none; }
}

/* Secondary text remains readable on white and the pale operational surfaces.
   This does not target the light text used in the navy brand panels. */
@media screen {
  .sidebar-footer,
  .card-header p,
  .table-footer,
  .td-secondary,
  .stat-top,
  .stat-foot,
  .stat-foot.green,
  .flow-summary span,
  .quick-action span,
  .provider-mini,
  .field-help,
  .modal-head p,
  .detail-grid dt,
  .payment-row span,
  .settings-card > p,
  .provider-card p,
  .provider-card ul,
  .audit-entry p,
  .page-footer,
  .auth-form p,
  .auth-form-footer a,
  .invoice-client small,
  .invoice-status-note,
  .invoice-amount > span,
  .invoice-amount > small,
  .invoice-amount .field-help,
  .invoice-amount dt,
  .invoice-doc-panel > div > span { color: var(--asw-muted); font-size: 12px; }
  th,
  .invoice-table th { color: #596e89; }
  .nav-label,
  .workspace-label { color: #61758f; }
  .quick-action b { font-size: 12px; }
}
