/* Self-hosted Noto Kufi Arabic (400, 600, 700) */
@font-face {
  font-family: 'Noto Kufi Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(./fonts/noto-kufi-arabic-arabic-400-normal.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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: 'Noto Kufi Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(./fonts/noto-kufi-arabic-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+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: 'Noto Kufi Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(./fonts/noto-kufi-arabic-arabic-600-normal.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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: 'Noto Kufi Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(./fonts/noto-kufi-arabic-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+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: 'Noto Kufi Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(./fonts/noto-kufi-arabic-arabic-700-normal.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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: 'Noto Kufi Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(./fonts/noto-kufi-arabic-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+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 {
  --bg: #f0f7ff;
  --surface: #ffffff;
  --surface-alt: #f5faff;
  --border: #d4e6fa;
  --text: #0f294a;
  --muted: #516b8a;
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --accent: #0ea5e9;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --ok-bg: #dcfce7;
  --ok: #166534;
  --radius: 10px;
  --font-sans: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 14.25px;
}

.remember-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
}

.remember-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.topbar .btn-danger {
  background: #dc2626;
  color: #ffffff;
  border: 1px solid #ef4444;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.topbar .btn-danger:hover {
  background: #b91c1c;
}

.quick-login-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.quick-user-btn {
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
  gap: 2px;
  padding: 10px 12px;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  background: #e6f2ff;
  border-bottom: 1px solid #bfdbfe;
  color: #0f294a;
  padding: 10px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  color: #0f294a;
  text-decoration: none;
}

.topbar .brand:hover {
  text-decoration: none;
  opacity: 0.9;
}

.brand-logo {
  width: 31px;
  height: 31px;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.18);
}

.brand-text {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.01em;
}

.brand-ar {
  font-size: 1rem;
  font-weight: 700;
  color: #0f294a;
}

.brand-sep {
  color: #0284c7;
  font-weight: 700;
}

.brand-en {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #0284c7;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.hero-brand img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.16);
}

.hero-brand-sub {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.topbar .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.topbar .nav-links a,
.topbar .nav-links button {
  color: #0f294a;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  min-height: 33px;
  display: inline-flex;
  align-items: center;
}

.topbar .nav-links a:hover {
  background: #dbeafe;
  text-decoration: none;
}

.topbar .nav-links a.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.topbar .nav-links button.btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.profile-menu {
  position: relative;
  display: inline-block;
}

.profile-trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #0f294a;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 3px 11px 3px 5px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 33px;
}

.profile-trigger::-webkit-details-marker {
  display: none;
}

.profile-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 215px;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 10px 26px rgba(15, 41, 74, 0.14);
  z-index: 60;
  color: var(--text);
}

.profile-name {
  font-weight: 700;
  font-size: 0.94rem;
}

.profile-role {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 2px;
}

.profile-email {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
  word-break: break-all;
}

.profile-sep {
  border: 0;
  border-top: 1px solid #e2effd;
  margin: 10px 0;
}

.profile-logout-btn {
  width: 100%;
  justify-content: center;
}

.footer-links {
  margin-bottom: 6px;
  font-weight: 600;
}

.container {
  max-width: 1080px;
  margin: 18px auto;
  padding: 0 16px 32px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.06);
}

.card h1 {
  margin: 0 0 6px;
  font-size: 1.28rem;
  color: #0f294a;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: #0f294a;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: #0f294a;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.stat-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-val {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  margin-top: 2px;
}

.alert {
  padding: 10px 13px;
  border-radius: 6px;
  margin-bottom: 10px;
  border: 1px solid transparent;
  font-size: 0.88rem;
}

.alert-info {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0c4a6e;
}

.alert-warn {
  background: var(--warn-bg);
  border-color: #fcd34d;
  color: #78350f;
}

.alert-danger {
  background: var(--danger-bg);
  border-color: #fca5a5;
  color: #7f1d1d;
}

.alert-ok {
  background: var(--ok-bg);
  border-color: #86efac;
  color: var(--ok);
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.86rem;
  margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 37px;
  padding: 6px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #ffffff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.14);
}

.form-row {
  margin-bottom: 9px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 37px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #e2e8f0;
  color: #1e293b;
  border-color: #cbd5e1;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-ok {
  background: var(--accent);
  color: #ffffff;
}

.btn-sm {
  min-height: 31px;
  padding: 4px 11px;
  font-size: 0.82rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

th {
  background: var(--surface-alt);
  font-weight: 700;
  color: #334155;
}

.table-wrap {
  overflow-x: auto;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.subnav a {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 13px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
}

.subnav a.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.combobox-wrap {
  position: relative;
}

.combobox-trigger {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #b8c4d4;
  border-radius: 6px;
  background: #ffffff;
  text-align: start;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
}

.combobox-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--primary);
  border-radius: 6px;
  margin: 2px 0 0;
  padding: 4px 0;
  list-style: none;
  z-index: 40;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.combobox-list li {
  padding: 9px 12px;
  cursor: pointer;
}

.combobox-list li:hover,
.combobox-list li[aria-selected="true"] {
  background: #e0f2fe;
}

.hidden {
  display: none !important;
}

.footer-note {
  margin-top: 18px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 0.81rem;
  color: var(--muted);
}

/* Compact Office Dashboard */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e6f0fc;
}

.dash-title-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-title-group h1 {
  margin: 0;
  font-size: 1.24rem;
}

.dash-user-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.kpi-label {
  font-size: 0.79rem;
  color: var(--muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.kpi-sub {
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--muted);
}

.kpi-bar {
  height: 5px;
  background: #dbeafe;
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}

.kpi-bar>span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

.dash-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 14px;
  align-items: start;
}

@media (max-width: 820px) {
  .dash-two-col {
    grid-template-columns: 1fr;
  }
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
}

.tool-row:last-child {
  margin-bottom: 0;
}

.tool-info {
  flex: 1 1 180px;
  min-width: 0;
}

.tool-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.tool-desc {
  font-size: 0.81rem;
  color: var(--muted);
  margin-top: 2px;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.mini-steps {
  margin-top: 6px;
  font-size: 0.81rem;
  color: var(--muted);
}

.mini-steps summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
}

.mini-steps ol {
  margin: 5px 0 0;
  padding-inline-start: 16px;
  line-height: 1.5;
}

.mfa-desc {
  font-size: 0.83rem;
  color: var(--muted);
  margin: 0 0 10px;
}

.mfa-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mfa-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.mfa-code-input {
  width: 128px !important;
  min-height: 33px !important;
  padding: 5px 9px !important;
  font-size: 0.86rem !important;
}