/* Global production-safe UI enhancements. Feature switches decide what initializes. */
:root {
  --gk-ui-z-loading: 1040;
  --gk-ui-z-dropdown: 1060;
  --gk-ui-z-modal-backdrop: 1070;
  --gk-ui-z-modal: 1080;
  --gk-ui-z-toast: 1090;
  --gk-ui-focus: 0 0 0 3px rgba(199, 154, 43, 0.24);
}

/* Hides the server-rendered flash block (partials/alerts.html) so initToasts can
   replace it with a toast. Client-injected alerts opt out with data-gk-toast-ignore:
   initToasts only scans once at DOMContentLoaded, so it never converts them and
   without the opt-out they would be hidden forever. */
.gk-toasts-enabled #message:not([data-gk-toast-ignore]) {
  display: none !important;
}

/* Chrome ignores line-height on a closed <select> and lays the text out with the
   font's "normal" line box. Noto Sans Arabic reports ~2.2em there, so a locked
   38px height plus vertical padding left only ~25px of content box and Chrome
   clipped the Arabic descenders. Keep 38px as the minimum and let the control
   grow if the line box ever needs more. */
select.form-control:not([multiple]),
select.custom-select:not([multiple]) {
  background-position: right 0.75rem center !important;
  direction: rtl !important;
  height: auto;
  min-height: calc(2.25rem + 2px);
  padding-block: 0 !important;
  padding-left: 0.75rem !important;
  padding-right: 2rem !important;
  text-align: right !important;
  text-align-last: right;
  text-overflow: ellipsis;
  unicode-bidi: isolate;
  white-space: nowrap;
}

select.form-control:not([multiple]) option,
select.custom-select:not([multiple]) option {
  direction: rtl;
  text-align: right;
}

