/* ============================================================
   SAFETY BEGINS WITH ME — Main Stylesheet (Arabic / RTL)
   ============================================================ */
   @import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700;800&display=swap');
   @import url('variables.css');
   
   /* ── Reset & Base ─────────────────────────────────────────── */
   *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
   
   html {
     -webkit-text-size-adjust: 100%;
     -webkit-tap-highlight-color: transparent;
     touch-action: manipulation;
     direction: rtl;
   }
   
   body {
     font-family: 'Rubik', var(--font-sans);
     font-size: var(--text-base);
     color: var(--gray-800);
     background: var(--gray-50);
     line-height: 1.6;
     overflow-x: hidden;
     direction: rtl;
     text-align: right;
   }
   
   a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
   a:hover { color: var(--accent); }
   img { max-width: 100%; }
   
   /* ── Scrollbar ─────────────────────────────────────────────── */
   ::-webkit-scrollbar { width: 6px; height: 6px; }
   ::-webkit-scrollbar-track { background: var(--gray-100); }
   ::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-full); }
   ::-webkit-scrollbar-thumb:hover { background: var(--accent); }
   
   /* ── Selection ─────────────────────────────────────────────── */
   ::selection { background: var(--accent); color: var(--white); }
   
   /* ============================================================
      LAYOUT — Admin / Moderator Shell
      ============================================================ */
   .app-wrapper { display: flex; min-height: 100vh; direction: rtl; }
   
   /* ── Sidebar ────────────────────────────────────────────────── */
   .sidebar {
     width: var(--sidebar-width);
     min-height: 100vh;
     background: var(--primary);
     position: fixed;
     right: 0; top: 0;           /* RTL: right instead of left */
     display: flex;
     flex-direction: column;
     z-index: var(--z-sidebar);
     transition: width var(--transition-base);
     overflow: hidden;
   }
   
   .sidebar.collapsed { width: var(--sidebar-collapsed); }
   
   .sidebar-brand {
     display: flex;
     align-items: center;
     gap: 12px;
     padding: 20px 18px;
     border-bottom: 1px solid rgba(255,255,255,0.08);
     min-height: var(--topbar-height);
     white-space: nowrap;
     overflow: hidden;
   }
   
   .sidebar-brand img { width: 36px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0; object-fit: contain; }
   .sidebar-brand-text { display: flex; flex-direction: column; }
   .sidebar-brand-text .brand-name { color: var(--white); font-weight: 700; font-size: var(--text-sm); line-height: 1.2; }
   .sidebar-brand-text .brand-sub  { color: var(--accent); font-size: var(--text-xs); font-weight: 500; }
   
   .sidebar.collapsed .sidebar-brand-text,
   .sidebar.collapsed .nav-label,
   .sidebar.collapsed .nav-section-title { display: none; }
   
   .sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; overflow-x: hidden; }
   
   .nav-section-title {
     font-size: 10px;
     font-weight: 700;
     letter-spacing: 0.05em;       /* reduced letter-spacing for Arabic */
     text-transform: uppercase;
     color: rgba(255,255,255,0.35);
     padding: 14px 20px 6px;
     white-space: nowrap;
   }
   
   .nav-item { display: flex; flex-direction: column; }
   
   .nav-label {
     font-size: 10px;
     font-weight: 700;
     letter-spacing: 0.05em;
     text-transform: uppercase;
     color: rgba(255,255,255,0.35);
     padding: 12px 20px 4px;
     display: block;
   }
   .sidebar.collapsed .nav-label { display: none; }
   
   .nav-link {
     display: flex;
     align-items: center;
     gap: 12px;
     padding: 10px 18px;
     color: rgba(255,255,255,0.65);
     font-size: var(--text-sm);
     font-weight: 500;
     border-radius: var(--radius-md);
     margin: 2px 10px;
     transition: all var(--transition-fast);
     white-space: nowrap;
     position: relative;
   }
   
   .nav-link i { font-size: 18px; width: 22px; text-align: center; flex-shrink: 0; }
   .nav-link:hover { background: rgba(255,255,255,0.08); color: var(--white); }
   .nav-link.active { background: var(--accent) !important; color: var(--white) !important; box-shadow: 0 4px 12px rgba(252,133,3,0.35) !important; }
   .nav-link.active i { color: var(--white) !important; }
   
   .nav-badge {
     margin-right: auto;           /* RTL: margin-right instead of margin-left */
     background: var(--danger);
     color: var(--white);
     font-size: 10px;
     font-weight: 700;
     padding: 2px 7px;
     border-radius: var(--radius-full);
     flex-shrink: 0;
   }
   
   .sidebar.collapsed .nav-badge { display: none; }
   .sidebar.collapsed .nav-link { padding: 10px; justify-content: center; margin: 2px 8px; }
   
   .sidebar-footer {
     padding: 16px;
     border-top: 1px solid rgba(255,255,255,0.08);
   }
   
   .sidebar-user {
     display: flex;
     align-items: center;
     gap: 10px;
     padding: 10px;
     border-radius: var(--radius-md);
     background: rgba(255,255,255,0.06);
     overflow: hidden;
   }
   .sidebar-user-avatar {
     width: 34px; height: 34px;
     background: var(--accent);
     border-radius: var(--radius-full);
     display: flex; align-items: center; justify-content: center;
     font-weight: 700; font-size: var(--text-sm); color: var(--white);
     flex-shrink: 0;
   }
   .sidebar-user-info { white-space: nowrap; overflow: hidden; }
   .sidebar-user-name { color: var(--white); font-size: var(--text-sm); font-weight: 600; }
   .sidebar-user-role { color: rgba(255,255,255,0.45); font-size: var(--text-xs); }
   .sidebar.collapsed .sidebar-user-info { display: none; }
   
   /* ── Main Content ───────────────────────────────────────────── */
   .main-content {
     margin-right: var(--sidebar-width);   /* RTL: margin-right instead of margin-left */
     flex: 1;
     display: flex;
     flex-direction: column;
     min-height: 100vh;
     transition: margin-right var(--transition-base);
   }
   .sidebar.collapsed ~ .main-content { margin-right: var(--sidebar-collapsed); }
   
   /* ── Topbar ─────────────────────────────────────────────────── */
   .topbar {
     height: var(--topbar-height);
     background: var(--white);
     border-bottom: 1px solid var(--gray-200);
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 0 24px;
     position: sticky;
     top: 0;
     z-index: var(--z-topbar);
     box-shadow: var(--shadow-xs);
   }
   
   .topbar-left { display: flex; align-items: center; gap: 16px; }
   
   .btn-toggle-sidebar {
     background: none; border: none; padding: 8px;
     color: var(--gray-500); cursor: pointer; border-radius: var(--radius-sm);
     font-size: 20px; transition: all var(--transition-fast);
     display: flex; align-items: center;
   }
   .btn-toggle-sidebar:hover { background: var(--gray-100); color: var(--primary); }
   
   .topbar-title { font-weight: 700; color: var(--primary); font-size: var(--text-lg); }
   
   .topbar-right { display: flex; align-items: center; gap: 10px; }
   
   .topbar-btn {
     position: relative;
     background: none; border: none;
     width: 38px; height: 38px;
     border-radius: var(--radius-md);
     display: flex; align-items: center; justify-content: center;
     color: var(--gray-500); cursor: pointer;
     font-size: 18px; transition: all var(--transition-fast);
   }
   .topbar-btn:hover { background: var(--gray-100); color: var(--primary); }
   .topbar-btn .badge-dot {
     position: absolute; top: 6px; left: 6px;   /* RTL: left instead of right */
     width: 8px; height: 8px;
     background: var(--danger); border-radius: 50%;
     border: 2px solid var(--white);
   }
   
   .topbar-user {
     display: flex; align-items: center; gap: 8px;
     padding: 6px 12px;
     border-radius: var(--radius-full);
     cursor: pointer;
     transition: background var(--transition-fast);
   }
   .topbar-user:hover { background: var(--gray-100); }
   .topbar-user-avatar {
     width: 32px; height: 32px;
     background: var(--primary);
     border-radius: var(--radius-full);
     display: flex; align-items: center; justify-content: center;
     color: var(--white); font-size: var(--text-sm); font-weight: 700;
   }
   .topbar-user-name { font-size: var(--text-sm); font-weight: 600; color: var(--gray-700); }
   
   /* ── Page Content ───────────────────────────────────────────── */
   .page-content { padding: 28px 24px; flex: 1; }
   
   .page-header { margin-bottom: 24px; }
   .page-title { font-size: var(--text-2xl); font-weight: 800; color: var(--primary); }
   .page-subtitle { color: var(--gray-500); font-size: var(--text-sm); margin-top: 4px; }
   
   .breadcrumb { flex-direction: row; }    /* RTL breadcrumb */
   .breadcrumb-item.active { color: var(--gray-500); }
   .breadcrumb-item + .breadcrumb-item::before { color: var(--gray-300); }
   
   /* ============================================================
      CARDS
      ============================================================ */
   .card {
     background: var(--white);
     border-radius: var(--radius-xl);
     border: 1px solid var(--gray-200);
     box-shadow: var(--shadow-sm);
     overflow: hidden;
   }
   
   .card-header {
     padding: 18px 24px;
     border-bottom: 1px solid var(--gray-100);
     display: flex;
     align-items: center;
     justify-content: space-between;
     background: var(--white);
   }
   
   .card-title {
     font-size: var(--text-base);
     font-weight: 700;
     color: var(--primary);
     display: flex;
     align-items: center;
     gap: 8px;
   }
   .card-title i { color: var(--accent); }
   .card-body { padding: 24px; }
   
   /* ── KPI Cards ──────────────────────────────────────────────── */
   .kpi-card {
     background: var(--white);
     border-radius: var(--radius-xl);
     border: 1px solid var(--gray-200);
     box-shadow: var(--shadow-sm);
     padding: 24px;
     display: flex;
     align-items: center;
     gap: 18px;
     position: relative;
     overflow: hidden;
     transition: all var(--transition-base);
   }
   .kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
   
   .kpi-icon {
     width: 56px; height: 56px;
     border-radius: var(--radius-lg);
     display: flex; align-items: center; justify-content: center;
     font-size: 24px;
     flex-shrink: 0;
   }
   .kpi-icon.primary { background: rgba(2,30,71,0.1);    color: var(--primary); }
   .kpi-icon.accent  { background: rgba(252,133,3,0.12); color: var(--accent); }
   .kpi-icon.success { background: var(--success-light); color: var(--success); }
   .kpi-icon.warning { background: var(--warning-light); color: var(--warning); }
   .kpi-icon.danger  { background: var(--danger-light);  color: var(--danger); }
   .kpi-icon.info    { background: var(--info-light);    color: var(--info); }
   
   .kpi-value  { font-size: var(--text-3xl); font-weight: 800; color: var(--primary); line-height: 1; }
   .kpi-label  { font-size: var(--text-sm); color: var(--gray-500); margin-top: 4px; font-weight: 500; }
   .kpi-change { font-size: var(--text-xs); margin-top: 6px; font-weight: 600; }
   .kpi-change.up   { color: var(--success); }
   .kpi-change.down { color: var(--danger); }
   
   .kpi-card::after {
     content: '';
     position: absolute;
     left: -20px; top: -20px;     /* RTL: left instead of right */
     width: 80px; height: 80px;
     border-radius: 50%;
     background: var(--gray-100);
     opacity: 0.5;
   }
   
   /* ============================================================
      BUTTONS
      ============================================================ */
   .btn {
     border-radius: var(--radius-md) !important;
     font-weight: 600;
     font-size: var(--text-sm);
     padding: 9px 20px;
     transition: all var(--transition-fast);
     border: none;
     display: inline-flex;
     align-items: center;
     gap: 7px;
   }
   
   .btn-primary-brand {
     background: var(--primary);
     color: var(--white);
     box-shadow: 0 4px 12px rgba(2,30,71,0.2);
   }
   .btn-primary-brand:hover { background: var(--primary-light); color: var(--white); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(2,30,71,0.25); }
   
   .btn-accent {
     background: var(--accent);
     color: var(--white);
     box-shadow: 0 4px 12px rgba(252,133,3,0.3);
   }
   .btn-accent:hover { background: var(--accent-light); color: var(--white); transform: translateY(-1px); }
   
   .btn-outline-brand {
     background: transparent;
     color: var(--primary);
     border: 2px solid var(--primary) !important;
   }
   .btn-outline-brand:hover { background: var(--primary); color: var(--white); }
   
   .btn-outline-accent {
     background: transparent;
     color: var(--accent);
     border: 2px solid var(--accent) !important;
   }
   .btn-outline-accent:hover { background: var(--accent); color: var(--white); }
   
   .btn-sm   { padding: 6px 14px !important;  font-size: var(--text-xs)   !important; }
   .btn-lg   { padding: 13px 28px !important; font-size: var(--text-base) !important; }
   .btn-icon { width: 36px; height: 36px; padding: 0 !important; justify-content: center; }
   
   .btn-success { background: var(--success) !important; color: var(--white) !important; border: none !important; }
   .btn-warning { background: var(--warning) !important; color: var(--white) !important; border: none !important; }
   .btn-danger  { background: var(--danger)  !important; color: var(--white) !important; border: none !important; }
   
   /* ============================================================
      BADGES
      ============================================================ */
   .badge {
     border-radius: var(--radius-full) !important;
     font-weight: 600;
     font-size: var(--text-xs);
     padding: 4px 12px;
   }
   
   .badge-pending    { background: var(--warning-light); color: #92400e; }
   .badge-inprogress { background: var(--info-light);    color: #1e40af; }
   .badge-resolved   { background: var(--success-light); color: #065f46; }
   .badge-closed     { background: var(--gray-200);      color: var(--gray-600); }
   
   .badge-low      { background: rgba(16,185,129,0.12);  color: #065f46; }
   .badge-medium   { background: var(--warning-light);   color: #92400e; }
   .badge-high     { background: rgba(249,115,22,0.12);  color: #9a3412; }
   .badge-critical { background: var(--danger-light);    color: #991b1b; }
   
   /* ============================================================
      TABLES
      ============================================================ */
   .table-wrapper {
     border-radius: var(--radius-xl);
     overflow: hidden;
     border: 1px solid var(--gray-200);
     background: var(--white);
   }
   
   .table { margin-bottom: 0 !important; }
   .table thead th {
     background: var(--gray-50);
     color: var(--gray-600);
     font-size: var(--text-xs);
     font-weight: 700;
     text-transform: uppercase;
     letter-spacing: 0.04em;
     border-bottom: 1px solid var(--gray-200) !important;
     padding: 13px 16px;
     white-space: nowrap;
     text-align: right;            /* RTL */
   }
   .table tbody td {
     padding: 14px 16px;
     vertical-align: middle;
     border-bottom: 1px solid var(--gray-100) !important;
     font-size: var(--text-sm);
     text-align: right;            /* RTL */
   }
   .table tbody tr:last-child td { border-bottom: none !important; }
   .table tbody tr:hover td { background: var(--gray-50); }
   
   /* ============================================================
      FORMS
      ============================================================ */
   .form-control, .form-select {
     border-radius: var(--radius-md) !important;
     border: 1.5px solid var(--gray-200) !important;
     font-size: var(--text-sm) !important;
     padding: 10px 14px !important;
     color: var(--gray-800) !important;
     background: var(--white) !important;
     transition: all var(--transition-fast) !important;
     text-align: right;            /* RTL */
     direction: rtl;
   }
   .form-control:focus, .form-select:focus {
     border-color: var(--accent) !important;
     box-shadow: 0 0 0 3px rgba(252,133,3,0.12) !important;
     outline: none !important;
   }
   .form-label {
     font-size: var(--text-sm);
     font-weight: 600;
     color: var(--gray-700);
     margin-bottom: 6px;
     display: block;
     text-align: right;            /* RTL */
   }
   .form-text { font-size: var(--text-xs); color: var(--gray-400); margin-top: 4px; }
   
   .input-group .btn { border-radius: var(--radius-md) !important; }
   
   /* ============================================================
      MODALS
      ============================================================ */
   .modal-content {
     border-radius: var(--radius-2xl) !important;
     border: none !important;
     box-shadow: var(--shadow-xl) !important;
     overflow: hidden;
   }
   .modal-header {
     background: var(--primary);
     color: var(--white);
     border-bottom: none !important;
     padding: 20px 24px;
   }
   .modal-title { font-weight: 700; color: var(--white); }
   .btn-close { filter: invert(1); }
   .modal-footer {
     border-top: 1px solid var(--gray-100) !important;
     padding: 16px 24px;
   }
   .modal-body { padding: 24px; }
   
   /* ── SweetAlert2 Overrides ────────────────────────────────── */
   .swal2-popup {
     border-radius: var(--radius-2xl) !important;
     font-family: 'Rubik', var(--font-sans) !important;
     padding: 32px !important;
     direction: rtl;
     text-align: right;
   }
   .swal2-confirm {
     border-radius: var(--radius-full) !important;
     background: var(--accent) !important;
     font-weight: 600 !important;
     padding: 10px 28px !important;
   }
   .swal2-cancel {
     border-radius: var(--radius-full) !important;
     background: var(--gray-200) !important;
     color: var(--gray-700) !important;
     font-weight: 600 !important;
     padding: 10px 28px !important;
   }
   .swal2-title { color: var(--primary) !important; font-weight: 800 !important; }
   .swal2-icon.swal2-success { border-color: var(--success) !important; }
   .swal2-icon.swal2-success [class^='swal2-success-line'] { background: var(--success) !important; }
   
   /* ============================================================
      NOTIFICATIONS DROPDOWN
      ============================================================ */
   .notif-dropdown {
     width: 360px;
     border-radius: var(--radius-xl) !important;
     border: 1px solid var(--gray-200) !important;
     box-shadow: var(--shadow-xl) !important;
     padding: 0 !important;
     overflow: hidden;
   }
   .notif-header { padding: 14px 18px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
   .notif-header h6 { font-weight: 700; color: var(--primary); margin: 0; }
   .notif-list { max-height: 320px; overflow-y: auto; }
   .notif-item {
     display: flex; align-items: flex-start; gap: 12px;
     padding: 14px 18px;
     border-bottom: 1px solid var(--gray-100);
     cursor: pointer;
     transition: background var(--transition-fast);
   }
   .notif-item:hover { background: var(--gray-50); }
   .notif-item.unread { background: rgba(252,133,3,0.04); }
   .notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 6px; }
   .notif-dot.read { background: var(--gray-300); }
   .notif-text { font-size: var(--text-sm); color: var(--gray-700); line-height: 1.6; text-align: right; }
   .notif-time { font-size: var(--text-xs); color: var(--gray-400); margin-top: 3px; text-align: right; }
   .notif-footer { padding: 12px 18px; text-align: center; }
   .notif-footer a { font-size: var(--text-sm); font-weight: 600; color: var(--accent); }
   
   /* ============================================================
      RISK DETAIL — Timeline
      ============================================================ */
   .timeline { position: relative; padding-right: 28px; }  /* RTL: padding-right */
   .timeline::before {
     content: '';
     position: absolute;
     right: 8px; top: 0; bottom: 0;  /* RTL: right instead of left */
     width: 2px;
     background: var(--gray-200);
   }
   .timeline-item { position: relative; margin-bottom: 20px; }
   .timeline-dot {
     position: absolute;
     right: -24px; top: 4px;        /* RTL: right instead of left */
     width: 14px; height: 14px;
     border-radius: 50%;
     background: var(--accent);
     border: 2px solid var(--white);
     box-shadow: var(--shadow-sm);
   }
   .timeline-content {
     background: var(--gray-50);
     border-radius: var(--radius-md);
     padding: 12px 16px;
     border: 1px solid var(--gray-200);
   }
   .timeline-title { font-weight: 600; font-size: var(--text-sm); color: var(--primary); }
   .timeline-time  { font-size: var(--text-xs); color: var(--gray-400); margin-top: 2px; }
   .timeline-body  { font-size: var(--text-sm); color: var(--gray-600); margin-top: 6px; }
   
   /* ============================================================
      IMAGE PREVIEWS
      ============================================================ */
   .img-preview-grid {
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
     gap: 12px;
   }
   .img-preview-item {
     position: relative;
     border-radius: var(--radius-md);
     overflow: hidden;
     aspect-ratio: 1;
     border: 2px solid var(--gray-200);
     cursor: pointer;
     transition: all var(--transition-fast);
   }
   .img-preview-item:hover { border-color: var(--accent); transform: scale(1.02); }
   .img-preview-item img { width: 100%; height: 100%; object-fit: cover; }
   .img-preview-label {
     position: absolute;
     bottom: 0; left: 0; right: 0;
     background: rgba(0,0,0,0.55);
     color: var(--white);
     font-size: 10px;
     font-weight: 600;
     text-align: center;
     padding: 4px;
   }
   
   /* ============================================================
      MAP
      ============================================================ */
   #risk-map, .leaflet-map { border-radius: var(--radius-xl); overflow: hidden; }
   .map-filters-bar {
     background: var(--white);
     border-radius: var(--radius-xl);
     border: 1px solid var(--gray-200);
     padding: 16px 20px;
     display: flex;
     align-items: center;
     gap: 12px;
     flex-wrap: wrap;
     box-shadow: var(--shadow-sm);
   }
   
   .risk-pin-popup h6 { font-weight: 700; color: var(--primary); margin-bottom: 6px; }
   .risk-pin-popup p  { font-size: var(--text-xs); margin: 2px 0; color: var(--gray-600); }
   
   /* ============================================================
      STATS / CHART CARDS
      ============================================================ */
   .chart-card { background: var(--white); border-radius: var(--radius-xl); border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); overflow: hidden; }
   .chart-card-header { padding: 18px 22px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
   .chart-card-title { font-weight: 700; color: var(--primary); font-size: var(--text-sm); display: flex; align-items: center; gap: 8px; }
   .chart-card-body { padding: 20px; }
   
   /* ============================================================
      SEARCH & FILTER BAR
      ============================================================ */
   .filter-bar {
     background: var(--white);
     border-radius: var(--radius-xl);
     border: 1px solid var(--gray-200);
     padding: 16px 20px;
     box-shadow: var(--shadow-sm);
     display: flex;
     align-items: center;
     gap: 12px;
     flex-wrap: wrap;
   }
   .filter-bar .form-control,
   .filter-bar .form-select { background: var(--gray-50) !important; max-width: 200px; }
   
   /* ============================================================
      PAGINATION
      ============================================================ */
   .pagination { gap: 4px; direction: rtl; }
   .page-link { border-radius: var(--radius-sm) !important; border: 1px solid var(--gray-200) !important; color: var(--gray-600) !important; font-size: var(--text-sm) !important; font-weight: 500 !important; padding: 7px 13px !important; transition: all var(--transition-fast); }
   .page-item.active .page-link { background: var(--accent) !important; border-color: var(--accent) !important; color: var(--white) !important; box-shadow: 0 2px 8px rgba(252,133,3,0.3); }
   .page-link:hover { background: var(--gray-100) !important; color: var(--primary) !important; }
   
   /* ============================================================
      ASSESSMENT RISK MATRIX
      ============================================================ */
   .risk-score-badge {
     display: inline-flex; align-items: center; justify-content: center;
     width: 48px; height: 48px;
     border-radius: var(--radius-full);
     font-weight: 800; font-size: var(--text-lg); color: var(--white);
   }
   .risk-score-badge.low      { background: var(--severity-low); }
   .risk-score-badge.medium   { background: var(--severity-medium); }
   .risk-score-badge.high     { background: var(--severity-high); }
   .risk-score-badge.critical { background: var(--severity-critical); }
   
   /* ============================================================
      PROGRESS BARS
      ============================================================ */
   .progress { border-radius: var(--radius-full) !important; background: var(--gray-100) !important; height: 8px !important; }
   .progress-bar { border-radius: var(--radius-full) !important; background: var(--accent) !important; }
   .progress-bar.success { background: var(--success) !important; }
   .progress-bar.danger  { background: var(--danger)  !important; }
   
   /* ============================================================
      EMPTY STATE
      ============================================================ */
   .empty-state {
     text-align: center;
     padding: 60px 20px;
     color: var(--gray-400);
   }
   .empty-state i  { font-size: 56px; margin-bottom: 16px; opacity: 0.4; }
   .empty-state h5 { color: var(--gray-600); font-weight: 700; }
   .empty-state p  { font-size: var(--text-sm); }
   
   /* ============================================================
      LOADING OVERLAY
      ============================================================ */
   .loading-overlay {
     position: fixed; inset: 0;
     background: rgba(2,30,71,0.6);
     z-index: 9999;
     display: flex;
     align-items: center;
     justify-content: center;
     backdrop-filter: blur(4px);
   }
   .loading-spinner {
     width: 56px; height: 56px;
     border: 5px solid rgba(255,255,255,0.2);
     border-top-color: var(--accent);
     border-radius: 50%;
     animation: spin 0.8s linear infinite;
   }
   @keyframes spin { to { transform: rotate(360deg); } }
   
   /* ============================================================
      PROFILE PAGE
      ============================================================ */
   .profile-avatar {
     width: 90px; height: 90px;
     background: var(--primary);
     border-radius: var(--radius-full);
     display: flex; align-items: center; justify-content: center;
     font-size: 2rem; font-weight: 700; color: var(--white);
     margin: 0 auto 16px;
     box-shadow: var(--shadow-lg);
   }
   
   /* ============================================================
      RESPONSIVE
      ============================================================ */
   @media (max-width: 991.98px) {
     .sidebar {
       transform: translateX(100%);   /* RTL: positive instead of negative */
       width: var(--sidebar-width) !important;
       transition: transform var(--transition-base);
     }
     .sidebar.mobile-open { transform: translateX(0); }
     .main-content { margin-right: 0 !important; }   /* RTL */
   
     .sidebar-overlay {
       display: none;
       position: fixed; inset: 0;
       background: rgba(0,0,0,0.5);
       z-index: calc(var(--z-sidebar) - 1);
       backdrop-filter: blur(2px);
     }
     .sidebar-overlay.show { display: block; }
   
     .page-content { padding: 16px; }
     .topbar { padding: 0 16px; }
     .topbar-title { font-size: var(--text-base); }
     .notif-dropdown { width: 300px; }
     .filter-bar { flex-direction: column; align-items: stretch; }
     .filter-bar .form-control,
     .filter-bar .form-select { max-width: 100%; }
   }
   
   @media (max-width: 575.98px) {
     .kpi-card  { padding: 16px; }
     .kpi-value { font-size: var(--text-2xl); }
     .page-title { font-size: var(--text-xl); }
   }
   
   /* ============================================================
      PRINT (PDF)
      ============================================================ */
   @media print {
     .sidebar, .topbar, .btn, .filter-bar, .pagination,
     .no-print, .swal2-container { display: none !important; }
     .main-content { margin-right: 0 !important; }   /* RTL */
     .card { box-shadow: none !important; border: 1px solid #ddd !important; }
     body { background: white !important; }
     .page-break { page-break-before: always; }
   }
   
   /* ============================================================
      UTILITY HELPERS
      ============================================================ */
   .text-primary-brand { color: var(--primary) !important; }
   .text-accent        { color: var(--accent)  !important; }
   .bg-primary-brand   { background: var(--primary) !important; }
   .bg-accent          { background: var(--accent)  !important; }
   .rounded-brand      { border-radius: var(--radius-xl) !important; }
   .shadow-brand       { box-shadow: var(--shadow-md) !important; }
   .border-accent      { border-color: var(--accent) !important; }
   .fw-700 { font-weight: 700 !important; }
   .fw-800 { font-weight: 800 !important; }
   .gap-2  { gap: 8px  !important; }
   .gap-3  { gap: 12px !important; }
   .cursor-pointer { cursor: pointer; }




   .tooltip-custom {
    position: relative;
  }
  .tooltip-custom::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #021e47;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    padding: 5px 12px;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(-50%) translateY(4px);
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(2,30,71,0.25);
  }
  .tooltip-custom::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #021e47;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 9999;
  }
  .tooltip-custom:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  .tooltip-custom:hover::before {
    opacity: 1;
  }


.form-check-input:checked {
    background-color: #e77a02 !important;
    border-color: #e77a02 !important;
}



@media (max-width: 1199px) {
  .sidebar {
    transform: translateX(100%);
    transition: transform 0.3s ease;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 1050;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1049;
  }
  .sidebar-overlay.show {
    display: block;
  }
}




.breadcrumb-item+.breadcrumb-item::before {
  float: unset !important;
  padding-left: var(--bs-breadcrumb-item-padding-x);
  color: var(--bs-breadcrumb-divider-color);
  content: var(--bs-breadcrumb-divider, "/");
  padding-right: unset !important;
}