/**
 * design-system.css — نظام التصميم المركزي
 * شركة العازل الأصلي للمقاولات العامة
 * =================================================
 * الألوان والمتغيرات تُحمَّل ديناميكياً من الإعدادات
 * عبر shared/js/core.js → applyTheme()
 * =================================================
 */

/* ══════════════════════════════════════════
   ① CSS Variables — Theme (defaults)
   ══════════════════════════════════════════ */
:root {
  /* Brand Colors */
  --primary:       #1a1a1a;
  --primary-light: #2d2d2d;
  --accent:        #b8922a;
  --accent-light:  #d4aa40;
  --accent-subtle: rgba(184,146,42,0.12);

  /* Semantic Colors */
  --success:  #27ae60;
  --danger:   #e74c3c;
  --warning:  #f39c12;
  --info:     #3498db;
  --purple:   #8b5cf6;

  /* Backgrounds */
  --bg:        #f5f0e8;
  --bg-dark:   #0e0e0e;
  --surface:   #ffffff;
  --surface-2: #fafaf8;
  --border:    #e8e0d0;

  /* Text */
  --text:      #1a1a1a;
  --text-muted:#777777;
  --text-light:#aaaaaa;

  /* Sizing */
  --radius:    14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow:    0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* ══════════════════════════════════════════
   ② Dark Theme (data-theme="dark")
   ══════════════════════════════════════════ */
[data-theme="dark"] {
  --bg:        #0e0e0e;
  --bg-dark:   #050505;
  --surface:   #1a1a1a;
  --surface-2: #242424;
  --border:    rgba(184,146,42,0.2);
  --text:      #f0f0f0;
  --text-muted:#888888;
  --text-light:#555555;
  --shadow:    0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

/* ══════════════════════════════════════════
   ③ Reset & Base
   ══════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* انتقال سلس بين الوضع الليلي والنهاري */
html, body, .card, .topbar, .modal, input, select, textarea, .btn {
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

body {
  font-family: 'Tajawal', 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Dark mode extra overrides ── */
[data-theme="dark"] .card          { background: var(--surface); }
[data-theme="dark"] .topbar        { background: #111; border-bottom-color: rgba(184,146,42,.15); }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea       { background: #1e1e1e; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .modal         { background: var(--surface); }
[data-theme="dark"] .data-table th { background: #1e1e1e; }
[data-theme="dark"] .data-table tr:hover td { background: rgba(255,255,255,.03); }
[data-theme="dark"] .btn-outline   { border-color: var(--border); color: var(--text); }
[data-theme="dark"] #az-theme-toggle { border-color: rgba(184,146,42,.3); }

/* ══════════════════════════════════════════
   ④ Typography
   ══════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 900;
  line-height: 1.3;
  color: var(--text);
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; }
h5 { font-size: 13px; }

p  { color: var(--text-muted); margin-bottom: 0.75em; }
a  { color: var(--accent); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .8; }

/* ══════════════════════════════════════════
   ⑤ Layout Utilities
   ══════════════════════════════════════════ */
.container      { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.container-sm   { max-width: 900px;  margin: 0 auto; padding: 0 20px; }
.page-wrap      { padding: 24px 20px 80px; }

.flex           { display: flex; }
.flex-center    { display: flex; align-items: center; justify-content: center; }
.flex-between   { display: flex; align-items: center; justify-content: space-between; }
.flex-gap       { display: flex; gap: 10px; flex-wrap: wrap; }
.flex-col       { display: flex; flex-direction: column; }

.grid           { display: grid; gap: 16px; }
.grid-2         { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3         { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4         { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto      { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

.hidden         { display: none !important; }
.sr-only        { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.gap-4          { gap: 4px; }
.gap-8          { gap: 8px; }
.gap-12         { gap: 12px; }
.gap-16         { gap: 16px; }
.gap-24         { gap: 24px; }

.mt-8           { margin-top: 8px; }
.mt-16          { margin-top: 16px; }
.mt-24          { margin-top: 24px; }
.mb-8           { margin-bottom: 8px; }
.mb-16          { margin-bottom: 16px; }
.mb-24          { margin-bottom: 24px; }

.text-center    { text-align: center; }
.text-left      { text-align: left; }
.text-muted     { color: var(--text-muted); }
.text-success   { color: var(--success); }
.text-danger    { color: var(--danger); }
.text-warning   { color: var(--warning); }
.text-accent    { color: var(--accent); }
.fw-700         { font-weight: 700; }
.fw-900         { font-weight: 900; }
.fs-12          { font-size: 12px; }
.fs-13          { font-size: 13px; }
.fs-11          { font-size: 11px; }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 901px) {
  .hide-desktop { display: none !important; }
}

/* ══════════════════════════════════════════
   ⑥ App Shell
   ══════════════════════════════════════════ */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Bar ── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--accent-subtle);
}
.topbar-logo-fallback {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
}
.topbar-title  { font-size: 15px; font-weight: 900; color: var(--text); }
.topbar-sub    { font-size: 11px; color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Sidebar / Nav ── */
.sidebar {
  width: 240px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  overflow-y: auto;
  flex-shrink: 0;
  padding: 16px 12px;
}
.sidebar-section {
  margin-bottom: 24px;
}
.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: 'Tajawal', sans-serif;
}
.sidebar-link:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}
.sidebar-link.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
}
.sidebar-link .link-icon { font-size: 16px; flex-shrink: 0; }
.sidebar-badge {
  margin-right: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ── Page Body with Sidebar ── */
.page-with-sidebar {
  display: flex;
  flex: 1;
  gap: 0;
}
.page-content {
  flex: 1;
  overflow: hidden;
  padding: 24px 28px 80px;
}

/* ══════════════════════════════════════════
   ⑦ Cards
   ══════════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Stat Cards */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.stat-card::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--stat-color, var(--accent));
}
.stat-card.success::before { background: var(--success); }
.stat-card.danger::before  { background: var(--danger);  }
.stat-card.warning::before { background: var(--warning); }
.stat-card.info::before    { background: var(--info);    }
.stat-card .icon   { font-size: 28px; margin-bottom: 8px; }
.stat-card .label  { font-size: 12px; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.stat-card .value  { font-size: 28px; font-weight: 900; }
.stat-card .sub    { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ══════════════════════════════════════════
   ⑧ Buttons
   ══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary   { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.btn-primary:hover  { filter: brightness(1.1); }

.btn-accent    { background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: #fff; }
.btn-accent:hover   { filter: brightness(1.1); }

.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover  { background: #219a52; }

.btn-danger    { background: #fef0ef; color: var(--danger); border: 1px solid #fcc; }
.btn-danger:hover   { background: #fde8e8; }

.btn-warning   { background: var(--warning); color: #fff; }
.btn-info      { background: var(--info); color: #fff; }

.btn-outline   { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover  { border-color: var(--accent); color: var(--accent); }

.btn-ghost     { background: transparent; color: var(--text-muted); border: none; }
.btn-ghost:hover    { background: var(--accent-subtle); color: var(--accent); }

.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-lg  { padding: 12px 28px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }

/* Loading spinner inside button */
.btn.loading { pointer-events: none; }
.btn.loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════
   ⑨ Forms & Inputs
   ══════════════════════════════════════════ */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-label.required::after {
  content: ' *';
  color: var(--danger);
}
.form-input,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  appearance: none;
}
.form-input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.form-input::placeholder { color: var(--text-light); }
.form-input.error { border-color: var(--danger); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 4px; }
textarea { resize: vertical; min-height: 100px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Search input */
.search-wrap { position: relative; }
.search-wrap .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}
.search-wrap input { padding-right: 36px; }

/* ══════════════════════════════════════════
   ⑩ Tables
   ══════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.data-table thead th {
  background: var(--bg);
  padding: 12px 14px;
  text-align: right;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 12px;
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.data-table thead th:hover { background: var(--accent-subtle); color: var(--accent); }
.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--accent-subtle); }
.data-table tfoot td {
  font-weight: 700;
  padding: 10px 14px;
  border-top: 2px solid var(--border);
  background: var(--surface-2);
}

/* Empty state */
.table-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-light);
}
.table-empty .icon { font-size: 48px; margin-bottom: 12px; }
.table-empty p { font-size: 14px; }

/* Skeleton loader rows */
.skel-row td { padding: 14px; }
.skel-cell {
  height: 14px;
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-2) 50%, var(--border) 75%);
  background-size: 200%;
  animation: skel 1.4s infinite;
  border-radius: 4px;
}
@keyframes skel { 0%{background-position:200%} 100%{background-position:-200%} }

/* ══════════════════════════════════════════
   ⑪ Badges & Tags
   ══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-success  { background: #d4edda; color: #155724; }
.badge-danger   { background: #f8d7da; color: #721c24; }
.badge-warning  { background: #fff3cd; color: #856404; }
.badge-info     { background: #d1ecf1; color: #0c5460; }
.badge-accent   { background: var(--accent-subtle); color: var(--accent); }
.badge-muted    { background: #f0f0f0; color: var(--text-muted); }
.badge-dark     { background: var(--primary); color: #fff; }
.badge-purple   { background: rgba(139,92,246,.15); color: var(--purple); }

/* Status badges */
.status-approved  { background: #d4edda; color: #155724; }
.status-pending   { background: #fff3cd; color: #856404; }
.status-rejected  { background: #f8d7da; color: #721c24; }
.status-draft     { background: #f0f0f0; color: var(--text-muted); }

/* ══════════════════════════════════════════
   ⑫ Modals
   ══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
  transform: translateY(30px) scale(.97);
  transition: transform .25s;
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}
.modal-lg  { max-width: 780px; }
.modal-xl  { max-width: 1000px; }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 900; }
.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  color: var(--text-muted);
}
.modal-close:hover { background: var(--border); }
.modal-body    { padding: 20px 24px; }
.modal-footer  {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ══════════════════════════════════════════
   ⑬ Toast Notifications
   ══════════════════════════════════════════ */
#az-toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 40px);
}
.az-toast {
  padding: 12px 22px;
  border-radius: 12px;
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  transform: translateY(20px);
  opacity: 0;
  transition: transform .3s, opacity .3s;
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 8px;
}
.az-toast.show { transform: translateY(0); opacity: 1; }
.az-toast.success { background: var(--success); }
.az-toast.error   { background: var(--danger);  }
.az-toast.warning { background: var(--warning); }
.az-toast.info    { background: var(--info);    }
.az-toast.accent  { background: linear-gradient(135deg, var(--primary), var(--accent)); }

/* ══════════════════════════════════════════
   ⑭ Notification Bell Dropdown
   ══════════════════════════════════════════ */
.notif-wrap { position: relative; }
.notif-bell {
  position: relative;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  color: var(--text-muted);
}
.notif-bell:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.notif-count {
  position: absolute;
  top: -5px; left: -5px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  border-radius: 10px;
  min-width: 17px; height: 17px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.notif-count.show { display: flex; }
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  display: none;
  flex-direction: column;
  max-height: 440px;
  overflow: hidden;
}
.notif-dropdown.open { display: flex; }
.notif-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--accent-subtle); }
.notif-item.unread { background: rgba(252,245,235,.6); }
.notif-item.unread::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-item:not(.unread)::before { content: ''; width: 8px; flex-shrink: 0; }
.notif-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.notif-body  { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.notif-time  { font-size: 10px; color: var(--text-light); margin-top: 3px; }
.notif-empty { text-align: center; padding: 30px; color: var(--text-light); font-size: 13px; }

/* ══════════════════════════════════════════
   ⑮ Section Headers
   ══════════════════════════════════════════ */
.section-heading {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-heading::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ══════════════════════════════════════════
   ⑯ Alert / Info Boxes
   ══════════════════════════════════════════ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #d4edda; border-color: #b8dfc6; color: #155724; }
.alert-danger  { background: #f8d7da; border-color: #f3b8bc; color: #721c24; }
.alert-warning { background: #fff3cd; border-color: #ffdc7a; color: #856404; }
.alert-info    { background: #d1ecf1; border-color: #bee5eb; color: #0c5460; }
.alert-accent  { background: var(--accent-subtle); border-color: rgba(184,146,42,.3); color: var(--accent); }

/* ══════════════════════════════════════════
   ⑰ Navigation Tabs
   ══════════════════════════════════════════ */
.nav-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 6px;
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.nav-tab {
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  transition: all .2s;
  white-space: nowrap;
}
.nav-tab:hover { background: var(--accent-subtle); color: var(--accent); }
.nav-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ══════════════════════════════════════════
   ⑱ Pagination
   ══════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.page-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ══════════════════════════════════════════
   ⑲ Progress Bars
   ══════════════════════════════════════════ */
.progress-bar {
  background: var(--border);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width .6s ease;
}
.progress-fill.success { background: var(--success); }
.progress-fill.danger  { background: var(--danger);  }
.progress-fill.info    { background: var(--info);    }

/* ══════════════════════════════════════════
   ⑳ Login Page
   ══════════════════════════════════════════ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, #3d2b0a 100%);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  text-align: center;
}
.login-logo {
  width: 72px; height: 72px;
  border-radius: 16px;
  margin: 0 auto 16px;
  object-fit: cover;
  border: 3px solid var(--accent-subtle);
}
.login-title { font-size: 22px; font-weight: 900; color: var(--primary); margin-bottom: 4px; }
.login-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.login-err   {
  background: #fef0f0;
  border: 1px solid #fcc;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}
.login-err.show { display: block; }

/* ══════════════════════════════════════════
   ㉑ Footer
   ══════════════════════════════════════════ */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}
.app-footer a { color: var(--accent); }

/* ══════════════════════════════════════════
   ㉒ Print Styles
   ══════════════════════════════════════════ */
@media print {
  .topbar, .sidebar, .nav-tabs, .btn-primary, .btn-accent,
  .app-footer, .no-print, #az-toast-container { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  .page-content { padding: 0; }
}

/* ══════════════════════════════════════════
   ㉓ Scrollbar
   ══════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ══════════════════════════════════════════
   ㉔ Utility Animations
   ══════════════════════════════════════════ */
@keyframes fadeIn   { from{opacity:0} to{opacity:1} }
@keyframes fadeUp   { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
@keyframes pulse    { 0%,100%{opacity:1} 50%{opacity:.5} }

.anim-fade   { animation: fadeIn .4s ease; }
.anim-fadeUp { animation: fadeUp .4s ease; }
