/* Restore the original ATS theme. Only tab selection colors are overridden;
   ordinary buttons, page backgrounds, fields and sidebar use the original theme. */
@layer ats-button-theme {
  :where([role="tab"], .ats-tab, button[aria-pressed], .ats-client-tab > button) {
    background:#fff !important;
    color:var(--ats-blue, #123a63) !important;
    border-color:var(--ats-border, #d5e1ec) !important;
    box-shadow:none !important;
    --icon-stroke:var(--ats-blue, #123a63);
    --icon-fill:var(--ats-blue, #123a63);
  }
  :where([role="tab"], .ats-tab, button[aria-pressed]):is(.active, .selected, [aria-selected="true"], [aria-pressed="true"], [aria-current="page"]),
  .ats-client-tab.active > button {
    background:var(--ats-blue, #123a63) !important;
    color:#fff !important;
    border-color:var(--ats-blue, #123a63) !important;
    box-shadow:none !important;
    --icon-stroke:#fff;
    --icon-fill:#fff;
  }
  :where([role="tab"], .ats-tab, button[aria-pressed], .ats-client-tab > button) :is(span, strong, .text-muted, .indicator) {
    color:inherit !important;
  }
  :where([role="tab"], .ats-tab, button[aria-pressed], .ats-client-tab > button):focus-visible {
    outline:3px solid var(--ats-gold, #c59a45) !important;
    outline-offset:-3px !important;
  }
}

/* Preserve existing document grouping without the experimental palette. */
.ats-document-actions { padding:14px 16px; border-radius:9px; display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:14px 0; }
.ats-document-actions .ats-sign-label { color:var(--ats-blue); font-size:13px; letter-spacing:.05em; margin-right:8px; }
.ats-document-more { margin:12px 0; }
.ats-document-more > summary, .ats-document-card-actions summary { display:inline-block; padding:8px 12px; list-style:none; cursor:pointer; background:#fff; color:var(--ats-blue); border:1px solid var(--ats-border); border-radius:5px; }
.ats-document-more > summary::after, .ats-document-card-actions summary::after { content:' ▾'; }
.ats-document-more-content { padding:14px; margin-top:8px; border-radius:8px; }
.ats-document-more-content > .btn { margin:4px; }
.ats-document-more .ats-document-receipts { margin:0 0 10px !important; padding:0 !important; border:0 !important; }
.ats-document-card-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-start; margin-top:12px; }
.ats-document-card-actions details { max-width:100%; }
.ats-document-card-actions details > div { display:flex; gap:8px; flex-wrap:wrap; padding-top:8px; }
.ats-document-card-actions .ats-file-actions { order:-1; }
.ats-doc-head-request { margin-left:8px; }
.ats-panel-head { flex-wrap:wrap; gap:12px; }
.ats-panel-head > div:first-child { flex:1; min-width:180px; }

/* Top action controls share the original ATS blue, separate from navigation tabs. */
@layer ats-button-theme {
  :is(.navbar button, .page-head button, .ats-client-navigation button, .ats-open-clients > button, .ats-client-chooser > summary) {
    background:var(--ats-blue, #123a63) !important;
    color:#fff !important;
    border-color:var(--ats-blue, #123a63) !important;
    --icon-stroke:#fff;
    --icon-fill:#fff;
  }
  :is(.navbar button, .page-head button, .ats-client-navigation button, .ats-open-clients > button, .ats-client-chooser > summary) :is(span, strong, .text-muted, .indicator) {
    color:inherit !important;
  }
  :is(.navbar button, .page-head button, .ats-client-navigation button, .ats-open-clients > button, .ats-client-chooser > summary):hover {
    background:var(--ats-blue-deep, #0b2947) !important;
    border-color:var(--ats-blue-deep, #0b2947) !important;
  }
}
