@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --navy-950: #081c33;
  --navy-900: #102d4f;
  --navy-800: #173c64;
  --navy-100: #dbe7f0;
  --emerald-700: #087357;
  --emerald-600: #0f8d67;
  --emerald-100: #dff3ec;
  --gold-600: #b58a48;
  --gold-100: #f4ead8;
  --purple-600: #6d59a7;
  --ink-900: #172330;
  --ink-700: #425466;
  --ink-500: #708090;
  --ink-300: #aab6c2;
  --line: #dfe7ed;
  --canvas: #f3f6f8;
  --paper: #ffffff;
  --danger: #c44545;
  --warning: #d79021;
  --success: #0f8d67;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(10, 38, 64, .08);
  --shadow-md: 0 12px 30px rgba(10, 38, 64, .12);
  --header-height: 68px;
  --sidebar-width: 232px;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; font-size: 15px; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink-900);
  background: var(--canvas);
  font-family: "Manrope", "IBM Plex Sans Arabic", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid rgba(15, 141, 103, .35); outline-offset: 2px; }

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: #fff;
  background: var(--navy-950);
  border-radius: 8px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }
.app-shell { min-height: 100vh; }
.app-header {
  position: fixed;
  z-index: 1200;
  inset: 0 0 auto 0;
  height: var(--header-height);
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 560px) minmax(300px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  color: #fff;
  background: var(--navy-900);
  box-shadow: 0 2px 14px rgba(2, 18, 34, .18);
}
.header-start, .header-actions, .brand-lockup, .brand-type, .profile-button,
.product-switcher, .language-toggle, .edition-status { display: flex; align-items: center; }
.header-start { min-width: 0; gap: 14px; }
.header-actions { justify-content: flex-end; gap: 10px; }
.sidebar-toggle { display: none !important; }
.brand-lockup { gap: 9px; min-width: max-content; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--navy-900);
  background: #fff;
  border-radius: 50% 50% 50% 12px;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 22px;
  font-weight: 700;
}
.brand-type { align-items: baseline; gap: 6px; letter-spacing: .08em; }
.brand-type strong { font-size: .96rem; }
.brand-type small { color: #a9c0d4; font-family: "IBM Plex Sans Arabic", sans-serif; letter-spacing: 0; }
.header-divider { width: 1px; height: 26px; background: rgba(255,255,255,.22); }
.product-switcher, .language-toggle, .profile-button, .icon-button { color: inherit; background: transparent; border: 0; }
.product-switcher { gap: 9px; padding: 8px 9px; border-radius: 8px; font-weight: 600; }
.product-switcher:hover, .icon-button:hover, .language-toggle:hover, .profile-button:hover { background: rgba(255,255,255,.09); }
.global-search {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #b9cbd9;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
}
.global-search input { flex: 1; min-width: 0; color: #fff; background: transparent; border: 0; outline: 0; }
.global-search input::placeholder { color: #adc0d0; }
.global-search kbd { padding: 2px 6px; color: #adc0d0; background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.15); border-radius: 5px; font-size: .68rem; }
.icon-button { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; font-size: 1.15rem; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; background: #e8a546; border: 2px solid var(--navy-900); border-radius: 50%; }
.language-toggle { flex-direction: column; justify-content: center; width: 42px; height: 42px; border-radius: 10px; line-height: 1; }
.language-toggle span { font-family: "IBM Plex Sans Arabic", sans-serif; font-weight: 700; }
.language-toggle small { margin-top: 2px; color: #adc0d0; font-size: .58rem; }
.profile-button { gap: 9px; padding: 4px 8px 4px 5px; border-radius: 11px; text-align: left; }
.profile-button img { width: 34px; height: 34px; object-fit: cover; border-radius: 9px; }
.profile-button > span { display: grid; line-height: 1.15; }
.profile-button strong { font-size: .78rem; }
.profile-button small { margin-top: 3px; color: #adc0d0; font-size: .64rem; }
.profile-button .bi-chevron-down { color: #adc0d0; font-size: .7rem; }

.app-layout { min-height: 100vh; padding-top: var(--header-height); }
.app-sidebar {
  position: fixed;
  z-index: 1100;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 12px 14px;
  overflow-y: auto;
  color: #c5d3df;
  background: var(--navy-950);
  border-right: 1px solid rgba(255,255,255,.05);
}
.sidebar-nav { display: grid; gap: 4px; }
.nav-label { margin: 18px 12px 7px; color: #6f899f; font-size: .67rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-label:first-child { margin-top: 2px; }
.nav-link {
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  color: #bdcedc;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 600;
}
.nav-link i { font-size: 1rem; }
.nav-link small { min-width: 21px; padding: 2px 5px; color: #9eb4c5; background: rgba(255,255,255,.08); border-radius: 10px; text-align: center; font-size: .62rem; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-link.active { color: #fff; background: linear-gradient(100deg, rgba(15,141,103,.35), rgba(15,141,103,.13)); border-color: rgba(57,190,150,.18); }
.nav-link.active i { color: #6dd6b6; }
.nav-button { width: 100%; background: transparent; text-align: left; }
.sidebar-footer { display: grid; gap: 10px; }
.edition-status { gap: 9px; margin: 0 4px; padding: 11px; background: rgba(255,255,255,.055); border-radius: 10px; }
.edition-status > div { display: grid; line-height: 1.2; }
.edition-status strong { color: #edf5f9; font-size: .7rem; }
.edition-status small { margin-top: 3px; color: #88a0b3; font-size: .61rem; }
.status-pulse { width: 8px; height: 8px; background: #54d6ae; border-radius: 50%; box-shadow: 0 0 0 4px rgba(84,214,174,.12); }
.sidebar-scrim { display: none; }
.app-main { min-height: calc(100vh - var(--header-height)); margin-left: var(--sidebar-width); outline: 0; }
.mobile-nav { display: none; }

.page-shell { width: min(100%, 1640px); margin: 0 auto; padding: 26px 28px 42px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-eyebrow { display: flex; align-items: center; gap: 7px; margin: 0 0 6px; color: var(--emerald-700); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-header h1 { margin: 0; color: var(--navy-900); font-size: clamp(1.55rem, 2.1vw, 2.15rem); font-weight: 800; letter-spacing: -.035em; }
.page-header .page-subtitle { max-width: 680px; margin: 7px 0 0; color: var(--ink-500); font-size: .84rem; line-height: 1.6; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.btn-app {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--ink-700);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: .76rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.btn-app:hover { color: var(--navy-900); border-color: #b9c8d3; transform: translateY(-1px); }
.btn-app.primary { color: #fff; background: var(--emerald-600); border-color: var(--emerald-600); }
.btn-app.navy { color: #fff; background: var(--navy-900); border-color: var(--navy-900); }
.btn-app.gold { color: #fff; background: var(--gold-600); border-color: var(--gold-600); }
.btn-app.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-app.icon-only { width: 39px; padding: 0; }
.btn-app[disabled], .btn-app.is-loading { opacity: .65; cursor: wait; transform: none; }
.surface { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.surface-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.surface-title { margin: 0; color: var(--navy-900); font-size: .9rem; font-weight: 800; }
.surface-subtitle { margin: 3px 0 0; color: var(--ink-500); font-size: .68rem; }
.status-chip, .meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  padding: 4px 8px;
  color: var(--ink-700);
  background: #eef3f6;
  border-radius: 999px;
  font-size: .63rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-chip::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.status-chip.success { color: var(--emerald-700); background: var(--emerald-100); }
.status-chip.warning { color: #a86d10; background: #fff0d4; }
.status-chip.danger { color: #aa3636; background: #fbe4e4; }
.status-chip.info { color: #315f96; background: #e5eef9; }
.status-chip.purple { color: #624b95; background: #eee8fa; }
.field-label { display: block; margin-bottom: 6px; color: var(--ink-700); font-size: .68rem; font-weight: 800; }
.field-hint { margin: 5px 0 0; color: var(--ink-500); font-size: .62rem; }
.app-input, .app-select, .app-textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--ink-900);
  background: #fff;
  border: 1px solid #cfdbe3;
  border-radius: 8px;
  outline: 0;
}
.app-input:focus, .app-select:focus, .app-textarea:focus { border-color: var(--emerald-600); box-shadow: 0 0 0 3px rgba(15,141,103,.1); }
.app-textarea { min-height: 118px; resize: vertical; }
.input-with-icon { position: relative; }
.input-with-icon i { position: absolute; top: 50%; left: 12px; color: var(--ink-500); transform: translateY(-50%); }
.input-with-icon .app-input { padding-left: 35px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: #edf2f5; border-radius: 9px; }
.tab-button { min-height: 32px; padding: 6px 11px; color: var(--ink-500); background: transparent; border: 0; border-radius: 7px; font-size: .68rem; font-weight: 800; }
.tab-button.active { color: var(--navy-900); background: #fff; box-shadow: var(--shadow-sm); }
[data-tab-panel][hidden] { display: none !important; }
.app-modal {
  position: fixed;
  z-index: 1600;
  inset: 0;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(4, 21, 38, .58);
  backdrop-filter: blur(4px);
}
.app-modal.open { display: grid; }
.modal-card { width: min(100%, 620px); max-height: calc(100vh - 44px); overflow-y: auto; background: #fff; border-radius: 16px; box-shadow: 0 30px 80px rgba(4,21,38,.32); }
.modal-card.wide { width: min(100%, 820px); }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; }
.modal-head { border-bottom: 1px solid var(--line); }
.modal-foot { justify-content: flex-end; border-top: 1px solid var(--line); }
.modal-head h2 { margin: 0; color: var(--navy-900); font-size: 1rem; font-weight: 800; }
.modal-body { padding: 20px; }
.modal-close { width: 34px; height: 34px; display: grid; place-items: center; color: var(--ink-500); background: #f0f4f6; border: 0; border-radius: 8px; }
.toast-stack { position: fixed; z-index: 1800; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.app-toast { min-width: 280px; max-width: 390px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #fff; background: var(--navy-950); border-left: 4px solid #55d2ad; border-radius: 10px; box-shadow: var(--shadow-md); font-size: .75rem; animation: toast-in .22s ease-out both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.empty-search { padding: 22px; color: var(--ink-500); text-align: center; }
.rtl { direction: rtl; font-family: "IBM Plex Sans Arabic", "Manrope", sans-serif; }

@media (max-width: 1180px) {
  .app-header { grid-template-columns: auto minmax(240px, 1fr) auto; gap: 16px; }
  .sidebar-toggle { display: grid !important; }
  .app-sidebar { transform: translateX(-104%); transition: transform .22s ease; box-shadow: 14px 0 35px rgba(3,18,32,.24); }
  body.sidebar-open .app-sidebar { transform: none; }
  .sidebar-scrim { position: fixed; z-index: 1050; inset: var(--header-height) 0 0; background: rgba(3,18,32,.45); border: 0; }
  body.sidebar-open .sidebar-scrim { display: block; }
  .app-main { margin-left: 0; }
  .brand-type small, .header-divider, .product-switcher { display: none; }
}
@media (max-width: 820px) {
  :root { --header-height: 60px; }
  .app-header { grid-template-columns: 1fr auto; padding: 0 14px; }
  .global-search, .profile-button > span, .profile-button > i, .language-toggle { display: none; }
  .brand-mark { width: 31px; height: 31px; font-size: 19px; }
  .page-shell { padding: 20px 16px 88px; }
  .page-header { display: grid; gap: 14px; margin-bottom: 18px; }
  .page-actions { justify-content: flex-start; }
  .mobile-nav {
    position: fixed;
    z-index: 1000;
    inset: auto 10px 10px;
    height: 64px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    padding: 5px;
    background: rgba(8,28,51,.96);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(3,18,32,.28);
    backdrop-filter: blur(10px);
  }
  .mobile-nav a { height: 52px; display: grid; place-items: center; align-content: center; gap: 2px; color: #91a9ba; border-radius: 12px; font-size: .6rem; font-weight: 700; }
  .mobile-nav a i { font-size: 1.05rem; }
  .mobile-nav a.active { color: #75d9ba; background: rgba(15,141,103,.18); }
  .mobile-nav > .dropup { min-width: 0; height: 52px; }
  .mobile-nav > .dropup > a { width: 100%; }
  .mobile-nav > .dropup > .dropdown-toggle::after { display: none; }
  .mobile-nav .dropdown-menu {
    min-width: 210px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
  }
  .mobile-nav .dropdown-menu form + form { margin-top: 2px; }
  .mobile-nav .dropdown-item {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    color: var(--ink-700);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: .72rem;
    font-weight: 700;
  }
  .mobile-nav .dropdown-item:hover,
  .mobile-nav .dropdown-item:focus { color: var(--navy-900); background: #eef3f6; }
  .mobile-nav .dropdown-item.active { color: var(--emerald-700); background: var(--emerald-100); }
  .toast-stack { right: 10px; bottom: 84px; left: 10px; }
  .app-toast { min-width: 0; max-width: none; }
}
@media (max-width: 480px) {
  .app-header { padding: 0 10px; }
  .header-start { gap: 7px; }
  .brand-type strong { font-size: .83rem; }
  .header-actions { gap: 2px; }
  .profile-button { padding: 3px; }
  .page-header h1 { font-size: 1.55rem; }
  .btn-app { min-height: 42px; }
  .modal-card { max-height: calc(100vh - 20px); border-radius: 14px; }
  .app-modal { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
