@font-face { font-family: 'Cairo'; font-weight: 400; font-display: swap; src: url('../vendor/cairo/files/cairo-arabic-400-normal.woff2') format('woff2'); unicode-range: U+0600-06FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE80-FEFC; }
@font-face { font-family: 'Cairo'; font-weight: 600; font-display: swap; src: url('../vendor/cairo/files/cairo-arabic-600-normal.woff2') format('woff2'); unicode-range: U+0600-06FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE80-FEFC; }
@font-face { font-family: 'Cairo'; font-weight: 700; font-display: swap; src: url('../vendor/cairo/files/cairo-arabic-700-normal.woff2') format('woff2'); unicode-range: U+0600-06FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE80-FEFC; }
@font-face { font-family: 'Cairo'; font-weight: 400; font-display: swap; src: url('../vendor/cairo/files/cairo-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Cairo'; font-weight: 600; font-display: swap; src: url('../vendor/cairo/files/cairo-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Cairo'; font-weight: 700; font-display: swap; src: url('../vendor/cairo/files/cairo-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --sidebar-w: 250px;
  --brand: #1f4e79;
  --brand-dark: #173b5c;
  --bg: #f4f6f9;
  --bs-font-sans-serif: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}
body { font-family: var(--bs-font-sans-serif); background: var(--bg); color: #26323f; }

.sidebar {
  position: fixed; top: 0; bottom: 0; right: 0; width: var(--sidebar-w);
  background: var(--brand-dark); color: #cfdbe8; overflow-y: auto; z-index: 1040;
  transition: transform .2s ease;
}
.sidebar .brand { padding: 1rem 1.25rem; font-weight: 700; font-size: 1.1rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .nav-section { padding: .9rem 1.25rem .3rem; font-size: .75rem; color: #8fa7bf; }
.sidebar a.nav-link { color: #cfdbe8; padding: .55rem 1.25rem; display: flex; gap: .7rem; align-items: center; border-radius: 0; }
.sidebar a.nav-link i { width: 1.2rem; text-align: center; opacity: .85; }
.sidebar a.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.nav-link.active { background: var(--brand); color: #fff; border-right: 3px solid #5ab0f0; }

.main { margin-right: var(--sidebar-w); min-height: 100vh; }
.topbar { background: #fff; border-bottom: 1px solid #e3e8ee; padding: .6rem 1.25rem; position: sticky; top: 0; z-index: 1030; }
.content { padding: 1.25rem; }

.card { border: 1px solid #e3e8ee; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.stat-card { text-decoration: none; color: inherit; display: block; transition: box-shadow .15s, transform .15s; }
.stat-card:hover { box-shadow: 0 4px 14px rgba(16,24,40,.1); transform: translateY(-1px); color: inherit; }
.stat-card .icon { width: 46px; height: 46px; border-radius: 10px; background: #e8f1fa; color: var(--brand); display: grid; place-items: center; font-size: 1.2rem; }
.stat-card .value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }

.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { background: #f0f4f8; font-weight: 600; white-space: nowrap; }
.btn-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-brand:hover { background: var(--brand-dark); color: #fff; }
.text-ltr { direction: ltr; unicode-bidi: plaintext; display: inline-block; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #173b5c, #1f4e79); padding: 1rem; }
.login-card { width: 100%; max-width: 400px; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.show { transform: none; box-shadow: -4px 0 20px rgba(0,0,0,.3); }
  .main { margin-right: 0; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
}

/* ---- English (LTR) layout: mirror the sidebar and its offsets ---- */
html[dir="ltr"] .sidebar { right: auto; left: 0; }
html[dir="ltr"] .sidebar a.nav-link.active { border-right: 0; border-left: 3px solid #5ab0f0; }
html[dir="ltr"] .main { margin-right: 0; margin-left: var(--sidebar-w); }
@media (max-width: 991.98px) {
  html[dir="ltr"] .sidebar { transform: translateX(-100%); }
  html[dir="ltr"] .sidebar.show { transform: none; box-shadow: 4px 0 20px rgba(0,0,0,.3); }
  html[dir="ltr"] .main { margin-left: 0; }
}
.lang-switch .btn { padding: .15rem .55rem; font-size: .8rem; }

/* ---- charts (palette: validated categorical set, fixed order) ---- */
:root {
  --series-1:#2a78d6; --series-2:#eb6834; --series-3:#1baf7a; --series-4:#eda100;
  --series-5:#e87ba4; --series-6:#008300; --series-7:#6250d6; --series-8:#e34948;
  --chart-track:#e8ecf1; --chart-ink:#26323f;
}
.chart-total { font-size: 7px; font-weight: 700; fill: var(--chart-ink); }
.chart-donut a:hover circle { opacity: .8; }
.chart-legend li { padding: .15rem 0; }
.chart-legend .swatch { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 10px; }
.chart-bars li { margin-bottom: .55rem; }
.chart-bars .bar-track { height: 8px; background: var(--chart-track); border-radius: 4px; margin-top: 2px; }
.chart-bars .bar-fill { height: 100%; background: var(--series-1); border-radius: 4px; min-width: 0; }
.chart-bars a:hover { text-decoration: underline !important; }
@media print { .chart-card { break-inside: avoid; } }

/* ---- searchable select (public/js/searchable-select.js) ---- */
.ss-wrap { position: relative; }
.ss-hidden { position: absolute !important; inset: 0; opacity: 0; pointer-events: none; width: 100%; height: 100%; }
.ss-list { position: absolute; z-index: 1055; inset-inline: 0; top: 100%; max-height: 280px; overflow-y: auto; margin: 2px 0 0; padding: .25rem 0;
  list-style: none; background: #fff; border: 1px solid #ced4da; border-radius: .375rem; box-shadow: 0 6px 18px rgba(16,24,40,.15); min-width: 12rem; }
.ss-list[hidden] { display: none; }
.ss-list li { padding: .35rem .75rem; cursor: pointer; font-size: .95rem; }
.ss-list li:hover, .ss-list li.active { background: #e8f1fa; }
.ss-list li.selected { font-weight: 600; }
.ss-list li.ss-empty { color: #6c757d; }
.ss-list li.muted { color: #8a94a0; cursor: default; background: none; }
.ss-input::placeholder { color: #212529; opacity: .85; }