.gk-ui-nav-btn {
  align-items: center;
  background: #fff;
  border: 1px solid var(--aureum-card-border, #E4DED2);
  border-radius: 8px;
  color: var(--aureum-navy, #172033);
  display: inline-flex;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.gk-ui-nav-btn:hover,
.gk-ui-nav-btn:focus-visible {
  background: #F7F4EF;
  border-color: rgba(199, 154, 43, 0.55);
  box-shadow: var(--gk-ui-focus);
  outline: 0;
}

.gk-ui-nav-btn i {
  font-size: 1.1rem;
}

.gk-ui-nav-btn kbd {
  background: #F2F0ED;
  border: 1px solid #DED6C6;
  border-radius: 5px;
  color: var(--aureum-text-secondary, #667085);
  font-size: 0.66rem;
  line-height: 1;
  padding: 3px 5px;
}

.gk-ui-nav-btn-icon {
  justify-content: center;
  padding: 0;
  width: 36px;
}

.gk-loading-bar {
  background: linear-gradient(90deg, var(--aureum-gold, #C79A2B), var(--aureum-gold-bright, #FFD569));
  box-shadow: 0 0 10px rgba(199, 154, 43, 0.35);
  height: 3px;
  inset-block-start: 0;
  inset-inline-end: 0;
  position: fixed;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 220ms ease, opacity 180ms ease;
  width: 100%;
  z-index: var(--gk-ui-z-loading);
}

.gk-loading-bar.is-visible {
  opacity: 1;
  transform: scaleX(0.72);
}

.gk-loading-bar.is-finishing {
  opacity: 0;
  transform: scaleX(1);
}

.gk-command-backdrop {
  align-items: flex-start;
  background: rgba(23, 32, 51, 0.28);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 9vh 18px 24px;
  position: fixed;
  z-index: var(--gk-ui-z-modal);
}

.gk-command-backdrop.is-open {
  display: flex;
}

.gk-command-panel {
  background: #fff;
  border: 1px solid var(--aureum-card-border, #E4DED2);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(23, 32, 51, 0.22);
  color: var(--aureum-text, #172033);
  display: flex;
  flex-direction: column;
  height: min(720px, calc(100vh - 96px));
  max-width: 760px;
  min-height: 260px;
  overflow: hidden;
  width: min(760px, 100%);
}

.gk-command-search {
  align-items: center;
  border-bottom: 1px solid var(--aureum-card-border, #E4DED2);
  display: flex;
  gap: 10px;
  padding: 12px 14px;
}

.gk-command-search i {
  color: var(--aureum-gold, #C79A2B);
  font-size: 1.25rem;
}

.gk-command-input {
  border: 0;
  color: var(--aureum-text, #172033);
  flex: 1;
  font-size: 1rem;
  outline: 0;
}

.gk-command-input::placeholder {
  color: #5B6678;
}

.gk-command-results {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  scroll-padding: 12px;
}

.gk-command-group-title {
  color: var(--aureum-text-secondary, #667085);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 10px 10px 5px;
}

.gk-command-result {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  display: flex;
  gap: 10px;
  padding: 10px;
  text-align: right;
  width: 100%;
}

.gk-command-result:hover,
.gk-command-result.is-active {
  background: #F7F4EF;
}

.gk-command-icon {
  align-items: center;
  background: #F2F0ED;
  border-radius: 8px;
  color: var(--aureum-navy, #172033);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.gk-command-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
}

.gk-command-subtitle {
  color: var(--aureum-text-secondary, #667085);
  display: block;
  font-size: 0.76rem;
  margin-top: 2px;
}

.gk-command-empty {
  color: var(--aureum-text-secondary, #667085);
  padding: 28px 14px;
  text-align: center;
}

.gk-recent-menu {
  background: #fff;
  border: 1px solid var(--aureum-card-border, #E4DED2);
  border-radius: 10px;
  box-shadow: 0 16px 42px rgba(23, 32, 51, 0.18);
  color: var(--aureum-text, #172033);
  display: none;
  max-height: min(600px, 78vh);
  overflow-y: auto;
  padding: 10px;
  position: fixed;
  width: min(380px, calc(100vw - 24px));
  z-index: var(--gk-ui-z-dropdown);
}

.gk-recent-menu.is-open {
  display: block;
}

.gk-recent-section + .gk-recent-section {
  border-top: 1px solid #ECE6DA;
  margin-top: 8px;
  padding-top: 8px;
}

.gk-recent-heading {
  color: var(--aureum-text-secondary, #667085);
  font-size: 0.72rem;
  font-weight: 700;
  margin: 4px 4px 6px;
}

.gk-recent-item {
  align-items: center;
  border-radius: 8px;
  color: inherit;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 8px;
  text-decoration: none;
}

.gk-recent-item:hover {
  background: #F7F4EF;
  color: inherit;
  text-decoration: none;
}

.gk-recent-empty {
  color: var(--aureum-text-secondary, #667085);
  font-size: 0.8rem;
  padding: 8px;
}

.gk-toast-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  inset-block-start: 74px;
  inset-inline-end: 18px;
  position: fixed;
  width: min(410px, calc(100vw - 36px));
  z-index: var(--gk-ui-z-toast);
}

.gk-toast {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--aureum-card-border, #E4DED2);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.16);
  color: var(--aureum-text, #172033);
  display: flex;
  gap: 12px;
  overflow: hidden;
  padding: 13px 14px;
  position: relative;
}

.gk-toast::after {
  background: #E4DED2;
  bottom: 0;
  content: "";
  height: 3px;
  inset-inline: 0;
  position: absolute;
}

.gk-toast-success { background: linear-gradient(180deg, #fff, rgba(15, 118, 110, 0.035)); border-color: rgba(15, 118, 110, 0.26); }
.gk-toast-error { background: linear-gradient(180deg, #fff, rgba(180, 35, 24, 0.035)); border-color: rgba(180, 35, 24, 0.28); }
.gk-toast-warning { background: linear-gradient(180deg, #fff, rgba(199, 154, 43, 0.045)); border-color: rgba(199, 154, 43, 0.36); }
.gk-toast-info { background: linear-gradient(180deg, #fff, rgba(30, 42, 69, 0.035)); border-color: rgba(30, 42, 69, 0.22); }

.gk-toast-icon {
  align-items: center;
  background: #F2F0ED;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  height: 30px;
  justify-content: center;
  margin-top: 1px;
  width: 30px;
}

.gk-toast-icon i {
  font-size: 1.05rem;
}

.gk-toast-success .gk-toast-icon { background: var(--aureum-green, #0F766E); }
.gk-toast-error .gk-toast-icon { background: var(--aureum-red, #B42318); }
.gk-toast-warning .gk-toast-icon { background: var(--aureum-gold, #C79A2B); }
.gk-toast-info .gk-toast-icon { background: var(--aureum-navy, #172033); }
.gk-toast-success::after { background: var(--aureum-green, #0F766E); }
.gk-toast-error::after { background: var(--aureum-red, #B42318); }
.gk-toast-warning::after { background: var(--aureum-gold, #C79A2B); }
.gk-toast-info::after { background: var(--aureum-navy, #172033); }

.gk-toast-title {
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.gk-toast-message {
  color: var(--aureum-text-secondary, #667085);
  font-size: 0.81rem;
  line-height: 1.55;
}

.gk-toast-close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--aureum-text-secondary, #667085);
  display: inline-flex;
  height: 28px;
  justify-content: center;
  margin-inline-start: auto;
  padding: 0;
  width: 28px;
}

.gk-toast-close:hover,
.gk-toast-close:focus-visible {
  background: #F2F0ED;
  color: var(--aureum-navy, #172033);
  outline: 0;
}

.gk-field-help {
  color: var(--aureum-text-secondary, #667085);
  display: block;
  font-size: 0.74rem;
  margin-top: 5px;
}

.gk-field-help.is-error {
  color: var(--aureum-red, #B42318);
}

.form-control.gk-invalid,
input.gk-invalid,
select.gk-invalid,
textarea.gk-invalid {
  border-color: var(--aureum-red, #B42318) !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.14) !important;
}

.gk-table-enhanced thead th {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 3;
}

/* Keep header colors set on the thead (bg-secondary, bg-dark, ...): the sticky
   th would otherwise paint #fff over them and hide any text-white on top. */
.gk-table-enhanced thead[class*="bg-"] th {
  background-color: inherit;
}

.gk-table-enhanced tbody tr:nth-child(even) {
  background-color: rgba(23, 32, 51, 0.018);
}

.gk-table-enhanced tbody tr:hover {
  background-color: rgba(199, 154, 43, 0.08);
}

.gk-table-enhanced .gk-num,
.gk-table-enhanced td[data-num],
.gk-table-enhanced td.gk-numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.gk-table-enhanced tfoot tr,
.gk-table-enhanced tr.gk-total-row {
  background: #F7F4EF;
  bottom: 0;
  font-weight: 800;
  position: sticky;
  z-index: 2;
}

.gk-empty-state {
  align-items: center;
  background: #FAF9F7;
  border: 1px dashed var(--aureum-card-border, #E4DED2);
  border-radius: 8px;
  color: var(--aureum-text-secondary, #667085);
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  min-height: 96px;
  padding: 18px;
  text-align: center;
}

tr.gk-empty-row > td {
  background: #FAF9F7 !important;
  padding: 0 !important;
}

.gk-empty-state i {
  color: var(--aureum-gold, #C79A2B);
  font-size: 1.7rem;
}

.gk-empty-state strong {
  color: var(--aureum-text, #172033);
  font-size: 0.9rem;
}

@media (max-width: 575.98px) {
  .gk-ui-nav-btn span,
  .gk-ui-nav-btn kbd {
    display: none;
  }

  .gk-ui-nav-btn {
    justify-content: center;
    padding: 0;
    width: 36px;
  }
}

@media print {
  .gk-loading-bar,
  .gk-command-backdrop,
  .gk-recent-menu,
  .gk-toast-stack,
  .gk-ui-nav-btn {
    display: none !important;
  }

  .gk-table-enhanced thead th,
  .gk-table-enhanced tfoot tr,
  .gk-table-enhanced tr.gk-total-row {
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gk-loading-bar,
  .gk-ui-nav-btn {
    transition: none;
  }
}

/* ============================================================
   Home — landing surface after login
   ============================================================ */

.gk-home {
  padding: 22px var(--aureum-gutter, 24px) 44px;
  background: var(--aureum-canvas, #FBF8FA);
}

/* ---- Page head ---- */

.gk-home-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--aureum-card-border, #E4DED2);
}

/* Short gold rule under the heading: the brand note on the page edge. */
.gk-home-head::after {
  content: "";
  position: absolute;
  inset-block-end: -1px;
  inset-inline-start: 0;
  width: 52px;
  height: 2px;
  background: var(--aureum-gold, #C79A2B);
}

.gk-home-heading {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--aureum-navy, #172033);
}

.gk-home-context {
  margin: 0;
  font-size: 0.82rem;
  color: var(--aureum-text-secondary, #667085);
}

.gk-home-context > span + span::before {
  content: "\00B7";
  margin-inline: 8px;
  color: var(--aureum-text-muted, #98A2B3);
}

/* ---- Resume banner: the single highest-value control on the page ---- */

.gk-home-resume-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
  padding: 15px 20px;
  background: var(--aureum-navy, #172033);
  border-radius: var(--aureum-radius-sm, 8px);
  box-shadow: 0 2px 10px rgba(23, 32, 51, 0.16);
  color: #FFFFFF;
  text-decoration: none;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.gk-home-resume-banner:hover,
.gk-home-resume-banner:focus-visible {
  background: var(--aureum-navy-hover, #253352);
  box-shadow: 0 4px 16px rgba(23, 32, 51, 0.22);
  color: #FFFFFF;
  text-decoration: none;
}

.gk-home-resume-banner:focus-visible {
  outline: none;
  box-shadow: var(--gk-ui-focus);
}

.gk-home-banner-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gk-home-banner-title {
  overflow: hidden;
  font-size: 1rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gk-home-banner-sub {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.68);
}

.gk-home-banner-cue {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: 1px solid rgba(255, 213, 105, 0.42);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--aureum-gold-bright, #FFD569);
}

/* ---- Grid ---- */

.gk-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px;
  align-items: start;
}

.gk-home-grid-wide {
  grid-template-columns: minmax(0, 1fr);
}

.gk-home-title,
.gk-home-group {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--aureum-text-muted, #98A2B3);
}

.gk-home-title {
  margin: 0 0 14px;
}

/* ---- Icon chip ---- */

.gk-home-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--aureum-gold-subtle, #C79A2B1A);
  color: var(--aureum-gold, #C79A2B);
  font-size: 1.1rem;
  transition: background-color 180ms ease, color 180ms ease;
}

.gk-home-chip-invert {
  background: rgba(255, 213, 105, 0.16);
  color: var(--aureum-gold-bright, #FFD569);
}

/* ---- Shortcut cards ---- */

.gk-home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gk-home-card {
  display: flex;
  align-items: center;
  gap: 13px;
  height: 100%;
  min-height: 68px;
  padding: 12px 14px;
  background: var(--aureum-card, #FFFFFF);
  border: 1px solid var(--aureum-card-border, #E4DED2);
  border-radius: var(--aureum-radius-sm, 8px);
  box-shadow: var(--aureum-shadow, 0 1px 3px rgba(23, 32, 51, 0.06));
  color: var(--aureum-text, #172033);
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.gk-home-card:hover,
.gk-home-card:focus-visible {
  border-color: var(--aureum-gold, #C79A2B);
  box-shadow: 0 4px 14px rgba(23, 32, 51, 0.10), 0 1px 3px rgba(23, 32, 51, 0.06);
  transform: translateY(-2px);
  color: var(--aureum-text, #172033);
  text-decoration: none;
}

.gk-home-card:hover .gk-home-chip,
.gk-home-card:focus-visible .gk-home-chip {
  background: var(--aureum-gold, #C79A2B);
  color: #FFFFFF;
}

.gk-home-card:focus-visible {
  outline: none;
  box-shadow: var(--gk-ui-focus);
}

.gk-home-card:active {
  transform: translateY(0);
}

.gk-home-card-label {
  min-width: 0;
  font-size: 0.94rem;
  line-height: 1.35;
}

/* ---- Rail ---- */

.gk-home-rail {
  padding: 4px 16px 16px;
  background: var(--aureum-card, #FFFFFF);
  border: 1px solid var(--aureum-card-border, #E4DED2);
  border-radius: var(--aureum-radius-sm, 8px);
  box-shadow: var(--aureum-shadow, 0 1px 3px rgba(23, 32, 51, 0.06));
}

.gk-home-group {
  margin: 0 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--aureum-card-border, #E4DED2);
}

.gk-home-links + .gk-home-group {
  margin-top: 16px;
}

.gk-home-rail > .gk-home-group:first-child {
  padding-top: 12px;
  border-top: 0;
}

.gk-home-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gk-home-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: var(--aureum-radius-xs, 6px);
  font-size: 0.86rem;
  color: var(--aureum-text, #172033);
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}

.gk-home-link:hover {
  background: var(--aureum-gold-subtle, #C79A2B1A);
  color: var(--aureum-navy, #172033);
  text-decoration: none;
}

.gk-home-link:focus-visible {
  outline: none;
  box-shadow: var(--gk-ui-focus);
}

.gk-home-link-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gk-home-pin {
  flex: 0 0 auto;
  font-size: 0.68rem;
  color: var(--aureum-gold, #C79A2B);
}

/* ---- Empty state ---- */

.gk-home-empty {
  max-width: 62ch;
  padding: 26px;
  background: var(--aureum-card, #FFFFFF);
  border: 1px dashed var(--aureum-card-border, #E4DED2);
  border-radius: var(--aureum-radius-sm, 8px);
}

.gk-home-empty p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--aureum-text-secondary, #667085);
}

.gk-home-empty-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 9px 18px;
  background: var(--aureum-gold, #C79A2B);
  border-radius: var(--aureum-radius-xs, 6px);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--aureum-navy, #172033);
  text-decoration: none;
  transition: background-color 150ms ease;
}

.gk-home-empty-action:hover {
  background: var(--aureum-gold-bright, #FFD569);
  color: var(--aureum-navy, #172033);
  text-decoration: none;
}

.gk-home-empty-action:focus-visible {
  outline: none;
  box-shadow: var(--gk-ui-focus);
}

/* ---- Responsive ---- */

@media (max-width: 1199.98px) {
  .gk-home-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
  }
}

@media (max-width: 991.98px) {
  .gk-home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 575.98px) {
  .gk-home {
    padding: 16px 16px 32px;
  }

  .gk-home-cards {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 10px;
  }

  .gk-home-card {
    gap: 10px;
    min-height: 62px;
    padding: 11px;
  }

  .gk-home-chip {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .gk-home-card-label {
    font-size: 0.86rem;
  }

  .gk-home-resume-banner {
    gap: 12px;
    padding: 13px 14px;
  }

  .gk-home-banner-cue {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gk-home-card,
  .gk-home-chip,
  .gk-home-link,
  .gk-home-resume-banner,
  .gk-home-empty-action {
    transition: none;
  }

  .gk-home-card:hover,
  .gk-home-card:focus-visible {
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
   Report filter panel — .gk-filters
   The trial-balance screens grew one filter at a time into a single flat row of
   mismatched col-md-* widths (GHG22 summed to 17 columns), so the row wrapped
   raggedly and labels never lined up. Admin switches can now remove a control
   entirely, which in a column grid would leave a hole. Auto-fit grid tracks
   instead: every control keeps the same width, and the row re-flows when one is
   hidden.
   --------------------------------------------------------------------------- */
.gk-filters {
  background: var(--aureum-card, #FFFFFF);
  border: 1px solid var(--aureum-card-border, #E4DED2);
  border-radius: var(--aureum-radius, 14px);
  box-shadow: var(--aureum-shadow, 0 1px 3px rgba(23, 32, 51, 0.06));
  margin-bottom: 1rem;
  padding: 14px 16px 12px;
}

.gk-filters__section + .gk-filters__section {
  border-top: 1px dashed var(--aureum-card-border, #E4DED2);
  margin-top: 14px;
  padding-top: 14px;
}

.gk-filters__legend {
  align-items: center;
  color: var(--aureum-text-secondary, #667085);
  display: flex;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 6px;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.gk-filters__legend i {
  color: var(--aureum-gold, #C79A2B);
  font-size: 0.85rem;
}

.gk-filters__grid {
  align-items: end;
  display: grid;
  gap: 10px 12px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.gk-filters__field {
  margin: 0;
  min-width: 0;
}

.gk-filters__field > label {
  color: var(--aureum-text, #172033);
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .gk-filters__field--wide {
    grid-column: span 2;
  }
}

/* select2 replaces the <select> with its own box; without this it can push past
   the grid track instead of shrinking with it. */
.gk-filters .select2-container {
  max-width: 100%;
}

.gk-filters .dropdown-toggle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gk-filters__actions {
  align-items: center;
  border-top: 1px solid var(--aureum-card-border, #E4DED2);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
}

.gk-filters__actions .btn {
  margin: 0;
}

.gk-filters__actions .gk-filters__actions-end {
  margin-inline-start: auto;
}

@media print {
  .gk-filters {
    display: none !important;
  }
}

/* ==========================================================================
   ألوان الأرصدة
   أزرق = العميل عليه (مدين) — أحمر = العميل له (دائن) — صفر بدون لون.
   بتتطبق عن طريق initBalanceColors في base-ui.js على أي عنصر عليه
   data-gk-bal (خلية جدول أو input للإجماليات).
   ========================================================================== */
.gk-bal-dr,
input.gk-bal-dr,
td.gk-bal-dr {
  color: #0B5ED7 !important;
  font-weight: 600;
}

.gk-bal-cr,
input.gk-bal-cr,
td.gk-bal-cr {
  color: #DC3545 !important;
  font-weight: 600;
}

@media print {
  .gk-bal-dr,
  .gk-bal-cr {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
