/*----------------------------------------------------------------------
|:  App theme overrides (loaded after style-rtl.css)                   :|
|:  ===============================================================   :|
|:  - Typeface: IBM Plex Sans Arabic 400 / 500 / 600, self-hosted      :|
|:    (assets/fonts/ibm-plex-sans-arabic, SIL Open Font License).      :|
|:  - Sidebar: flat groups under small headings.                       :|
|:  Printed documents (the letter, form 77) set their own typeface    :|
|:  and are not affected.                                              :|
----------------------------------------------------------------------*/

/* ---------- IBM Plex Sans Arabic (Arabic + Latin subsets) ---------- */
@font-face {
  font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-400.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-500.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-600.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root,
[data-bs-theme] {
  --bs-font-sans-serif: 'IBM Plex Sans Arabic', 'alarabiya', sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  /* Plex Arabic reads larger than the previous face: 14.4px instead of 16px */
  --bs-body-font-size: 0.9rem;
}

/* Light theme: softer ink than pure black (#000), easier on long reading */
:root:not([data-bs-theme=dark]),
[data-bs-theme=light] {
  --bs-body-color: #344054;
  --bs-body-color-rgb: 52, 64, 84;
  --bs-emphasis-color: #1d2939;
  --bs-emphasis-color-rgb: 29, 41, 57;
  --bs-heading-color: #1d2939;
  --bs-sidebar-color: #344054;
  --bs-sidebar-color-rgb: 52, 64, 84;
  --bs-navbar-item-color: #344054;
}

/* Printed documents stay true black whatever the app ink is */
.request-letter, .sheet { color: #000; }

/* List tables pinned their cells to 1rem; let them follow the body size */
.page-content .pr-table tbody td { font-size: var(--bs-body-font-size); }

/* Only three weights are shipped: map heavier requests onto 600 */
b, strong, .fw-bold, .fw-bolder, th { font-weight: 600; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 600; }

/* Heroicons are drawn on a 24px grid with a 1.5 stroke */
svg.hi-icon { stroke-width: 1.5; }

/* ---------- Sidebar: grouped, flat ---------- */
.sidebar .sidebar-body .nav.sb-groups .nav-item.nav-category {
  color: var(--bs-secondary-color);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  height: auto;
  margin-bottom: 6px;
}
.sidebar .sidebar-body .nav.sb-groups .nav-item.nav-category:not(:first-child) {
  margin-top: 18px;
}
.sidebar .sidebar-body .nav.sb-groups .nav-item .nav-link {
  height: 34px;
}
.sidebar .sidebar-body .nav.sb-groups .nav-item .nav-link .link-icon {
  width: 20px;
  height: 20px;
  fill: none;
}
.sidebar .sidebar-body .nav.sb-groups .nav-item .nav-link .link-title {
  margin-right: 32px;
  font-size: 14px;
  font-weight: 500;
}
.sidebar .sidebar-body .nav.sb-groups .nav-item:hover .nav-link .link-title {
  margin-right: 32px;
}
.sidebar .sidebar-body .nav.sb-groups .nav-item:hover .nav-link .link-icon,
.sidebar .sidebar-body .nav.sb-groups .nav-item.active .nav-link .link-icon {
  fill: none;
}
.sidebar .sidebar-body .nav.sb-groups .sb-badge {
  margin-right: auto;
  font-size: 11px;
  font-weight: 500;
}

/* ---------- Quick search: navbar trigger + palette ---------- */
.navbar .navbar-content { position: relative; }
.navbar .nav-search-trigger {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(448px, 40%);
  height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.25rem;
  color: var(--bs-body-color);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}
.navbar .nav-search-trigger:hover { border-color: var(--bs-secondary-color); }
.navbar .nav-search-trigger svg { width: 18px; height: 18px; flex-shrink: 0; }
.navbar .nav-search-trigger kbd,
.qs-dialog kbd {
  margin-right: auto;
  padding: 1px 6px;
  font-family: inherit;
  font-size: 11px;
  color: var(--bs-secondary-color);
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.25rem;
  box-shadow: none;
}

.qs-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: rgba(16, 24, 40, 0.35);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 96px 16px 16px;
}
.qs-overlay[hidden] { display: none; }
.qs-dialog {
  width: 512px;
  max-width: 100%;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.25rem;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18);
  overflow: hidden;
}
.qs-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid var(--bs-border-color);
  outline: 0;
  background: transparent;
  color: var(--bs-body-color);
  font-size: 14px;
}
.qs-input::placeholder { color: var(--bs-secondary-color); }
.qs-list { max-height: 360px; overflow-y: auto; padding: 4px 0; }
.qs-list .qs-group {
  padding: 8px 16px 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--bs-secondary-color);
}
.qs-list .qs-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 16px;
  color: var(--bs-body-color);
  text-decoration: none;
  font-size: 13.5px;
}
.qs-list .qs-item .qs-sub {
  font-size: 12px;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qs-list .qs-item.is-active { background: rgba(var(--bs-primary-rgb), 0.08); color: var(--bs-primary); }
.qs-list .qs-empty { padding: 14px 16px; font-size: 13px; color: var(--bs-secondary-color); }

/* ---------- Navbar notifications ---------- */
.navbar #notificationDropdown { position: relative; }
.navbar .nt-count {
  position: absolute;
  top: -7px;
  left: -8px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--bs-danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 17px;
  text-align: center;
}
.navbar .navbar-content .navbar-nav .nav-item.dropdown .dropdown-menu.nt-menu { width: 340px; }
.navbar .nt-menu .nt-list { max-height: 360px; overflow-y: auto; padding: 4px; }
.navbar .nt-menu .nt-item { white-space: normal; padding: 8px 12px; border-radius: 0.25rem; }
.navbar .nt-menu .nt-item + .nt-item { margin-top: 2px; }
