/* Locally bundled fonts (IBM Plex Sans Arabic, SIL OFL) — no CDN */
@font-face { font-family: "Plex Arabic"; src: url("../fonts/IBMPlexSansArabic-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/IBMPlexSansArabic-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/IBMPlexSansArabic-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bs-body-font-family: "Plex Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --sm-sidebar: #12355b;
  --sm-accent: #1f6feb;
}
body { background: #f4f6f9; font-size: .925rem; }
.navbar-brand img { max-height: 28px; }
.navbar { background: var(--sm-sidebar); }
.card { border: 0; box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08); }
.card-header { background: #fff; font-weight: 600; }
.stat .value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat .label { color: var(--bs-secondary-color); font-size: .85rem; }
.table > :not(caption) > * > * { padding: .45rem .5rem; }
.table thead th { white-space: nowrap; font-weight: 600; font-size: .82rem; color: #475467; background: #f9fafb; }
.page-title { font-weight: 700; font-size: 1.35rem; margin: 0; }

/* Identifiers stay left-to-right inside RTL pages */
.ltr, bdi.ltr { direction: ltr; unicode-bidi: isolate; }
input[dir="ltr"], textarea[dir="ltr"] { text-align: left; }
[dir="rtl"] input[dir="ltr"] { text-align: right; }
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"], [dir="rtl"] input[type="number"] { direction: ltr; text-align: right; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

.filter-panel .form-control, .filter-panel .form-select { font-size: .85rem; }
.badge { font-weight: 500; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-indicator { display: none; }
.toast-container { z-index: 1090; }
.secret-box { font-family: Consolas, "Courier New", monospace; letter-spacing: .03em; }
.step-pills .nav-link { pointer-events: none; }
.sticky-actions { position: sticky; bottom: 0; background: #fff; padding: .75rem 0; border-top: 1px solid #eee; z-index: 5; }

/* Mobile: tables become stacked cards */
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { background: #fff; margin-bottom: .75rem; border-radius: .5rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: .5rem .75rem; }
  .table-stack td { border: 0; padding: .2rem 0; display: flex; justify-content: space-between; gap: 1rem; }
  .table-stack td[data-label]::before { content: attr(data-label); font-weight: 600; color: #667085; flex-shrink: 0; }
  .table-stack td.cell-actions { justify-content: flex-start; padding-top: .5rem; }
  .page-title { font-size: 1.15rem; }
  body { font-size: .9rem; }
}

@media print {
  .navbar, .no-print, .toast-container, .btn { display: none !important; }
  body { background: #fff; font-size: 10pt; }
  .card { box-shadow: none; }
  table { page-break-inside: auto; }
  thead { display: table-header-group; }
  tr { page-break-inside: avoid; }
}
