/* Keep Tabler's operating UI; these rules cover app-specific layout and focus. */
:root {
  --tblr-font-sans-serif: system-ui, -apple-system, "Segoe UI", sans-serif;
  --courses-focus: #066fd1;
}
[data-bs-theme="dark"] { --courses-focus: #78b7f2; }
html { scrollbar-color: var(--tblr-border-color) var(--tblr-bg-surface); }
body { min-width: 320px; }
::selection { background: #b6dafb; color: #10263a; }
input { caret-color: var(--courses-focus); }
a { text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--courses-focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 2000; padding: .75rem 1rem; background: var(--tblr-bg-surface); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.theme-controls { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.theme-controls .btn { min-height: 36px; border-color: transparent; color: var(--tblr-body-color); }
.theme-controls [aria-pressed="true"] { background: var(--tblr-primary-lt); border-color: var(--tblr-primary); color: var(--tblr-body-color); }
.login-page { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.login-toolbar { display: flex; justify-content: flex-end; padding: 1.25rem; }
.login-main { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 1rem 1rem 6rem; }
.login-brand { font-size: 1.5rem; font-weight: 700; color: var(--tblr-body-color); margin-bottom: 1.5rem; }
.login-card { width: 100%; max-width: 28rem; box-shadow: none; border-radius: .75rem; }
.login-card h1 { text-wrap: balance; }
.login-card input { min-height: 44px; }
.login-card .form-check-input { min-height: auto; }
.login-card button[type="submit"] { min-height: 44px; }
.password-toggle { min-width: 6rem; }
/* Tabler 1.5 danger text needs a stronger contrast on its tinted dark surface. */
.alert-danger { color: #9f2029; background-color: #fff0f0; border-color: #f3c6c8; }
[data-bs-theme="dark"] .alert-danger { color: #ffb4b4; background-color: #342631; border-color: #704251; }
.sidebar-footer { margin-top: auto; padding: 1.5rem 1.25rem; border-top: 1px solid var(--tblr-border-color); width: 100%; }
.navbar-vertical .navbar-brand { font-size: 1.5rem; font-weight: 700; }
.workspace-toolbar { min-height: 64px; }
.page-body { min-width: 0; }
.page-body .card { box-shadow: none; border-radius: .75rem; }
.page-body p { max-width: 72ch; }
.table-responsive { overscroll-behavior-x: contain; }
.table-responsive:focus-visible { outline-offset: -3px; }
.table { font-variant-numeric: tabular-nums; }
.table caption { padding: 1rem; color: var(--tblr-body-color); }
.table th { white-space: nowrap; }
.dashboard-header { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.overview-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.overview-stats > div { padding: 1.5rem; }
.overview-stats > div + div { border-left: 1px solid var(--tblr-border-color); }
.overview-stats dt { font-weight: 500; }
.overview-stats dd { font-size: 1.5rem; margin: .5rem 0 0; font-variant-numeric: tabular-nums; }
.overview-stats p { margin-top: .25rem; font-size: .75rem; }
.rate-value { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Keep Tabler's status surfaces while making small status text readable. */
.freshness-badge.bg-success-lt { color: #1a672b !important; }
.freshness-badge.bg-warning-lt { color: #794b00 !important; }
.freshness-badge.bg-secondary-lt { color: #4b5563 !important; }
[data-bs-theme="dark"] .freshness-badge.bg-success-lt { color: #8de2a2 !important; }
[data-bs-theme="dark"] .freshness-badge.bg-warning-lt { color: #ffcf76 !important; }
[data-bs-theme="dark"] .freshness-badge.bg-secondary-lt { color: #d1d5db !important; }
.asset-search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.asset-search-field { flex: 1 1 16rem; }
.asset-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 1.5rem; }
.asset-list li { display: flex; flex-direction: column; justify-content: center; min-height: 4rem; padding: .75rem 0; border-bottom: 1px solid var(--tblr-border-color); overflow-wrap: anywhere; }
.asset-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.asset-pagination .pagination { flex-wrap: wrap; gap: .25rem 0; }
@media (max-width: 1199.98px) {
  .overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-stats > div:nth-child(3) { border-left: 0; }
  .overview-stats > div:nth-child(n+3) { border-top: 1px solid var(--tblr-border-color); }
  .asset-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .overview-stats > div { padding: 1rem; }
  .asset-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-search .btn { min-height: 44px; }
}
/* Navigation stays usable when JavaScript is disabled. */
html:not([data-js]) .navbar-collapse { display: block; }
html:not([data-js]) .navbar-toggler { display: none; }
@media (max-width: 991.98px) {
  .navbar-vertical .container-fluid { gap: .25rem; }
  .sidebar-footer { padding: 1rem; }
  .workspace-toolbar { min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
/* K04 shares the catalogue surface; only filter composition is new. */
.pair-search { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.pair-search-query { flex: 2 1 16rem; min-width: 0; }
.pair-search-filter { flex: 1 1 10rem; min-width: 0; }
.pair-search-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.pair-search .form-control, .pair-search .form-select, .pair-search .btn, .pair-toggle { min-height: 44px; }
.pair-table { min-width: 52rem; }
.pair-table th[scope="row"] { white-space: normal; overflow-wrap: anywhere; max-width: 18rem; }
.pair-table .tabular { font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {
  .pair-search-query, .pair-search-filter { flex-basis: 100%; }
}
/* K05 keeps saved prices separate from the current editable side settings. */
.pair-detail-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.pair-detail-actions .btn, .side-adjustment .btn, .side-adjustment input { min-height: 44px; }
.pair-summary-table { min-width: 44rem; }
.pair-source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.provider-direction-table { min-width: 88rem; }
.provider-direction-table .provider-name { white-space: normal; overflow-wrap: anywhere; min-width: 10rem; max-width: 18rem; }
.provider-group-title { background: var(--tblr-bg-surface-secondary); }
.side-adjustment { display: flex; flex-wrap: wrap; gap: .5rem; min-width: 12rem; }
.side-adjustment input { flex: 1 1 8rem; width: 8rem; }
@media (max-width: 575.98px) { .pair-source-grid { grid-template-columns: minmax(0, 1fr); } }

/* Anchor absolute captions/labels inside the region that clips horizontal overflow. */
.pair-detail-scroll { position: relative; }
.provider-list-table { min-width: 44rem; }
.provider-rules-table { min-width: 72rem; }

.provider-heading { min-width: 0; max-width: 100%; }
.provider-title { display: block; overflow-wrap: anywhere; }

/* K07 keeps the singleton form compact and final prices locally scrollable. */
.rates-table { min-width: 64rem; }
.settings-card { max-width: 48rem; }
.settings-form .form-control, .settings-form .btn { min-height: 44px; }

/* Use the established readable status text over Tabler success surfaces. */
.settings-success { color: #1a672b; }
[data-bs-theme="dark"] .settings-success { color: #8de2a2; }
