/* ============================================================
   ITQAN — General Ledger Module CSS
   Chart of Accounts page (gl-page)
   ============================================================ */

/* ── Page wrapper ── */
.gl-page {
  /* inherits body background #f4f6fb */
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.gl-toolbar {
  background: #ffffff;
  border: 1px solid #dde5f0;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.gl-btn-group {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.gl-btn-divider {
  width: 1px;
  height: 26px;
  background: #dde5f0;
  margin: 0 0.3rem;
  flex-shrink: 0;
}

/* مجموعة أزرار فرغت (القارئ بلا أزرار كتابة، البند 88) تختفي ومعها فاصلها، فلا يبقى خط يتيم */
.gl-btn-group:not(:has(*)),
.gl-btn-group:not(:has(*)) + .gl-btn-divider {
  display: none;
}

/* uniform button height in toolbar */
.gl-toolbar .btn {
  height: 32px;
  padding-block: 0;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 7px;
}

/* ============================================================
   ACCOUNT LIST CARD (left/right panel)
   ============================================================ */
.gl-list-card {
  border: 1px solid #dde5f0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 190px);
  min-height: 400px;
}

.gl-list-card > .card-header {
  background: var(--itqan-primary);
  color: #fff;
  padding: 0.55rem 0.9rem;
  font-size: 0.855rem;
  font-weight: 600;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.gl-list-search {
  padding: 0.5rem 0.6rem;
  background: #f4f7fb;
  border-bottom: 1px solid #dde5f0;
  flex-shrink: 0;
}

.gl-list-search .form-control,
.gl-list-search .form-select {
  height: 30px;
  font-size: 0.82rem;
  border-color: #cdd5e0;
  border-radius: 6px;
  background: #fff;
}

.gl-list-search .form-control:focus,
.gl-list-search .form-select:focus {
  border-color: var(--itqan-primary);
  box-shadow: 0 0 0 3px rgba(11, 61, 145, .1);
}

.jnl-recent-filters {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  margin-top: .45rem;
}

.jnl-recent-filter {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  padding: .1rem .48rem;
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
}

.jnl-recent-filter span {
  min-width: 1.35rem;
  padding-inline: .28rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: inherit;
  text-align: center;
  font-size: .66rem;
}

.jnl-recent-filter.active {
  background: #0b3d91;
  border-color: #0b3d91;
  color: #ffffff;
}

.jnl-recent-filter.active span {
  background: rgba(255,255,255,.22);
}

.jnl-recent-filter--posted    { background: #d1fae5; color: #065f46; border-color: #86efac; }
.jnl-recent-filter--unposted  { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.jnl-recent-filter--submitted { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.jnl-recent-filter--approved  { background: #e0f2fe; color: #0c4a6e; border-color: #7dd3fc; }
.jnl-recent-filter--rejected  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.jnl-recent-filter--cancelled { background: #f3f4f6; color: #6b7280; border-color: #d1d5db; }

.gl-list-scroll {
  overflow-y: auto;
  flex: 1;
}

/* ── Zebra-striped account rows ── */
.gl-acct-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.gl-acct-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f7fb;
  padding: 0.38rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #dde5f0;
  white-space: nowrap;
}

.gl-acct-row td {
  padding: 0.32rem 0.6rem;
  border-bottom: 1px solid #edf2f7;
  vertical-align: middle;
}

/* Zebra striping — ODD white, EVEN light blue */
.gl-acct-row:nth-child(odd)  { background-color: #ffffff; }
.gl-acct-row:nth-child(even) { background-color: #eaf7ff; }

/* Hover */
.gl-acct-row:hover { background-color: #dff1ff !important; cursor: pointer; }

/* Active / selected */
.gl-acct-row--active {
  background-color: #d6e9ff !important;
  box-shadow: inset 0 0 0 2px rgba(11, 61, 145, .28);
  font-weight: 600;
}
.gl-acct-row--active td { color: #0b3d91; }

/* Code cell — monospaced */
.gl-acct-code {
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 0.78rem;
  color: #374151;
  white-space: nowrap;
}
.gl-acct-row--active .gl-acct-code { color: #0b3d91; }

.jnl-date-cell,
.jnl-sbadge-date,
.jnl-audit-badge-when {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

.jnl-date-cell {
  color: #6b7280;
  font-size: .74rem;
  white-space: nowrap;
}

/* Name cell */
.gl-acct-name {
  color: #4b5563;
  font-size: 0.8rem;
}

/* Link that covers the row without underline */
.gl-acct-row a {
  color: inherit;
  text-decoration: none;
}
.gl-acct-row a:hover { color: inherit; }

/* ============================================================
   FORM / DETAILS CARD
   ============================================================ */
.gl-form-card {
  border: 1px solid #dde5f0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
  overflow: hidden;
}

/* Card header — gradient blue */
.gl-form-card > .card-header {
  background: linear-gradient(135deg, #0b3d91 0%, #1565c0 100%);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-bottom: none;
}

.gl-acct-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.gl-code-badge {
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-family: 'Courier New', monospace;
  color: #fff;
}

.gl-header-switch label {
  color: rgba(255, 255, 255, .8);
  font-size: 0.8rem;
}

/* Card body */
.gl-form-card > .card-body {
  padding: 1rem 1.1rem;
}

/* ── Tabs ── */
.gl-tabs {
  border-bottom: 2px solid #dde5f0;
  gap: 0;
}

.gl-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.5rem 1rem;
  font-size: 0.855rem;
  font-weight: 500;
  color: #6b7280;
  border-radius: 0;
  background: transparent;
  transition: color .15s, border-color .15s;
}

.gl-tabs .nav-link:hover {
  color: var(--itqan-primary);
  border-bottom-color: #93c5fd;
  background: transparent;
}

.gl-tabs .nav-link.active {
  color: var(--itqan-primary);
  border-bottom-color: var(--itqan-primary);
  font-weight: 700;
  background: transparent;
}

/* ── Form fields ── */
.gl-form-group {
  margin-bottom: 0; /* handled by row g-3 */
}

.gl-form-group .form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.25rem;
}

.gl-form-group .form-control,
.gl-form-group .form-select {
  height: 34px;
  padding-block: 0;
  padding-inline: 0.7rem;
  font-size: 0.855rem;
  border: 1px solid #cdd5e0;
  border-radius: 7px;
  background: #fafbfc;
  transition: border-color .15s, box-shadow .15s;
}

.auto-code-field[readonly] {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0b3d91;
  cursor: default;
}

.fa-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  min-width: 4.4rem;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: .18rem .58rem;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}
.fa-status i {
  font-size: .78rem;
  line-height: 1;
}
.fa-status--new {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
.fa-status--open {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.fa-status--suspended {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}
.fa-status--closed {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}
.fa-status--sold {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #9f1239;
}
.fa-status--scrapped {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #1f2937;
}

.gl-form-group .form-control:focus,
.gl-form-group .form-select:focus {
  border-color: var(--itqan-primary);
  box-shadow: 0 0 0 3px rgba(11, 61, 145, .1);
  background: #fff;
  outline: none;
}

/* ── Switches card ── */
.gl-switches-card {
  background: #f8fafc;
  border: 1px solid #e9eff7;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.gl-sw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.28rem 0;
  border-bottom: 1px solid #eef2f7;
}
.gl-sw-row:last-child { border-bottom: none; }

.gl-sw-label {
  font-size: 0.82rem;
  color: #374151;
  cursor: pointer;
}

.gl-sw-row .form-check-input {
  cursor: pointer;
}

.gl-sw-row--muted { opacity: .45; }
.gl-sw-row--muted .gl-sw-label,
.gl-sw-row--muted .form-check-input { cursor: not-allowed; }

/* ── شارة الحساب الرقابي (دليل الحسابات) ── */
.gl-control-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #fff7e6;
  border: 1px solid #f2d9a6;
  color: #92600a;
  border-radius: 999px;
  padding: .15rem .6rem;
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
  max-width: 40%;
  overflow: hidden;
}
.gl-control-badge .gl-control-badge-links {
  font-weight: 500;
  color: #a97b1f;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── اقتراح الحساب الرقابي في منتقي سند القيد ── */
.jnl-suggest-item--control { background: #fffbf2; }
.jnl-suggest-item--control .jnl-suggest-control-hint {
  display: block;
  font-size: .7rem;
  color: #92600a;
}

/* ── Movements table ── */
.gl-movements-table {
  font-size: 0.82rem;
}

.gl-movements-table thead th {
  background: #f4f7fb;
  padding: 0.38rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #374151;
  border-bottom: 2px solid #dde5f0;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gl-movements-table tbody td {
  padding: 0.38rem 0.55rem;
  border-bottom: 1px solid #edf2f7;
  vertical-align: middle;
}

.gl-movements-table tbody tr:nth-child(odd)  { background: #ffffff; }
.gl-movements-table tbody tr:nth-child(even) { background: #f0f5ff; }
.gl-movements-table tbody tr:hover           { background: #dbeafe !important; cursor: default; }

/* Keyboard-focus highlight (arrow-key navigation) */
.gl-movements-table tbody tr.gl-grid-row:focus {
  outline: none;
  background: #bfdbfe !important;
  box-shadow: inset 3px 0 0 var(--itqan-primary);
}
.gl-movements-table tbody tr.gl-grid-row       { outline: none; }

.gl-movements-table tfoot th {
  background: #ebf3ff;
  padding: 0.45rem 0.55rem;
  font-weight: 700;
  border-top: 2px solid #dde5f0;
  font-size: 0.82rem;
}

.gl-dr { color: #1d4ed8; font-weight: 600; }
.gl-cr { color: #047857; font-weight: 600; }

/* ── "no data" placeholder ── */
.gl-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #9ca3af;
}
.gl-empty i { font-size: 2rem; opacity: .4; display: block; margin-bottom: .5rem; }

/* ============================================================
   ACCOUNT STATEMENT MODAL
   ============================================================ */
.gl-statement-modal .modal-header {
  background: linear-gradient(135deg, #0b3d91 0%, #1565c0 100%);
  color: #fff;
  border-bottom: none;
}

.gl-statement-modal .modal-header .btn-close {
  filter: invert(1) brightness(2);
}

.gl-stmt-header {
  background: #f4f7fb;
  border: 1px solid #dde5f0;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 575.98px) {
  .gl-stmt-header { grid-template-columns: 1fr 1fr; }
}

.gl-sh-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  display: block;
  margin-bottom: 2px;
}

.gl-sh-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1f2937;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

/* Hidden print areas (shown only when printing) */
#gl-print-statement,
#gl-print-account {
  display: none;
}

@media print {
  /* ── Hide all screen UI ── */
  .itqan-navbar,
  .itqan-sidebar,
  .itqan-offcanvas,
  .itqan-shell > main > .alert,
  .gl-toolbar,
  .gl-list-card,
  .gl-form-card,
  .modal,
  .modal-backdrop,
  .no-print {
    display: none !important;
  }

  body {
    padding-top: 0 !important;
    background: #fff !important;
    font-size: 12pt;
  }

  .itqan-content {
    margin-inline-start: 0 !important;
    padding: 0 !important;
  }

  /* ── Show whichever print area is active ── */
  body.gl-print-stmt  #gl-print-statement { display: block !important; }
  body.gl-print-acct  #gl-print-account   { display: block !important; }

  /* If neither flag is set fall back to account card */
  body:not(.gl-print-stmt):not(.gl-print-acct) .gl-form-card {
    display: block !important;
    box-shadow: none !important;
    border: none !important;
  }
  body:not(.gl-print-stmt):not(.gl-print-acct) .gl-form-card .card-header {
    background: #0b3d91 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* ── Print layout helpers ── */
  .gl-print-header {
    text-align: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #0b3d91;
  }
  .gl-print-header h2 {
    font-size: 14pt;
    font-weight: 700;
    color: #0b3d91;
    margin: 0 0 4px;
  }
  .gl-print-header p {
    font-size: 10pt;
    color: #374151;
    margin: 0;
  }

  .gl-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
    margin-bottom: 1rem;
  }
  .gl-print-table th {
    background: #0b3d91 !important;
    color: #fff !important;
    padding: 5pt 7pt;
    text-align: start;
    border: 1pt solid #0b3d91;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: 700;
  }
  .gl-print-table td {
    padding: 4pt 7pt;
    border: 1pt solid #ccd;
    vertical-align: middle;
  }
  .gl-print-table tbody tr:nth-child(even) td {
    background: #eef5ff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .gl-print-table tfoot td,
  .gl-print-table tfoot th {
    background: #dceeff !important;
    font-weight: 700;
    border-top: 2pt solid #0b3d91;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .gl-print-footer {
    margin-top: 1rem;
    border-top: 1pt solid #ccc;
    padding-top: 0.5rem;
    font-size: 8pt;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* info grid for account print */
  .gl-print-info {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
    margin-bottom: 1rem;
  }
  .gl-print-info td {
    padding: 4pt 8pt;
    border: 1pt solid #dde;
    vertical-align: top;
  }
  .gl-print-info td:first-child,
  .gl-print-info td:nth-child(3) {
    font-weight: 700;
    background: #f0f5ff !important;
    white-space: nowrap;
    width: 20%;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ============================================================
   JOURNALS — Lines Table
   ============================================================ */

/* Section label (e.g. "Journal Lines") */
.gl-section-label {
  font-size: .78rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Lines input grid */
.gl-lines-table {
  border-collapse: collapse;
  font-size: .82rem;
}

.gl-lines-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f7fb;
  padding: .3rem .45rem;
  font-size: .7rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid #dde5f0;
  white-space: nowrap;
}

.gl-line-row td {
  padding: .22rem .3rem;
  border-bottom: 1px solid #edf2f7;
  vertical-align: middle;
}

/* Zebra striping */
/* البند 385: العدّ بين الأسطر وحدها، فصف شريط الأبعاد الذي يلي كل سطر لا يُدخل في التناوب */
.gl-line-row:nth-child(odd of .gl-line-row)  { background: #ffffff; }
.gl-line-row:nth-child(even of .gl-line-row) { background: #eaf7ff; }
.gl-line-row:focus-within    { background: #fffbeb !important; }

/* Line-number cell */
.gl-line-no {
  text-align: center;
  color: #9ca3af;
  font-size: .74rem;
  white-space: nowrap;
  padding-inline: .3rem !important;
}

/* Account-name display cell */
.gl-line-name {
  min-width: 110px;
  padding-inline: .4rem !important;
}

/* Compact form-controls inside the grid */
.gl-lines-table .form-control-sm {
  height: 26px;
  padding-block: 0;
  padding-inline: .4rem;
  font-size: .8rem;
  border-color: transparent;
  background: transparent;
  border-radius: 4px;
}

.gl-lines-table .form-control-sm:focus {
  border-color: var(--itqan-primary);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(11, 61, 145, .12);
}

.gl-lines-table .form-control-sm[readonly] {
  background: transparent;
  color: #4b5563;
}

/* Footer totals row */
.gl-lines-total-row th {
  background: #ebf3ff;
  padding: .38rem .45rem;
  font-size: .82rem;
  font-weight: 700;
  border-top: 2px solid #dde5f0;
}

/* ============================================================
   JOURNALS — Totals Bar
   ============================================================ */
.gl-totals-bar {
  background: #f4f7fb;
  border: 1px solid #dde5f0;
  border-radius: 10px;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.gl-tot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
}

.gl-tot-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  display: block;
  margin-bottom: 2px;
}

.gl-tot-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Courier New', 'Consolas', monospace;
  letter-spacing: .02em;
}

/* ============================================================
   JOURNALS — Validation Summary
   ============================================================ */
.jnl-val-summary { display: none; }

.jnl-val-summary--show,
.jnl-val-summary.validation-summary-errors {
  display: block;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 7px;
  padding: .5rem .85rem;
  font-size: .84rem;
  color: #b91c1c;
}

.jnl-val-summary ul {
  margin: .25rem 0 0;
  padding-inline-start: 1.2rem;
}

.validation-summary-valid { display: none !important; }

/* ============================================================
   JOURNALS — Index List Table
   ============================================================ */
.gl-jnl-list-table {
  border-collapse: collapse;
  font-size: .83rem;
}

.gl-jnl-list-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f7fb;
  padding: .38rem .6rem;
  font-size: .72rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid #dde5f0;
  white-space: nowrap;
}

.gl-jnl-row td {
  padding: .34rem .6rem;
  border-bottom: 1px solid #edf2f7;
  vertical-align: middle;
}

.gl-jnl-row:nth-child(odd)  { background: #ffffff; }
.gl-jnl-row:nth-child(even) { background: #eaf7ff; }
.gl-jnl-row:hover           { background: #dff1ff !important; cursor: default; }
.gl-jnl-row:focus           { background: #bfdbfe !important; outline: 2px solid #3b82f6; outline-offset: -2px; }
.gl-jnl-row:focus .jnl-number-link { text-decoration: underline; }

.gl-jnl-list-table tfoot th {
  background: #ebf3ff;
  padding: .4rem .6rem;
  font-size: .82rem;
  font-weight: 700;
  border-top: 2px solid #dde5f0;
}

/* ── New journal button ── */
.jnl-new-btn {
  font-weight: 600;
  padding-inline: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(11,61,145,.18);
}

/* ── Action buttons (edit + dropdown toggle) ── */
.jnl-act-btn {
  height: 26px !important;
  padding-block: 0 !important;
  padding-inline: .5rem !important;
  font-size: .78rem !important;
  border-radius: 6px !important;
  line-height: 1 !important;
}
.jnl-act-btn.dropdown-toggle-split { padding-inline: .35rem !important; }
.jnl-act-btn.dropdown-toggle-split::after { display: none; }

/* ── Action dropdown menu ── */
.jnl-action-menu {
  min-width: 170px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15,23,42,.12);
  padding: .35rem 0;
  font-size: .82rem;
}
.jnl-menu-item {
  padding: .42rem .85rem;
  display: flex;
  align-items: center;
  border-radius: 0;
  transition: background .1s;
}
.jnl-menu-item:active, .jnl-menu-item:focus { outline: none; }

/* ── Journal number link ── */
.jnl-number-link {
  font-family: 'Courier New', monospace;
  font-size: .84rem;
  font-weight: 700;
  color: var(--itqan-primary);
  text-decoration: none;
  letter-spacing: .01em;
}
.jnl-number-link:hover { text-decoration: underline; }

/* ── Amount cells ── */
.jnl-amount-dr {
  font-size: .84rem;
  font-weight: 600;
  color: #1e40af;
  font-variant-numeric: tabular-nums;
}
.jnl-amount-cr {
  font-size: .84rem;
  font-weight: 600;
  color: #065f46;
  font-variant-numeric: tabular-nums;
}

/* ── Date & memo cells ── */
.jnl-date-cell {
  font-size: .82rem;
  color: #4b5563;
  white-space: nowrap;
}
.jnl-memo-cell {
  font-size: .82rem;
  color: #6b7280;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Status badges ── */
.jnl-badge {
  display: inline-block;
  padding: .22em .65em;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .01em;
}
.jnl-badge--draft     { background:#f1f5f9; color:#475569; border:1px solid #cbd5e1; }
.jnl-badge--submitted { background:#dbeafe; color:#1e40af; border:1px solid #93c5fd; }
.jnl-badge--approved  { background:#e0f2fe; color:#0369a1; border:1px solid #7dd3fc; }
.jnl-badge--posted    { background:#dcfce7; color:#15803d; border:1px solid #86efac; }
.jnl-badge--unposted  { background:#fef9c3; color:#a16207; border:1px solid #fde047; }
.jnl-badge--rejected  { background:#fee2e2; color:#dc2626; border:1px solid #fca5a5; }
.jnl-badge--cancelled { background:#f3f4f6; color:#6b7280; border:1px solid #d1d5db; }

/* ── Card header totals ── */
.jnl-header-count {
  background: rgba(255,255,255,.22);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: .12em .55em;
  border-radius: 20px;
}
.jnl-header-totals {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.jnl-total-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255,255,255,.12);
  padding: .22rem .65rem;
  border-radius: 8px;
}
.jnl-total-label {
  font-size: .72rem;
  color: rgba(255,255,255,.75);
  font-weight: 600;
}
.jnl-total-val {
  font-size: .82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.jnl-header-totals .gl-dr { color: #93c5fd; }
.jnl-header-totals .gl-cr { color: #6ee7b7; }
.jnl-total-sep {
  width: 1px; height: 20px;
  background: rgba(255,255,255,.2);
}

/* ── Search bar ── */
.jnl-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.jnl-search-icon {
  position: absolute;
  inset-inline-start: .6rem;
  color: #94a3b8;
  font-size: .82rem;
  pointer-events: none;
}
.jnl-search-input {
  height: 32px;
  font-size: .82rem;
  width: 230px;
  padding-inline-start: 1.8rem;
  padding-inline-end: 1.8rem;
  border-radius: 8px;
}
[dir="rtl"] .jnl-search-icon { inset-inline-start: auto; inset-inline-end: .6rem; }
[dir="rtl"] .jnl-search-input { padding-inline-start: 1.8rem; padding-inline-end: 1.8rem; }
.jnl-search-clear {
  position: absolute;
  inset-inline-end: .5rem;
  color: #94a3b8;
  font-size: .82rem;
  text-decoration: none;
  line-height: 1;
}
.jnl-search-clear:hover { color: #64748b; }

/* ── Filter pills with count badges ── */
.jnl-filter-btn {
  height: 28px;
  padding-block: 0;
  padding-inline: .65rem;
  font-size: .78rem;
  border-radius: 20px !important;
  font-weight: 600;
  border-width: 1px;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.jnl-filter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15,23,42,.1);
}
.jnl-filter-btn.active {
  filter: saturate(1.1);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3), 0 2px 8px rgba(15,23,42,.14);
}
.jnl-pill-count {
  background: rgba(0,0,0,.12);
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
  padding: 0 .38em;
  min-width: 1.3em;
  text-align: center;
  line-height: 1.4;
}
.jnl-filter-btn--all       { background:#475569 !important; color:#fff !important; border-color:#475569 !important; }
.jnl-filter-btn--all .jnl-pill-count { background:rgba(255,255,255,.25); }
.jnl-filter-btn--draft     { background:#f1f5f9; color:#475569; border-color:#cbd5e1; }
.jnl-filter-btn--submitted { background:#dbeafe; color:#1e40af; border-color:#93c5fd; }
.jnl-filter-btn--approved  { background:#e0f2fe; color:#0369a1; border-color:#7dd3fc; }
.jnl-filter-btn--posted    { background:#dcfce7; color:#15803d; border-color:#86efac; }
.jnl-filter-btn--unposted  { background:#fef9c3; color:#a16207; border-color:#fde047; }
.jnl-filter-btn--rejected  { background:#fee2e2; color:#dc2626; border-color:#fca5a5; }
.jnl-filter-btn--cancelled { background:#f3f4f6; color:#6b7280; border-color:#d1d5db; }
.jnl-filter-btn--all:hover,
.jnl-filter-btn--all.active { color:#fff !important; }

/* FA module filter pills (unchanged) */
.fa-filter-btn--new        { background:#f1f5f9; color:#334155; border-color:#cbd5e1; }
.fa-filter-btn--open       { background:#dcfce7; color:#166534; border-color:#86efac; }
.fa-filter-btn--suspended  { background:#ede9fe; color:#5b21b6; border-color:#c4b5fd; }
.fa-filter-btn--closed     { background:#fef3c7; color:#92400e; border-color:#fcd34d; }
.fa-filter-btn--sold       { background:#ffe4e6; color:#9f1239; border-color:#fda4af; }
.fa-filter-btn--scrapped   { background:#e5e7eb; color:#1f2937; border-color:#9ca3af; }

/* ============================================================
   JOURNALS — Sidebar & Recent-panel toggles
   ============================================================ */

/* Sidebar collapsed: hide sidebar, expand content */
body.sidebar-collapsed .itqan-sidebar {
  display: none !important;
}
body.sidebar-collapsed .itqan-content {
  margin-inline-start: 0 !important;
}

/* ============================================================
   JOURNALS — Lines Grid extras
   ============================================================ */

/* Lines table vertical scroll (horizontal handled by .jnl-lines-scroll) */
.jnl-lines-wrap {
  min-height: 220px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  overflow-x: visible;
}

/* "Add line" button in section header */
.jnl-add-line-btn {
  height: 28px;
  font-size: .78rem;
  padding-block: 0;
  padding-inline: .65rem;
  border-radius: 6px;
}

/* Highlighted item in suggestion dropdown (arrow-key navigation) */
.jnl-suggest-item.active {
  background: #e8f0fe;
  color: #1a56db;
}

/* FX rate read-only display in lines table */
.jnl-fxrate-disp {
  font-size: .76rem;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Audit badges in card header ── */
.jnl-audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: .72rem;
  white-space: nowrap;
  cursor: default;
}

.jnl-audit-badge--created {
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .22);
}

.jnl-audit-badge--modified {
  background: rgba(253, 230, 138, .15);
  border: 1px solid rgba(253, 230, 138, .30);
}

.jnl-audit-badge-icon {
  font-size: .82rem;
  opacity: .75;
  color: #fff;
  flex-shrink: 0;
  line-height: 1;
}

.jnl-audit-badge-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.25;
}

.jnl-audit-badge-label {
  font-size: .60rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .60);
}

.jnl-audit-badge-who {
  font-size: .72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .90);
}

.jnl-audit-badge-when {
  font-size: .64rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .65);
  letter-spacing: .01em;
}

/* ── Column resizer handle ── */
.gl-lines-table thead th {
  position: relative; /* needed for resizer positioning */
}

.col-resizer {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
  border-inline-end: 2px solid transparent;
  transition: border-color .15s;
}

.col-resizer:hover,
.col-resizer:active {
  border-inline-end-color: var(--itqan-primary);
  background: rgba(11, 61, 145, .06);
}

/* Account-type select inside grid */
.gl-line-type-cell {
  min-width: 88px;
  padding-inline: .25rem !important;
}
.gl-lines-table .form-select-sm {
  height: 26px;
  padding-block: 0;
  padding-inline: .35rem;
  font-size: .78rem;
  border-color: transparent;
  background: transparent;
  border-radius: 4px;
}
.gl-lines-table .form-select-sm:focus {
  border-color: var(--itqan-primary);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(11, 61, 145, .12);
}

/* Sub-account / Main-account cells */
.gl-line-sub-cell,
.gl-line-main-cell {
  min-width: 100px;
  padding-inline: .25rem !important;
}

/* Read-only main account locked by auto-resolve (Bank/Customer/Vendor) */
.jnl-main-locked {
  background: #eef2ff !important;
  color: #3730a3 !important;
  border-color: #c7d2fe !important;
  cursor: default;
}

/* خانة حساب لم تُحلّ، أو حساب فرعي مطلوب لم يُنقل إليه التركيز لأن المستخدم يكتب المبلغ (البند 260).
   صنف لا is-invalid: كاتب البند يمسح is-invalid عند أول رقم */
.jnl-sub-acct-code.jnl-sub-required,
.gl-acct-code.jnl-acct-unresolved {
  border-color: var(--bs-danger) !important;
  box-shadow: 0 0 0 .15rem rgba(var(--bs-danger-rgb), .2);
}

/* Small account-name hint below the input */
.jnl-acct-hint {
  font-size: .7rem;
  color: #6b7280;
  min-height: .85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  padding-inline: .1rem;
  margin-top: 1px;
}

/* Clickable account/sub-account link inside the hint row */
.jnl-acct-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed #9ca3af;
}
.jnl-acct-link:hover {
  color: #2563eb;
  border-bottom-color: #2563eb;
  text-decoration: none;
}

/* Lookup wrapper — positions the dropdown */
.jnl-lookup-wrap {
  position: relative;
}

/* Autocomplete suggestions dropdown */
.jnl-suggest {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  z-index: 1050;
  background: #fff;
  border: 1px solid #cdd5e0;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  min-width: 240px;
  max-width: 380px;
  max-height: 220px;
  overflow-y: auto;
}

.jnl-suggest-item {
  padding: .35rem .65rem;
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .35rem;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
}
.jnl-suggest-item:last-child { border-bottom: none; }
.jnl-suggest-item:hover {
  background: #eef6ff;
}
.jnl-suggest-code {
  font-family: 'Courier New', monospace;
  font-size: .76rem;
  color: #0b3d91;
  font-weight: 700;
  flex-shrink: 0;
}
.jnl-suggest-sep {
  color: #9ca3af;
  font-size: .76rem;
  flex-shrink: 0;
}
.jnl-suggest-name {
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── البند 385: شريط أبعاد السطر ──
   صفٌّ تحت السطر يمتد بعرض الجدول، وما فيه ثابت في الجزء الظاهر من الإطار مهما مُرِّر أفقياً،
   فتُرى خانات الأبعاد على أي عرض. ولا يظهر إلا حين في السطر بعد (خانة اختيار أو قيمة محفوظة). */
.jnl-lines-wrap {
  container-type: inline-size;
}
/* الجدول يملأ إطاره دائماً، فلا تتّسع أعمدته فجأة حين يظهر أول شريط بعرض الإطار */
#linesTable {
  width: 100%;
}
.gl-lines-table tr.jnl-dim-row:not(:has(.jnl-dim-picker, .jnl-dim-chip, .jnl-dim-note)) {
  display: none;
}
.gl-lines-table tr.jnl-dim-row > td {
  padding: .15rem .5rem .5rem !important;
  border-top: 0;
  border-bottom: 1px solid #edf2f7;
  background: #f8fafc;
}
.jnl-dim-note {
  font-size: .75rem;
  color: #b91c1c;
}
.jnl-dim-strip {
  position: sticky;
  inset-inline-start: 0;
  width: calc(100cqi - 1rem);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .4rem 1rem;
}
.jnl-dim-strip-label {
  align-self: center;
  font-size: .72rem;
  font-weight: 700;
  color: #92400e;
}
.jnl-dim-strip .jnl-dim-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .4rem 1rem;
}
.jnl-dim-picker {
  min-width: 200px;
}
.jnl-dim-picker--required > .small::after {
  content: " *";
  color: #dc2626;
}
.jnl-dim-picker .jnl-dim-select {
  border: 1px solid #d1d5db;
  background-color: #fff;
}
.jnl-dim-chip {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  padding: .1rem .5rem;
  border: 1px solid #fde68a;
  border-radius: 999px;
  background: #fff;
}
.jnl-dim-chip .jnl-dim-codes,
.jnl-dim-chip .jnl-dim-descs {
  max-width: none;
  margin-top: 0;
}
/* البند 430: أبعاد المستند في رأسه (document-line-dimensions.js) — اختيار قيمة يملأ كل البنود */
.doc-dims-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .4rem 1rem;
  margin-bottom: .5rem;
  padding: .45rem .7rem;
  border: 1px dashed #fde68a;
  border-radius: .45rem;
  background: #fffbeb;
}
.doc-dims-header[hidden] {
  display: none;
}
.doc-dims-header-hint {
  align-self: center;
  font-size: .72rem;
  color: #6b7280;
}
.doc-dims-header-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .4rem 1rem;
}

/* Delete button inside grid row */
.gl-line-del-cell {
  padding-inline: .2rem !important;
  text-align: center;
  white-space: nowrap;
}
.jnl-del-btn {
  width: 22px;
  height: 22px;
  padding: 0 !important;
  font-size: .72rem !important;
  line-height: 1 !important;
  color: #9ca3af !important;
  border: none !important;
  background: transparent !important;
  border-radius: 4px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.jnl-del-btn:hover {
  color: #dc2626 !important;
  background: #fee2e2 !important;
}

.jnl-cell-error {
  margin-top: .18rem;
  color: #991b1b;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.25;
}

.jnl-line-row--invalid {
  background: #fef2f2 !important;
  box-shadow: inset 0 0 0 1px #fecaca;
}

.gl-lines-table .is-invalid {
  border-color: #dc2626 !important;
  background: #fff7f7 !important;
}

/* Recent-panel toggle button highlight */
.jnl-recent-toggle.active-toggle {
  background: #e0edff !important;
  border-color: #93c5fd !important;
  color: var(--itqan-primary) !important;
}

/* ============================================================
   JOURNALS — Two-column flex layout (replaces Bootstrap grid)
   ============================================================ */
.coa-split-layout {
  --split-pane-size: 390px;
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.coa-split-layout > #coa-sidebar {
  flex: 0 0 var(--split-pane-size);
  width: var(--split-pane-size);
  max-width: none;
  min-width: 0;
}

.coa-split-layout > #coa-main {
  flex: 1 1 auto;
  min-width: 0;
  padding-inline-start: .5rem;
}

.coa-split-resizer {
  position: relative;
  align-self: stretch;
  flex: 0 0 1rem;
  min-height: 12rem;
  cursor: col-resize;
  touch-action: none;
  outline: 0;
}

.coa-split-resizer::after {
  content: "";
  position: absolute;
  inset-block: .5rem;
  inset-inline-start: calc(50% - 2px);
  width: 4px;
  border-radius: 2px;
  background: #9ca3af;
  box-shadow: inset 1px 0 #edf1f6, inset -1px 0 #aeb8c7;
  opacity: 0;
  transition: opacity 120ms ease-out;
}

.coa-split-resizer:hover::after,
.coa-split-resizer:focus-visible::after,
.coa-split-resizer.is-resizing::after {
  background: #9ca3af;
  box-shadow: none;
  opacity: 1;
}

.coa-split-resizer.is-resizing::after {
  background: #6b7280;
}

.coa-split-resizer:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(107, 114, 128, .18);
  border-radius: 6px;
}

body.is-split-resizing,
body.is-split-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

#coa-layout.coa-collapsed #coa-sidebar,
#coa-layout.coa-collapsed .coa-split-resizer {
  display: none !important;
}

#coa-layout.coa-collapsed #coa-main {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  padding-inline-start: 0;
}

@media (max-width: 991.98px) {
  .coa-split-layout {
    flex-direction: column;
    gap: 1rem;
  }

  .coa-split-layout > #coa-sidebar,
  .coa-split-layout > #coa-main {
    flex-basis: auto;
    width: 100%;
    max-width: none;
    padding-inline-start: 0;
  }

  .coa-split-resizer {
    display: none;
  }
}

.jnl-shell {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.jnl-recent-pane {
  width: 380px;
  flex: 0 0 380px;
  overflow: hidden;
  transition: flex-basis 0.22s ease, width 0.22s ease, opacity 0.18s ease;
}

.jnl-recent-pane.jnl-panel-hidden {
  display: none !important;
  width: 0;
  flex-basis: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.jnl-main-pane {
  flex: 1;
  min-width: 0; /* prevents flex child overflow */
}

@media (max-width: 767.98px) {
  /* البند 385: العمود الواحد يتمدّد بعرض الشاشة. ومع flex-start كان جزء المستند
     يأخذ عرض محتواه (العرض الأدنى لجدول الأسطر) فتنزاح الصفحة كلها على الهاتف. */
  .jnl-shell {
    flex-direction: column;
    align-items: stretch;
  }
  .jnl-recent-pane {
    width: 100% !important;
    opacity: 1 !important;
  }
  .jnl-recent-pane.jnl-panel-hidden {
    display: none;
  }
}

/* ── Merged Dimensions two-line display ── */
.jnl-dim-codes {
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: .72rem;
  color: #0b3d91;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 155px;
}

.jnl-dim-descs {
  font-size: .68rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 155px;
  margin-top: 1px;
}

/* ── Local Debit / Credit (auto-computed, read-only) ── */
.jnl-local-debit,
.jnl-local-credit {
  background: #f4f7fb !important;
  color: #6b7280 !important;
  cursor: default;
}

/* ============================================================
   JOURNALS — Scrollable lines table container
   ============================================================ */
.jnl-lines-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.jnl-line-actions {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.gl-lines-table.jnl-fx-collapsed .jnl-fx-col {
  display: none;
}

.jnl-live-summary {
  position: sticky;
  top: .5rem;
  z-index: 8;
  margin-bottom: .55rem;
  display: flex;
  align-items: stretch;
  gap: .5rem;
  padding: .5rem;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .06);
}

.jnl-live-total {
  min-width: 136px;
  padding: .38rem .7rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}

.jnl-live-total span {
  display: block;
  color: #64748b;
  font-size: .72rem;
  font-weight: 700;
}

.jnl-live-total strong {
  display: block;
  direction: ltr;
  margin-top: .08rem;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.jnl-live-total--diff.is-balanced strong { color: #047857; }
.jnl-live-total--diff.is-unbalanced {
  background: #fff7ed;
  border-color: #fed7aa;
}
.jnl-live-total--diff.is-unbalanced strong { color: #b91c1c; }

.jnl-live-state {
  display: flex;
  align-items: center;
  margin-inline-start: auto;
}

.jnl-balance-chip,
.jnl-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  min-height: 22px;
  border-radius: 999px;
  padding: .14rem .48rem;
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
}

.jnl-balance-chip {
  min-height: 30px;
  padding-inline: .72rem;
  font-size: .78rem;
}

.jnl-balance-chip i,
.jnl-status-chip i {
  font-size: .72rem;
  line-height: 1;
}

.jnl-balance-chip--balanced {
  background: #d1fae5;
  border: 1px solid #86efac;
  color: #065f46;
}

.jnl-balance-chip--unbalanced {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}

/* ============================================================
   STATUS BADGE with date — replaces simple bootstrap badge
   ============================================================ */
.jnl-sbadge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  border-radius: 8px;
  padding: 3px 10px;
  line-height: 1.2;
  font-size: .78rem;
  font-weight: 600;
  min-width: 90px;
}

.jnl-sbadge-label {
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.jnl-sbadge-date {
  font-size: .64rem;
  font-weight: 400;
  opacity: .85;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Status colour variants */
.jnl-sbadge--posted    { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.jnl-sbadge--unposted  { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.jnl-sbadge--submitted { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.jnl-sbadge--approved  { background: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; }
.jnl-sbadge--rejected  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.jnl-sbadge--returned  { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.jnl-sbadge--balanced  { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.jnl-sbadge--unbalanced{ background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.jnl-sbadge--cancelled { background: #f3f4f6; color: #6b7280; border: 1px solid #d1d5db; }
.jnl-sbadge--draft     { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

.jnl-workflow-strip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}

.jnl-workflow-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  min-height: 24px;
  border-radius: 999px;
  padding: .15rem .55rem;
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════
   Journal header (redesigned) — identity · status · workflow track · audit
   ════════════════════════════════════════════════════ */
.jhdr {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

/* Row 1 — identity + status (start) · audit (end) */
.jhdr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
  flex-wrap: wrap;
}

.jhdr-identity {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  min-width: 0;
}

/* Primary status pill (single loud focal element) */
.jhdr-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 999px;
  padding: .2rem .7rem;
  font-weight: 700;
  font-size: .8rem;
  line-height: 1.1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.jhdr-status > .bi { font-size: .9rem; }
.jhdr-status-label { font-weight: 800; letter-spacing: .01em; }
.jhdr-status-date {
  font-size: .64rem;
  font-weight: 500;
  opacity: .8;
  padding-inline-start: .35rem;
  margin-inline-start: .1rem;
  border-inline-start: 1px solid currentColor;
}

/* Audit meta — subdued, secondary */
.jhdr-audit {
  display: flex;
  align-items: center;
  gap: .35rem .9rem;
  flex-wrap: wrap;
}
.jhdr-audit-item {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .68rem;
  color: rgba(255, 255, 255, .72);
  white-space: nowrap;
  cursor: default;
}
.jhdr-audit-item > .bi { font-size: .78rem; opacity: .8; }
.jhdr-audit-label {
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255, 255, 255, .55);
}
.jhdr-audit-who { font-weight: 600; color: rgba(255, 255, 255, .92); }
.jhdr-audit-when { color: rgba(255, 255, 255, .62); }
.jhdr-audit-item--mod { padding-inline-start: .9rem; border-inline-start: 1px solid rgba(255, 255, 255, .18); }

/* Row 2 — workflow state track */
.jhdr-track {
  display: inline-flex;
  align-self: flex-start;
  align-items: stretch;
  gap: .25rem;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  padding: .3rem .5rem;
  max-width: 100%;
  flex-wrap: wrap;
}
.jhdr-stage {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .1rem .55rem;
}
.jhdr-stage-ico { font-size: 1rem; color: rgba(255, 255, 255, .78); flex-shrink: 0; }
.jhdr-stage-text { display: flex; flex-direction: column; line-height: 1.25; }
.jhdr-stage-label {
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255, 255, 255, .58);
}
.jhdr-stage-value {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .95);
  white-space: nowrap;
}
.jhdr-track-sep { width: 1px; background: rgba(255, 255, 255, .18); margin: .1rem 0; }

/* Status dots */
.jhdr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .18);
}
.jhdr-dot--ok   { background: #34d399; }
.jhdr-dot--info { background: #60a5fa; }
.jhdr-dot--warn { background: #fbbf24; }
.jhdr-dot--bad  { background: #f87171; }
.jhdr-dot--mut  { background: #cbd5e1; }

@media (max-width: 991.98px) {
  .jhdr-top { align-items: flex-start; }
  .jhdr-audit { width: 100%; }
}

.jnl-trace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .55rem;
}

.jnl-trace-item {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: .55rem .7rem;
}

.jnl-trace-item span {
  display: block;
  color: #64748b;
  font-size: .72rem;
  font-weight: 700;
}

.jnl-trace-item strong {
  display: block;
  margin-top: .15rem;
  color: #0f172a;
  font-size: .86rem;
}

.jnl-reason-box {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  padding: .65rem .8rem;
  font-size: .84rem;
  font-weight: 700;
}

.jnl-audit-panel {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.jnl-audit-panel-title {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem .8rem;
  background: #f4f7fb;
  border-bottom: 1px solid #dbe4f0;
  color: #0b3d91;
  font-size: .85rem;
  font-weight: 800;
}

.jnl-audit-table {
  font-size: .78rem;
}

.jnl-control-filters {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}

/* ============================================================
   FX RATE CELL — two-line (input + formula label)
   ============================================================ */
.jnl-fxrate-cell {
  min-width: 160px;
  padding-inline: .25rem !important;
  vertical-align: middle;
}

.jnl-fxrate-input {
  height: 26px !important;
  padding-block: 0 !important;
  padding-inline: .4rem !important;
  font-size: .78rem !important;
  border-color: transparent !important;
  background: transparent !important;
  border-radius: 4px !important;
  text-align: end;
  width: 100%;
}

.jnl-fxrate-input:focus {
  border-color: var(--itqan-primary) !important;
  background: #fff !important;
  box-shadow: 0 0 0 2px rgba(11, 61, 145, .12) !important;
}

.jnl-fxrate-readonly {
  background: #f4f7fb !important;
  color: #9ca3af !important;
  cursor: default;
}

.jnl-fxrate-formula {
  font-size: .65rem;
  color: #9ca3af;
  text-align: end;
  padding-inline-end: .35rem;
  margin-top: 1px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

/* Remove number input spinners (up/down arrows) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* Sidebar row link keyboard focus ring */
.gl-acct-row a:focus {
  outline: 2px solid var(--itqan-primary);
  outline-offset: 1px;
  border-radius: 2px;
}

/* ============================================================
   SETTINGS — Document Books
   ============================================================ */
.document-books-page {
  color: #1f2937;
}

.document-books-toolbar-title {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: #0b3d91;
  font-size: .88rem;
  font-weight: 700;
}

.document-books-shell {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.document-books-side-card {
  width: min(42vw, 460px);
  flex: 0 0 min(42vw, 460px);
  min-width: 360px;
}

.document-books-main-card {
  flex: 1 1 auto;
  min-width: 0;
}

.document-books-list-card {
  min-height: 520px;
  max-height: calc(100vh - 160px);
}

.document-books-list-card .badge {
  font-size: .7rem;
}

.document-books-search-wrap {
  position: relative;
}

.document-books-filter-form {
  display: grid;
  gap: .5rem;
}

.document-books-search-wrap > i {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: .65rem;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: .82rem;
  pointer-events: none;
}

.document-books-search-wrap .form-control {
  padding-inline-start: 2rem;
}

.document-books-list-scroll {
  background: #fff;
}

.document-books-list {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}

.document-books-list thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f7fb;
  padding: .42rem .6rem;
  color: #6b7280;
  border-bottom: 2px solid #dde5f0;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.document-book-row td {
  padding: .42rem .6rem;
  border-bottom: 1px solid #edf2f7;
  vertical-align: middle;
}

.document-book-row:nth-child(odd) { background: #ffffff; }
.document-book-row:nth-child(even) { background: #eaf7ff; }
.document-book-row:hover {
  background: #dff1ff !important;
  cursor: pointer;
}

.document-book-row-active {
  background: #d6e9ff !important;
  border-inline-start: 4px solid #0d6efd;
}

.document-book-row-active td {
  color: #0b3d91;
  font-weight: 600;
}

.document-book-code,
.document-book-name {
  color: inherit;
  text-decoration: none;
}

.document-book-code {
  display: inline-block;
  font-family: 'Courier New', 'Consolas', monospace;
  font-weight: 700;
  color: #0b3d91;
  white-space: nowrap;
}

.document-book-name {
  display: inline-block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-book-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: .16rem .45rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #374151;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.document-book-type-badge--journal { background: #e0f2fe; border-color: #7dd3fc; color: #0c4a6e; }
.document-book-type-badge--receipt { background: #d1fae5; border-color: #86efac; color: #166534; }
.document-book-type-badge--payment { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.document-book-type-badge--asset   { background: #fef9c3; border-color: #fde68a; color: #854d0e; }
.document-book-type-badge--budget  { background: #ede9fe; border-color: #c4b5fd; color: #5b21b6; }
.document-book-type-badge--sales   { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }

.document-books-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.document-books-code-field .form-control {
  letter-spacing: .04em;
}

.document-books-format-card {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .15rem;
  padding: .65rem .8rem;
  border: 1px solid #dde5f0;
  border-radius: 8px;
  background: #f4f7fb;
}

.document-books-format-label {
  color: #6b7280;
  font-size: .76rem;
  font-weight: 700;
}

.document-books-format-value {
  color: #0b3d91;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .03em;
}

.document-books-settings-card {
  margin-top: 1rem;
  padding: .85rem;
  border: 1px solid #e9eff7;
  border-radius: 8px;
  background: #ffffff;
}

.document-books-settings-title {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .65rem;
  color: #374151;
  font-size: .82rem;
  font-weight: 700;
}

.document-books-settings-card .gl-switches-card {
  min-height: 82px;
}

.document-books-settings-card .form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.document-book-validation-panel {
  margin-bottom: 1rem;
}

@media (max-width: 1199.98px) {
  .document-books-side-card {
    width: 380px;
    flex-basis: 380px;
    min-width: 320px;
  }
}

@media (max-width: 991.98px) {
  .document-books-shell {
    flex-direction: column;
  }

  .document-books-side-card,
  .document-books-main-card {
    width: 100%;
    flex-basis: auto;
    min-width: 0;
  }

  .document-books-list-card {
    min-height: 320px;
    max-height: 420px;
  }
}

@media (max-width: 575.98px) {
  .document-books-form-grid {
    grid-template-columns: 1fr;
  }

  .document-books-toolbar {
    align-items: stretch;
  }

  .document-books-toolbar-title {
    width: 100%;
    padding-block-start: .35rem;
  }
}

/* ============================================================
   SETTINGS — Numeric Sequences
   ============================================================ */
.numeric-sequences-page {
  color: #1f2937;
}

.numeric-sequences-toolbar-title {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: #0b3d91;
  font-size: .88rem;
  font-weight: 700;
}

.numeric-sequences-shell {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.numeric-sequences-side-card {
  width: min(38vw, 420px);
  flex: 0 0 min(38vw, 420px);
  min-width: 330px;
}

.numeric-sequences-main-card {
  flex: 1 1 auto;
  min-width: 0;
}

.numeric-sequences-list-card {
  min-height: 520px;
  max-height: calc(100vh - 160px);
}

.numeric-sequences-list-card .badge {
  font-size: .7rem;
}

.numeric-sequences-search-wrap {
  position: relative;
}

.numeric-sequences-search-wrap > i {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: .65rem;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: .82rem;
  pointer-events: none;
}

.numeric-sequences-search-wrap .form-control {
  padding-inline-start: 2rem;
}

.numeric-sequences-list-scroll {
  background: #fff;
}

.numeric-sequences-list {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}

.numeric-sequences-list thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f7fb;
  padding: .42rem .6rem;
  color: #6b7280;
  border-bottom: 2px solid #dde5f0;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.numeric-sequence-row td {
  padding: .42rem .6rem;
  border-bottom: 1px solid #edf2f7;
  vertical-align: middle;
}

.numeric-sequence-row:nth-child(odd) { background: #ffffff; }
.numeric-sequence-row:nth-child(even) { background: #eaf7ff; }
.numeric-sequence-row:hover {
  background: #dff1ff !important;
  cursor: pointer;
}

.numeric-sequence-row-active {
  background: #d6e9ff !important;
  border-inline-start: 4px solid #0d6efd;
}

.numeric-sequence-row-active td {
  color: #0b3d91;
  font-weight: 600;
}

.numeric-sequence-code,
.numeric-sequence-name {
  color: inherit;
  text-decoration: none;
}

.numeric-sequence-code,
.numeric-sequence-prefix {
  font-family: 'Courier New', 'Consolas', monospace;
  font-weight: 700;
}

.numeric-sequence-code {
  display: inline-block;
  color: #0b3d91;
  white-space: nowrap;
}

.numeric-sequence-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: .12rem .38rem;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .72rem;
  white-space: nowrap;
}

.numeric-sequence-name {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.numeric-sequences-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.numeric-sequences-code-field .form-control {
  letter-spacing: .04em;
}

.numeric-sequences-preview-card {
  min-height: 72px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  align-items: center;
  padding: .65rem .8rem;
  border: 1px solid #dde5f0;
  border-radius: 8px;
  background: #f4f7fb;
}

.numeric-sequences-preview-label,
.numeric-sequences-preview-value {
  display: block;
}

.numeric-sequences-preview-label {
  color: #6b7280;
  font-size: .76rem;
  font-weight: 700;
}

.numeric-sequences-preview-value {
  margin-top: .15rem;
  color: #0b3d91;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}

.numeric-sequences-settings-card {
  margin-top: 1rem;
  padding: .85rem;
  border: 1px solid #e9eff7;
  border-radius: 8px;
  background: #ffffff;
}

.numeric-sequences-settings-title {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .65rem;
  color: #374151;
  font-size: .82rem;
  font-weight: 700;
}

.numeric-sequences-settings-card .gl-switches-card {
  min-height: 58px;
}

.numeric-sequences-settings-card .form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.numeric-sequence-validation-panel {
  margin-bottom: 1rem;
}

.numeric-sequences-padding-input {
  width: 70px;
}

@media (max-width: 1199.98px) {
  .numeric-sequences-side-card {
    width: 360px;
    flex-basis: 360px;
    min-width: 320px;
  }
}

@media (max-width: 991.98px) {
  .numeric-sequences-shell {
    flex-direction: column;
  }

  .numeric-sequences-side-card,
  .numeric-sequences-main-card {
    width: 100%;
    flex-basis: auto;
    min-width: 0;
  }

  .numeric-sequences-list-card {
    min-height: 320px;
    max-height: 420px;
  }
}

@media (max-width: 575.98px) {
  .numeric-sequences-form-grid,
  .numeric-sequences-preview-card {
    grid-template-columns: 1fr;
  }

  .numeric-sequences-toolbar {
    align-items: stretch;
  }

  .numeric-sequences-toolbar-title {
    width: 100%;
    padding-block-start: .35rem;
  }
}

/* ── Keyboard navigation tip bar (shared across all screens) ── */
.kb-tip {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  padding: .45rem 1rem;
  font-size: .71rem;
  color: #6b7280;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.kb-tip kbd {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: .1rem .35rem;
  font-size: .7rem;
  color: #374151;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

/* Journal inquiry */
.gl-inquiry-page {
  --inq-panel: 280px;
}
.inq-toolbar-title {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: #475569;
  font-weight: 700;
}
.inq-view-pills {
  max-width: min(720px, 52vw);
}
.inq-view-chip {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
.inq-view-chip.active {
  background: #475569 !important;
  color: #fff !important;
  border-color: #475569 !important;
}
.inq-quick-search .jnl-search-input {
  width: 230px;
}
.inq-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.inq-main {
  flex: 1;
  min-width: 0;
}
.inq-filter-panel {
  width: var(--inq-panel);
  flex: 0 0 var(--inq-panel);
  border: 1px solid #dde5f0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
  background: #ffffff;
  overflow: hidden;
  transition: width .25s ease, flex-basis .25s ease, opacity .2s ease;
}
.inq-panel-hidden {
  width: 0 !important;
  flex-basis: 0 !important;
  opacity: 0;
  pointer-events: none;
}
.inq-filter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  margin: 0;
  padding: .55rem .9rem;
  background: var(--itqan-primary);
  color: #fff;
}
.inq-filter-title {
  color: #fff;
  font-weight: 700;
  font-size: .86rem;
}
.inq-filter-sub {
  color: rgba(255, 255, 255, .75);
  font-size: .72rem;
  line-height: 1.45;
}
.inq-chip {
  min-width: 2rem;
  height: 1.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .22);
  color: #fff;
  font-weight: 700;
  font-size: .75rem;
}
.inq-filter-form {
  max-height: calc(100vh - 190px);
  min-height: 400px;
  overflow-y: auto;
}
.inq-filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .55rem;
  padding: .65rem;
  background: #f4f7fb;
}
.inq-filter-tabs {
  padding: 0;
  border-bottom: 1px solid #dde5f0;
  overflow-x: visible;
}
.inq-filter-tabs .nav-link {
  min-height: 34px;
  padding: .4rem .55rem;
  font-size: .76rem;
  white-space: nowrap;
}
.inq-filter-tab-content .tab-pane {
  display: none;
}
.inq-filter-tab-content .tab-pane.active {
  display: block;
}
.inq-filter-tab-content .gl-form-group + .gl-form-group {
  margin-top: .55rem;
}
.inq-search-wide {
  grid-column: auto;
}
.inq-filter-panel .gl-form-group {
  margin-bottom: 0;
}
.inq-filter-panel .form-label {
  margin-bottom: .18rem;
  font-size: .72rem;
}
.inq-filter-panel .form-control,
.inq-filter-panel .form-select {
  height: 30px;
  padding-block: .3rem;
  font-size: .82rem;
  border-color: #cdd5e0;
  border-radius: 6px;
  background: #fff;
}
.inq-filter-panel .btn-primary {
  margin: .65rem;
  width: calc(100% - 1.3rem) !important;
}
.inq-entity-header {
  min-height: 49px;
  padding: .55rem .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--itqan-primary);
  border-radius: 10px 10px 0 0;
  color: #fff;
}
.inq-kicker {
  display: none;
}
.inq-entity-header h1 {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
}
.inq-entity-header h1::before {
  content: "\F449";
  font-family: "bootstrap-icons";
  margin-inline-end: .42rem;
}
.inq-summary {
  display: flex;
  gap: .55rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.inq-total-box {
  min-width: 104px;
  padding: .28rem .58rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: .42rem;
}
.inq-total-box--wide {
  min-width: 190px;
}
.inq-total-box span {
  display: block;
  color: rgba(255, 255, 255, .72);
  font-size: .7rem;
}
.inq-total-box strong {
  display: block;
  direction: ltr;
  font-variant-numeric: tabular-nums;
  font-size: .86rem;
}
.inq-context-strip {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .42rem .9rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  font-size: .76rem;
}
.inq-context-strip span {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.inq-context-warning {
  color: #92400e;
}
.inq-tabs {
  padding-inline: 1rem;
  padding-top: .55rem;
  overflow-x: auto;
  flex-wrap: nowrap;
}
.inq-tabs .nav-link {
  white-space: nowrap;
}
.inq-grid-wrap {
  max-height: calc(100vh - 360px);
  min-height: 320px;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}
.inq-grid {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.inq-grid th,
.inq-grid td {
  white-space: nowrap;
  vertical-align: middle;
}
.inq-grid th {
  min-width: 96px;
}
.inq-grid th[data-col="date"],
.inq-grid td:first-child {
  min-width: 112px;
}
.inq-grid th[data-col="journal"] {
  min-width: 110px;
}
.inq-grid th[data-col="book"] {
  min-width: 130px;
}
.inq-grid th[data-col="accountType"],
.inq-grid th[data-col="source"],
.inq-grid th[data-col="status"] {
  min-width: 105px;
}
.inq-grid th[data-col="subAccount"],
.inq-grid th[data-col="mainAccount"] {
  min-width: 150px;
}
.inq-grid th[data-col="description"] {
  min-width: 180px;
}
.inq-grid th[data-col="dimensions"],
.inq-grid th[data-col="dimensionValue"] {
  min-width: 145px;
}
.inq-grid th[data-col="debit"],
.inq-grid th[data-col="credit"],
.inq-grid th[data-col="balance"] {
  min-width: 112px;
}
.inq-grid td:nth-child(7) {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inq-grid thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
.inq-filter-row td {
  background: #fafafa;
  padding: .28rem .4rem;
}
.inq-column-filter {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: .28rem;
  padding: .18rem .3rem;
  background: #fafafa;
  font-size: .73rem;
}
.inq-column-filter:focus {
  outline: 0;
  border-color: #93c5fd;
  background: #fff;
}
.inq-sort-head {
  position: relative;
  cursor: pointer !important;
  user-select: none;
  white-space: nowrap;
  padding-inline-end: 1rem !important;
}
.inq-sort-head:hover {
  background: #f1f5f9;
}
.inq-sort-head.inq-sort-active {
  background: #eff6ff;
  color: #0b3d91;
}
.inq-sort-icon {
  font-size: .65rem;
  opacity: .28;
  margin-inline-start: .25rem;
}
.inq-sort-head:hover .inq-sort-icon,
.inq-sort-head.inq-sort-active .inq-sort-icon {
  opacity: 1;
  color: #1d4ed8;
}
.inq-col-resizer {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  z-index: 4;
}
.inq-col-resizer::after {
  content: "";
  position: absolute;
  top: 22%;
  bottom: 22%;
  inset-inline-start: 3px;
  width: 1px;
  background: transparent;
}
.inq-sort-head:hover .inq-col-resizer::after,
.inq-col-resizer:hover::after,
.inq-resizing .inq-col-resizer::after {
  background: #93c5fd;
}
.inq-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}
.inq-grid tbody tr {
  cursor: default;
}
.inq-grid tbody tr:focus,
.inq-grid tbody tr.inq-row-active {
  background: #bfdbfe !important;
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
  box-shadow: none;
}
.inq-code {
  display: block;
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #1d4ed8;
  font-weight: 700;
}
.inq-grid small,
.inq-preview-lines small {
  display: block;
  color: #64748b;
  font-size: .72rem;
}
.inq-source-link {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
}
.inq-source-link:hover {
  text-decoration: underline;
}
.inq-drill-link {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
}
.inq-drill-link:hover {
  text-decoration: underline;
}
.inq-balance {
  color: #334155;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* مصفوفة تحليل الأبعاد: عمود لكل قيمة بعد */
.inq-pivot th.inq-pivot-col {
  min-width: 130px;
  vertical-align: bottom;
}
.inq-pivot-dim {
  display: block;
  font-size: .68rem;
  font-weight: 400;
  color: #64748b;
}
.inq-pivot th.inq-pivot-col .inq-code {
  font-size: .78rem;
}
/* اسم قيمة البعد هو العنوان البارز، والكود سطر خافت تحته */
.inq-pivot-valname {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: #1f2937;
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inq-pivot th.inq-pivot-col small {
  font-weight: 400;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inq-pivot-valcode {
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #94a3b8;
  font-size: .68rem;
}
.inq-pivot-cell {
  font-variant-numeric: tabular-nums;
}
.inq-pivot-cell--empty {
  color: #cbd5e1;
}
/* الرصيد الدائن (السالب) أحمر بين قوسين */
.inq-amt-neg {
  color: #dc2626 !important;
}
/* ── لغة الأرقام الموحدة لتبويبات الاستعلام ── */
.inq-zero {
  color: #cbd5e1;
  font-weight: 400;
}
.inq-drill-head { min-width: 64px !important; }
.inq-drill-cell { text-align: center; }
.inq-drill-btn {
  display: inline-block;
  color: #64748b;
  font-size: .72rem;
  text-decoration: none;
  border: 1px solid #cdd5e0;
  border-radius: 6px;
  padding: 1px 8px;
  background: #fff;
  white-space: nowrap;
}
.inq-drill-btn:hover {
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #eff6ff;
}

/* ── عائلة التوزيعات: شريط الوزن النسبي ── */
.inq-weight-head { min-width: 170px !important; }
.inq-weight-cell { min-width: 170px; }
.inq-weight {
  background: #edf2f7;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}
.inq-weight-fill {
  height: 100%;
  width: var(--w, 0%);
  background: var(--itqan-primary);
  opacity: .72;
}
.inq-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--itqan-primary);
}

/* ── تبويب الحركات المجمّع بالقيد ── */
.inq-layout-switch {
  display: inline-flex;
  border: 1px solid #cdd5e0;
  border-radius: 7px;
  overflow: hidden;
  margin-inline-start: .35rem;
}
.inq-layout-switch a {
  padding: 1px 12px;
  font-size: .72rem;
  color: #64748b;
  text-decoration: none;
  background: #fff;
}
.inq-layout-switch a.active {
  background: #eff6ff;
  color: var(--itqan-primary);
  font-weight: 700;
}
.inq-mov-idx { min-width: 34px !important; width: 34px; color: #94a3b8; }
tr.inq-jgrp td {
  background: #ebf3ff;
  border-block: 1px solid #dde5f0;
  padding: .32rem .6rem;
  cursor: pointer;
}
tr.inq-jgrp:focus { outline: 2px solid #3b82f6; outline-offset: -2px; }
.inq-jgrp-line {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  font-size: .8rem;
}
.inq-jgrp-caret {
  color: var(--itqan-primary);
  font-size: .6rem;
  transition: transform .15s;
}
tr.inq-jgrp.inq-jgrp--closed .inq-jgrp-caret { transform: rotate(90deg); }
.inq-jgrp-meta { color: #64748b; font-size: .75rem; }
.inq-jgrp-total {
  margin-inline-start: auto;
  color: #64748b;
  font-size: .76rem;
}
.inq-jgrp-total b {
  color: #1f2937;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  display: inline-block;
}
.inq-acct-ledger { color: #94a3b8; }
.inq-mov-desc { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.inq-mov-filter {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: .28rem;
  padding: .18rem .3rem;
  background: #fafafa;
  font-size: .73rem;
}
.inq-mov-filter:focus { outline: 0; border-color: #93c5fd; background: #fff; }

/* ── تبويب القيود: قائمة + معاينة جانبية ── */
.inq-main--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: .8rem;
  align-items: start;
}
.inq-main--split #journalPreviewHost {
  position: sticky;
  top: .5rem;
  min-width: 0;
}
.inq-main--split .inq-preview-lines { font-size: .74rem; }
@media (max-width: 1250px) {
  .inq-main--split { grid-template-columns: 1fr; }
  .inq-main--split #journalPreviewHost { position: static; }
}

/* عمودا الحساب الفرعي وحساب الأستاذ: الكود محاذاة يمين والاسم محاذاة يسار */
.inq-pivot tbody td:nth-child(1),
.inq-pivot tbody td:nth-child(2) {
  text-align: right;
}
.inq-pivot tbody td:nth-child(1) small,
.inq-pivot tbody td:nth-child(2) small {
  text-align: left;
}
.inq-pivot-total {
  font-variant-numeric: tabular-nums;
}
.inq-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .65rem 1rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.inq-kbd {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  color: #64748b;
  font-size: .76rem;
}
.inq-record-counter {
  color: #0b3d91;
  font-weight: 700;
  padding-inline-end: .4rem;
}
.inq-kbd kbd {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: .72rem;
  padding: .08rem .35rem;
}
.inq-pagination {
  display: flex;
  align-items: center;
  gap: .42rem;
}
.inq-pagination .btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 6px;
}
.inq-page-size {
  width: 86px;
  height: 32px;
  text-align: center;
  border-radius: 6px;
}
.inq-preview-card {
  margin-top: 1rem;
  resize: vertical;
  overflow: auto;
  min-height: 190px;
  max-height: 70vh;
}
.inq-preview-loading {
  opacity: .72;
  transition: opacity .12s ease;
}
.inq-preview-body {
  min-height: 130px;
}
.inq-preview-head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: .85rem;
}
.inq-preview-head div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .4rem;
  padding: .55rem .65rem;
}
.inq-preview-head span {
  display: block;
  color: #64748b;
  font-size: .72rem;
}
.inq-preview-head strong {
  display: block;
  color: #0f172a;
  font-size: .9rem;
}
.inq-empty {
  min-height: 340px;
}
@media (max-width: 1100px) {
  .inq-view-pills {
    max-width: 100%;
  }
  .inq-quick-search .jnl-search-input {
    width: 180px;
  }
  .inq-layout {
    flex-direction: column;
  }
  .inq-filter-panel {
    width: 100% !important;
    flex-basis: auto !important;
    opacity: 1;
  }
  .inq-filter-form {
    min-height: 0;
    max-height: none;
  }
  .inq-panel-hidden {
    display: none;
  }
  .inq-preview-head {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .inq-filter-grid,
  .inq-preview-head {
    grid-template-columns: 1fr;
  }
  .inq-entity-header {
    align-items: stretch;
    flex-direction: column;
  }
  .inq-summary {
    justify-content: stretch;
  }
  .inq-total-box {
    flex: 1;
  }
}

/* Check tracking */
.chk-status-badge {
  font-size: .72rem;
  padding: .28em .65em;
  white-space: nowrap;
}
.chk-serial {
  font-family: monospace;
  font-size: .78rem;
  color: #0369a1;
  font-weight: 600;
}
.chk-endorsed {
  color: #10b981;
  font-size: .85rem;
}
/* البند 228: ارتداد الشيك بعد سند مرحّل — ينتظر الترحيل أو رُحّل */
.chk-bounce {
  font-size: .72rem;
  margin-top: .25rem;
  white-space: nowrap;
}
.chk-bounce--pending { color: #b45309; }
.chk-bounce--posted  { color: #475569; }
/* شيك ارتدّ قبل البند 228 بلا ارتداد مسجّل، فأثر سنده باقٍ في الأستاذ */
.chk-bounce--unrecorded { color: #b91c1c; }
.chk-bounce-hint {
  font-size: .68rem;
  max-width: 220px;
  white-space: normal;
}
.chk-bounce-post {
  font-size: .72rem;
  margin-top: .25rem;
}
.chk-amount {
  font-variant-numeric: tabular-nums;
}
.chk-filter-bar {
  background: #f8fafc;
  border-radius: .6rem;
  padding: .75rem 1rem;
  border: 1px solid #e5e7eb;
}
.chk-field-label {
  font-size: .82rem;
}
.chk-search-box {
  min-width: 160px;
}
.chk-status-box {
  min-width: 170px;
}
.chk-tab-count {
  font-size: .67rem;
}
.chk-empty {
  color: #9ca3af;
}
.chk-empty-icon {
  font-size: 2.5rem;
  opacity: .3;
  display: block;
  margin-bottom: .5rem;
}
.chk-voucher-link {
  font-size: .8rem;
}
.chk-note-cell,
.chk-bank-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chk-note-cell {
  max-width: 140px;
}
.chk-note-cell--issued {
  max-width: 130px;
}
.chk-bank-cell {
  max-width: 120px;
}
.chk-action-btn {
  font-size: .74rem;
}
