/* ================================================================
   SMA ALBNYAN — Dashboard Design System
   ================================================================
   Fonts:    Cairo (Arabic) — Google Fonts
   Colors:   Navy #1F2B5B | Teal #78D1E1 | Bg #F0F3F9
   Radius:   4px (components) | 8px (cards) | 20px (badges)
   Dir:      RTL
   ================================================================
   INDEX
   1.  CSS Variables (Design Tokens)
   2.  Base Reset
   3.  Layout Shell (dash-wrap, dash-side, dash-main)
   4.  Sidebar
   5.  Topbar
   6.  Content Area
   7.  Stats Cards
   8.  Panels
   9.  Tables
   10. Buttons
   11. Forms & Inputs
   12. Status Badges
   13. Contract Action Buttons
   14. Notification Dropdown (topbar)
   15. Notifications Page
   16. Pagination
   17. Breadcrumb
   18. Alerts
   19. Footer
   20. Mobile Sidebar Toggle
   21. Responsive
   ================================================================ */

/* ──────────────────────────────────────────────────────────────
   1. CSS Variables
   ────────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --navy:        #1F2B5B;
  --navy-deep:   #151e40;
  --navy-hover:  #263570;
  --teal:        #78D1E1;
  --teal-soft:   #e8f7fa;
  --teal-mid:    #4ebdd0;

  /* UI */
  --bg:          #F0F3F9;
  --surface:     #ffffff;
  --border:      #E2E8F0;
  --border-soft: #f1f5f9;

  /* Text */
  --text:        #1a2340;
  --muted:       #64748b;
  --muted-soft:  #94a3b8;

  /* Semantic */
  --success:     #10b981;
  --success-bg:  #d1fae5;
  --warning:     #f59e0b;
  --warning-bg:  #fef3c7;
  --danger:      #dc2626;
  --danger-bg:   #fee2e2;
  --info:        #3b82f6;
  --info-bg:     #dbeafe;
  --purple:      #7c3aed;
  --purple-bg:   #ede9fe;

  /* Sizing */
  --sidebar-w:   248px;
  --topbar-h:    62px;
  --r:           4px;
  --r-card:      8px;
  --r-badge:     20px;

  /* Shadows */
  --shadow-sm:   0 1px 4px rgba(31,43,91,.07);
  --shadow-md:   0 4px 16px rgba(31,43,91,.1);
  --shadow-lg:   0 8px 32px rgba(31,43,91,.14);

  /* Font */
  --font:        'Cairo', 'Segoe UI', sans-serif;
}

/* ──────────────────────────────────────────────────────────────
   2. Base Reset
   ────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family:  var(--font) !important;
  background:   var(--bg)   !important;
  color:        var(--text);
  margin:       0;
  padding:      0;
  min-height:   100vh;
  direction:    rtl;
}

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; }

/* ──────────────────────────────────────────────────────────────
   3. Layout Shell
   ────────────────────────────────────────────────────────────── */
.dash-wrap {
  display:        flex        !important;
  flex-direction: row         !important;
  min-height:     100vh;
  background:     var(--bg);
}

.dash-main {
  flex:           1           !important;
  display:        flex        !important;
  flex-direction: column      !important;
  min-width:      0;
  overflow-x:     hidden;
}

/* ──────────────────────────────────────────────────────────────
   4. Sidebar
   ────────────────────────────────────────────────────────────── */
.dash-side {
  width:          var(--sidebar-w) !important;
  min-width:      var(--sidebar-w) !important;
  background:     var(--navy)      !important;
  display:        flex             !important;
  flex-direction: column           !important;
  flex-shrink:    0                !important;
  position:       sticky           !important;
  top:            0;
  height:         100vh;
  overflow-y:     auto;
  overflow-x:     hidden;
  z-index:        100;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}

.dash-side::-webkit-scrollbar       { width: 4px; }
.dash-side::-webkit-scrollbar-track  { background: transparent; }
.dash-side::-webkit-scrollbar-thumb  { background: rgba(255,255,255,.18); border-radius: 4px; }

/* Brand */
.dash-brand {
  display:      flex;
  align-items:  center;
  gap:          10px;
  padding:      18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink:  0;
}

.dash-logo {
  width:         40px;
  height:        40px;
  border-radius: 8px;
  object-fit:    cover;
  flex-shrink:   0;
  background:    rgba(255,255,255,.1);
}

.dash-brand-text {
  flex:      1;
  min-width: 0;
}

.dash-brand-title {
  font-size:   14px;
  font-weight: 800;
  color:       #fff;
  white-space: nowrap;
  overflow:    hidden;
  text-overflow: ellipsis;
}

.dash-brand-sub {
  font-size:   11px;
  color:       rgba(255,255,255,.5);
  margin-top:  1px;
}

/* Navigation */
.dash-nav {
  padding:  12px 10px;
  flex:     1;
  display:  flex;
  flex-direction: column;
  gap:      3px;
}

.dash-link {
  display:        flex        !important;
  align-items:    center;
  gap:            10px;
  padding:        10px 12px;
  border-radius:  var(--r);
  color:          rgba(255,255,255,.65) !important;
  text-decoration: none       !important;
  font-size:      13.5px;
  font-weight:    600;
  transition:     background .18s, color .18s;
  white-space:    nowrap;
}

.dash-link svg {
  flex-shrink: 0;
  stroke-width: 1.8;
}

.dash-link:hover,
.dash-link.active {
  background: var(--teal)  !important;
  color:      var(--navy)  !important;
  font-weight: 700;
}

.dash-link.active svg,
.dash-link:hover svg {
  stroke: var(--navy);
}

.dash-sep {
  height:     1px;
  background: rgba(255,255,255,.08);
  margin:     8px 0;
}

.dash-logout:hover {
  background: rgba(220,38,38,.2) !important;
  color:      #fca5a5            !important;
}

/* Sidebar close (mobile) */
.sidebar-close {
  display:    none;
  background: none;
  border:     none;
  color:      rgba(255,255,255,.6);
  font-size:  18px;
  cursor:     pointer;
  padding:    4px;
  margin-right: auto;
}

/* ──────────────────────────────────────────────────────────────
   5. Topbar
   ────────────────────────────────────────────────────────────── */
.dash-top {
  background:      var(--surface) !important;
  border-bottom:   1px solid var(--border);
  height:          var(--topbar-h);
  display:         flex           !important;
  align-items:     center         !important;
  justify-content: space-between  !important;
  padding:         0 28px;
  position:        sticky         !important;
  top:             0;
  z-index:         99;
  flex-shrink:     0;
}

.dash-top-right {
  flex: 1;
  min-width: 0;
}

.dash-title {
  font-size:   16px;
  font-weight: 800;
  color:       var(--navy);
  line-height: 1.2;
}

.dash-subtitle {
  font-size: 12px;
  color:     var(--muted);
  margin-top: 1px;
}

.dash-top-left {
  display:     flex;
  align-items: center;
  gap:         12px;
  flex-shrink: 0;
}

/* Notification button */
.dash-notif-btn {
  position:      relative;
  background:    none;
  border:        1.5px solid var(--border);
  border-radius: var(--r);
  width:         38px;
  height:        38px;
  display:       flex;
  align-items:   center;
  justify-content: center;
  cursor:        pointer;
  color:         var(--muted);
  transition:    border-color .18s, color .18s, background .18s;
  padding:       0;
}

.dash-notif-btn:hover,
.dash-notif-btn.show {
  border-color: var(--teal);
  color:        var(--navy);
  background:   var(--teal-soft);
}

.dash-notif-badge {
  position:      absolute;
  top:           -4px;
  left:          -4px;
  background:    #dc2626;
  color:         #fff;
  font-size:     10px;
  font-weight:   800;
  min-width:     17px;
  height:        17px;
  border-radius: 10px;
  display:       flex;
  align-items:   center;
  justify-content: center;
  padding:       0 4px;
  line-height:   1;
  border:        2px solid var(--surface);
}

/* Notification dropdown */
.dash-notif-dropdown {
  min-width:     320px;
  max-height:    400px;
  overflow-y:    auto;
  padding:       0;
  border:        1.5px solid var(--border);
  border-radius: var(--r-card);
  box-shadow:    var(--shadow-lg);
  font-family:   var(--font);
}

.dash-notif-dropdown .dropdown-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         12px 16px;
  font-size:       13px;
  font-weight:     800;
  color:           var(--navy);
  border-bottom:   1px solid var(--border);
  background:      var(--bg);
  position:        sticky;
  top:             0;
}

.notif-count-badge {
  background:    var(--teal-soft);
  color:         var(--navy);
  font-size:     11px;
  font-weight:   700;
  padding:       2px 8px;
  border-radius: var(--r-badge);
  border:        1px solid var(--teal);
}

.dash-notif-dropdown .dropdown-item {
  display:       block;
  padding:       10px 16px;
  border-bottom: 1px solid var(--border-soft);
  transition:    background .14s;
  cursor:        pointer;
}

.dash-notif-dropdown .dropdown-item:hover {
  background: var(--teal-soft);
}

.dash-notif-dropdown .dropdown-item.notif-unread {
  background: #f0f9ff;
  border-right: 3px solid var(--teal);
}

.notif-drop-title {
  display:     block;
  font-size:   13px;
  font-weight: 600;
  color:       var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow:    hidden;
  text-overflow: ellipsis;
}

.notif-drop-time {
  display:   block;
  font-size: 11px;
  color:     var(--muted-soft);
}

.notif-empty {
  display:     block;
  text-align:  center;
  padding:     24px 16px;
  font-size:   13px;
  color:       var(--muted-soft);
}

/* User info */
.dash-user {
  display:     flex;
  align-items: center;
  gap:         10px;
  cursor:      default;
}

.dash-user-avatar {
  width:          38px;
  height:         38px;
  border-radius:  50%;
  background:     linear-gradient(135deg, var(--navy), var(--teal-mid));
  color:          #fff;
  font-size:      15px;
  font-weight:    800;
  display:        flex;
  align-items:    center;
  justify-content: center;
  flex-shrink:    0;
}

.dash-user-info { line-height: 1.3; }

.dash-user-name {
  font-size:   13.5px;
  font-weight: 700;
  color:       var(--text);
}

.dash-user-meta {
  font-size: 11px;
  color:     var(--muted);
}

/* ──────────────────────────────────────────────────────────────
   6. Content Area
   ────────────────────────────────────────────────────────────── */
.dash-content {
  flex:    1;
  padding: 24px 28px;
}

.dash-page { direction: rtl; }

.h-title {
  margin:      0 0 4px;
  font-size:   20px;
  font-weight: 900;
  color:       var(--navy);
}

.h-sub {
  margin:    0 0 22px;
  font-size: 13.5px;
  color:     var(--muted);
}

/* ──────────────────────────────────────────────────────────────
   7. Stats Cards
   ────────────────────────────────────────────────────────────── */
.cards {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap:                   14px;
  margin-bottom:         22px;
}

.card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--r-card);
  padding:       18px 20px;
  box-shadow:    var(--shadow-sm);
  transition:    box-shadow .18s, transform .18s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform:  translateY(-1px);
}

.card-head {
  padding:       18px 20px;
  border-bottom: 1px solid var(--border);
  display:       flex;
  align-items:   flex-start;
  gap:           12px;
}

.card-body {
  padding: 20px;
}

.card-label {
  font-size:   12px;
  font-weight: 600;
  color:       var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.card-value {
  font-size:   26px;
  font-weight: 900;
  color:       var(--navy);
  line-height: 1;
}

/* ──────────────────────────────────────────────────────────────
   8. Panels
   ────────────────────────────────────────────────────────────── */
.panel {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow:    var(--shadow-sm);
  overflow:      hidden;
}

.panel-head {
  display:         flex;
  align-items:     flex-start;
  justify-content: space-between;
  gap:             12px;
  padding:         16px 20px;
  border-bottom:   1px solid var(--border);
  background:      var(--bg);
}

.panel-title {
  font-size:   14px;
  font-weight: 800;
  color:       var(--navy);
  margin:      0;
  display:     flex;
  align-items: center;
}

.panel-sub {
  font-size:  12px;
  color:      var(--muted);
  margin-top: 3px;
}

.panel-actions {
  display:     flex;
  gap:         8px;
  flex-shrink: 0;
}

.highlight {
  padding: 14px 20px;
  display: flex;
  gap:     10px;
  flex-wrap: wrap;
}

/* ──────────────────────────────────────────────────────────────
   9. Tables
   ────────────────────────────────────────────────────────────── */
.table {
  width:           100%;
  border-collapse: separate;
  border-spacing:  0;
  font-size:       13.5px;
}

.table th {
  padding:        11px 14px;
  background:     var(--bg);
  font-weight:    700;
  font-size:      12px;
  color:          var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom:  2px solid var(--border);
  white-space:    nowrap;
}

.table td {
  padding:        12px 14px;
  border-bottom:  1px solid var(--border-soft);
  color:          var(--text);
  vertical-align: middle;
}

.table tbody tr:hover td {
  background: #f8fafc;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Responsive table wrapper */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ──────────────────────────────────────────────────────────────
   10. Buttons
   ────────────────────────────────────────────────────────────── */
.btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             6px;
  padding:         10px 18px;
  border-radius:   var(--r);
  font-family:     var(--font);
  font-size:       14px;
  font-weight:     700;
  cursor:          pointer;
  border:          none;
  transition:      background .18s, transform .15s, box-shadow .18s;
  text-decoration: none;
  white-space:     nowrap;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background:  linear-gradient(135deg, var(--navy), #2d3d7a);
  color:       #fff;
  box-shadow:  0 2px 8px rgba(31,43,91,.25);
}
.btn-primary:hover {
  background:  linear-gradient(135deg, var(--navy-hover), var(--navy));
  box-shadow:  0 4px 16px rgba(31,43,91,.3);
  color:       #fff;
}

.btn-soft {
  background:  var(--bg);
  color:       var(--navy);
  border:      1.5px solid var(--border);
}
.btn-soft:hover {
  background:  var(--teal-soft);
  border-color: var(--teal);
  color:       var(--navy);
}

.btn-teal {
  background: var(--teal);
  color:      var(--navy);
  font-weight: 800;
}
.btn-teal:hover {
  background: var(--teal-mid);
  color:      var(--navy);
}

.btn-danger {
  background: var(--danger-bg);
  color:      var(--danger);
  border:     1.5px solid rgba(220,38,38,.2);
}
.btn-danger:hover {
  background: var(--danger);
  color:      #fff;
}

.btn-sm {
  padding:   7px 13px;
  font-size: 13px;
}

.btn-xs {
  padding:   5px 10px;
  font-size: 12px;
}

.btn svg { flex-shrink: 0; }

/* ──────────────────────────────────────────────────────────────
   11. Forms & Inputs
   ────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-group label,
label {
  display:       block;
  font-size:     13.5px;
  font-weight:   600;
  color:         var(--text);
  margin-bottom: 6px;
}

.form-required {
  color:      var(--danger);
  margin-right: 2px;
}

.form-hint {
  font-size:  12px;
  color:      var(--muted);
  margin-top: 5px;
  display:    block;
}

.input,
input.input,
select.input,
textarea.input {
  width:         100%;
  padding:       9px 13px;
  border:        1.5px solid var(--border);
  border-radius: var(--r);
  font-family:   var(--font);
  font-size:     13.5px;
  color:         var(--text);
  background:    var(--surface);
  outline:       none;
  transition:    border-color .18s, box-shadow .18s;
  direction:     rtl;
}

.input:focus,
input.input:focus,
select.input:focus {
  border-color: var(--teal);
  box-shadow:   0 0 0 3px rgba(120,209,225,.18);
}

.input.error {
  border-color: var(--danger) !important;
  box-shadow:   0 0 0 3px rgba(220,38,38,.12) !important;
}

select.input {
  cursor: pointer;
  appearance: auto;
}

.row2 {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   16px;
}

.row3 {
  display:               grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:                   16px;
}

/* Password */
.pw-wrap {
  position: relative;
}

.pw-toggle {
  position:   absolute;
  left:       10px;
  top:        50%;
  transform:  translateY(-50%);
  border:     none;
  background: transparent;
  cursor:     pointer;
  font-size:  16px;
  color:      var(--muted);
  padding:    6px 8px;
}

/* ──────────────────────────────────────────────────────────────
   12. Status Badges
   ────────────────────────────────────────────────────────────── */
.badge {
  display:       inline-flex;
  align-items:   center;
  gap:           5px;
  padding:       4px 10px;
  border-radius: var(--r-badge);
  font-size:     12px;
  font-weight:   700;
  white-space:   nowrap;
}

.badge-dot {
  width:         6px;
  height:        6px;
  border-radius: 50%;
  flex-shrink:   0;
}

/* Status colours */
.st-draft     { background: #f1f5f9; color: #475569; }
.st-submitted { background: var(--warning-bg); color: #92400e; }
.st-approved  { background: var(--success-bg); color: #065f46; }
.st-signed    { background: var(--purple-bg);  color: #4c1d95; }

/* ──────────────────────────────────────────────────────────────
   13. Contract Action Buttons
   ────────────────────────────────────────────────────────────── */
.ct-btn {
  display:         inline-flex;
  align-items:     center;
  gap:             6px;
  padding:         7px 14px;
  border-radius:   var(--r);
  font-family:     var(--font);
  font-size:       13px;
  font-weight:     700;
  cursor:          pointer;
  border:          1.5px solid transparent;
  transition:      all .18s;
  text-decoration: none;
  white-space:     nowrap;
}

.ct-btn:hover { transform: translateY(-1px); }

.ct-btn-view    { background: var(--teal-soft);  color: var(--navy);   border-color: var(--teal); }
.ct-btn-edit    { background: var(--info-bg);    color: #1e40af;       border-color: #bfdbfe; }
.ct-btn-pdf     { background: #f1f5f9;           color: #475569;       border-color: var(--border); }
.ct-btn-approve { background: var(--success-bg); color: #065f46;       border-color: #a7f3d0; }
.ct-btn-sign    { background: var(--purple-bg);  color: #4c1d95;       border-color: #ddd6fe; }
.ct-btn-delete  { background: var(--danger-bg);  color: #991b1b;       border-color: #fecaca; }
.ct-btn-submit  { background: var(--warning-bg); color: #92400e;       border-color: #fde68a; }

.ct-btn-view:hover    { background: var(--teal);       color: var(--navy); }
.ct-btn-edit:hover    { background: var(--info);       color: #fff; }
.ct-btn-approve:hover { background: var(--success);    color: #fff; }
.ct-btn-sign:hover    { background: var(--purple);     color: #fff; }
.ct-btn-delete:hover  { background: var(--danger);     color: #fff; }

/* ──────────────────────────────────────────────────────────────
   14. Notification Dropdown (topbar)  — see also section 5
   ────────────────────────────────────────────────────────────── */
/* (styles already in section 5 under .dash-notif-*) */

/* ──────────────────────────────────────────────────────────────
   15. Notifications Page
   ────────────────────────────────────────────────────────────── */
.notif-list {
  list-style: none;
  margin:     0;
  padding:    0;
}

.notif {
  display:       flex;
  align-items:   flex-start;
  gap:           12px;
  padding:       14px 20px;
  border-bottom: 1px solid var(--border-soft);
  transition:    background .14s;
}

.notif:last-child { border-bottom: none; }

.notif:hover { background: var(--bg); }

.notif-unread { background: #f0f9ff; }
.notif-unread:hover { background: #e0f2fe; }

/* Avatar */
.notif-avatar {
  width:         38px;
  height:        38px;
  border-radius: 50%;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     17px;
  flex-shrink:   0;
}

.av-teal   { background: var(--teal-soft);    border: 1.5px solid var(--teal); }
.av-amber  { background: var(--warning-bg);   border: 1.5px solid #fde68a; }
.av-green  { background: var(--success-bg);   border: 1.5px solid #a7f3d0; }
.av-purple { background: var(--purple-bg);    border: 1.5px solid #ddd6fe; }

/* Content */
.notif-body  { flex: 1; min-width: 0; }

.notif-title {
  font-size:   14px;
  color:       var(--text);
  white-space: nowrap;
  overflow:    hidden;
  text-overflow: ellipsis;
  display:     block;
}

.notif-msg {
  font-size:  13px;
  color:      var(--muted);
  margin-top: 3px;
  display:    block;
}

.notif-footer {
  display:     flex;
  align-items: center;
  gap:         8px;
  margin-top:  6px;
}

.notif-time {
  font-size:   11.5px;
  color:       var(--muted-soft);
  display:     inline-flex;
  align-items: center;
  gap:         4px;
}

/* ──────────────────────────────────────────────────────────────
   16. Pagination
   ────────────────────────────────────────────────────────────── */
.pagination-wrap {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  flex-wrap:       wrap;
  gap:             12px;
  padding:         14px 20px;
  border-top:      1px solid var(--border);
}

.pagination-info {
  font-size: 13px;
  color:     var(--muted);
}

.pagination {
  display: flex;
  gap:     4px;
}

.page-btn {
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           34px;
  height:          34px;
  border-radius:   var(--r);
  font-size:       13px;
  font-weight:     600;
  border:          1.5px solid var(--border);
  background:      var(--surface);
  color:           var(--text);
  cursor:          pointer;
  text-decoration: none;
  transition:      all .15s;
  font-family:     var(--font);
}

.page-btn:hover {
  border-color: var(--teal);
  background:   var(--teal-soft);
  color:        var(--navy);
}

.page-btn.active {
  background:   var(--navy);
  border-color: var(--navy);
  color:        #fff;
}

.page-btn.disabled {
  opacity: .4;
  cursor:  not-allowed;
  pointer-events: none;
}

/* ──────────────────────────────────────────────────────────────
   17. Breadcrumb
   ────────────────────────────────────────────────────────────── */
.breadcrumb-wrap {
  display:     flex;
  align-items: center;
  gap:         8px;
  flex-wrap:   wrap;
  margin-bottom: 8px;
}

.bc-item {
  display:     flex;
  align-items: center;
  gap:         8px;
  font-size:   13px;
  color:       var(--muted);
}

.bc-item a {
  color:      var(--muted);
  transition: color .15s;
}
.bc-item a:hover { color: var(--navy); }

.bc-sep {
  color: var(--muted-soft);
  line-height: 1;
}

.bc-link-btn {
  display:     inline-flex;
  align-items: center;
  gap:         6px;
  padding:     7px 13px;
  border-radius: var(--r);
  font-size:   13px;
  font-weight: 700;
  background:  var(--bg);
  border:      1.5px solid var(--border);
  color:       var(--navy);
  cursor:      pointer;
  text-decoration: none;
  transition:  all .15s;
}

.bc-link-btn:hover {
  background:  var(--teal-soft);
  border-color: var(--teal);
  color:       var(--navy);
}

/* ──────────────────────────────────────────────────────────────
   18. Alerts
   ────────────────────────────────────────────────────────────── */
.alert {
  display:       flex;
  align-items:   flex-start;
  gap:           10px;
  padding:       13px 16px;
  border-radius: var(--r-card);
  font-size:     13.5px;
  margin-bottom: 16px;
  font-family:   var(--font);
}

.alert svg { flex-shrink: 0; margin-top: 1px; }

.alert-danger {
  background:   var(--danger-bg);
  border:       1px solid rgba(220,38,38,.25);
  color:        #991b1b;
}

.alert-success {
  background:   var(--success-bg);
  border:       1px solid rgba(16,185,129,.25);
  color:        #065f46;
}

.alert-warning {
  background:   var(--warning-bg);
  border:       1px solid rgba(245,158,11,.25);
  color:        #92400e;
}

.alert-info {
  background:   var(--info-bg);
  border:       1px solid rgba(59,130,246,.2);
  color:        #1e40af;
}

/* ──────────────────────────────────────────────────────────────
   19. Footer
   ────────────────────────────────────────────────────────────── */
.dash-footer {
  background:    var(--navy);
  color:         rgba(255,255,255,.75);
  font-size:     13px;
  flex-shrink:   0;
}

.dash-footer-inner {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   32px;
  padding:               28px 32px;
  max-width:             none;
}

.footer-brand-name {
  font-size:   15px;
  font-weight: 800;
  color:       #fff;
  margin-bottom: 4px;
}

.footer-brand-sub {
  font-size: 12px;
  color:     rgba(255,255,255,.55);
}

.footer-logo {
  height:        42px;
  border-radius: 6px;
  margin-bottom: 10px;
  object-fit:    contain;
}

.footer-address {
  display:     flex;
  align-items: center;
  gap:         5px;
  margin-top:  8px;
  font-size:   12px;
  color:       rgba(255,255,255,.55);
}

.footer-contact-item {
  display:     flex;
  align-items: center;
  gap:         6px;
  font-size:   12.5px;
  color:       rgba(255,255,255,.6);
  text-decoration: none;
  margin-bottom: 4px;
  transition:  color .15s;
}
.footer-contact-item:hover { color: var(--teal); }

.footer-social {
  display: flex;
  gap:     8px;
  margin-top: 10px;
}

.social-btn {
  width:         32px;
  height:        32px;
  border-radius: 8px;
  border:        1px solid rgba(255,255,255,.15);
  display:       flex;
  align-items:   center;
  justify-content: center;
  color:         rgba(255,255,255,.55);
  transition:    background .15s, color .15s, border-color .15s;
  text-decoration: none;
}
.social-btn:hover {
  background:   var(--teal);
  color:        var(--navy);
  border-color: var(--teal);
}

.footer-bottom {
  padding:      12px 32px;
  border-top:   1px solid rgba(255,255,255,.08);
  font-size:    12px;
  color:        rgba(255,255,255,.4);
  display:      flex;
  align-items:  center;
  justify-content: space-between;
  flex-wrap:    wrap;
  gap:          8px;
}

/* ──────────────────────────────────────────────────────────────
   20. Mobile Sidebar Toggle
   ────────────────────────────────────────────────────────────── */
.sidebar-toggle {
  display:        none;
  align-items:    center;
  justify-content: center;
  flex-direction: column;
  gap:            5px;
  width:          42px;
  height:         42px;
  border:         1.5px solid var(--border);
  border-radius:  var(--r);
  background:     var(--surface);
  cursor:         pointer;
  position:       fixed;
  top:            10px;
  right:          12px;
  z-index:        200;
}

.sidebar-toggle span {
  display:         block;
  width:           20px;
  height:          2px;
  background:      var(--navy);
  border-radius:   2px;
  transition:      transform .25s;
}

.sidebar-overlay {
  display:    none;
  position:   fixed;
  inset:      0;
  background: rgba(0,0,0,.4);
  z-index:    150;
  /* backdrop-filter removed — causes rendering issues on mobile */
}
.sidebar-overlay.active { display: block; }

/* ──────────────────────────────────────────────────────────────
   21. Responsive — Mobile / Tablet / Laptop / Large Screen
   ────────────────────────────────────────────────────────────── */

/* ── LARGE SCREENS: 1400px+ ── */
@media (min-width: 1400px) {
  :root { --sidebar-w: 260px; }
  .dash-content  { padding: 28px 32px; max-width: 1400px; }
  .cards         { grid-template-columns: repeat(6, 1fr); }
}

/* ── STANDARD LAPTOP/DESKTOP: 1025px – 1399px ── */
@media (min-width: 1025px) and (max-width: 1399px) {
  :root { --sidebar-w: 248px; }
  .dash-content  { padding: 24px 28px; }
  .cards         { grid-template-columns: repeat(4, 1fr); }
}

/* ── TABLET LANDSCAPE: 769px – 1024px ── */
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-w: 220px; }

  .dash-content  { padding: 18px 20px; }

  /* Sidebar slightly narrower but still visible */
  .dash-side {
    width:     220px !important;
    min-width: 220px !important;
  }

  /* Hide text labels in nav links, show only icons */
  .dash-brand-text { display: none; }
  .dash-brand      { justify-content: center; padding: 16px 12px; }
  .dash-logo       { width: 36px; height: 36px; }

  .cards { grid-template-columns: repeat(3, 1fr); }
  .row2  { grid-template-columns: 1fr 1fr; }
  .row3  { grid-template-columns: 1fr 1fr 1fr; }

  .cl-header { flex-direction: row; }
}

/* ── MOBILE: ≤ 768px ── */
@media (max-width: 768px) {
  /* Show hamburger */
  .sidebar-toggle { display: flex; }

  /* ✅ FIX 3: Sidebar hidden off-screen by default on mobile */
  .dash-side {
    position:   fixed      !important;
    /* RTL: panel slides in from right */
    right:      -300px     !important;
    left:       auto       !important;
    top:        0          !important;
    height:     100vh      !important;
    width:      280px      !important;
    min-width:  280px      !important;
    transition: right .28s cubic-bezier(.4,0,.2,1);
    z-index:    310        !important;
    box-shadow: -4px 0 24px rgba(0,0,0,.25);
  }

  /* Visible when open */
  .dash-side.open {
    right: 0 !important;
  }

  .sidebar-close { display: flex; }

  /* Main layout becomes single column */
  .dash-wrap {
    flex-direction: column !important;
  }

  /* Space for the fixed hamburger button */
  .dash-main {
    padding-top: 0 !important;
    min-height:  100vh;
  }

  /* Topbar adjustments */
  .dash-top {
    height:     auto;
    min-height: 56px;
    padding:    10px 52px 10px 16px; /* room for hamburger */
    gap:        8px;
  }

  /* Content padding */
  .dash-content { padding: 14px 14px 20px; }

  /* Cards: 2 per row */
  .cards { grid-template-columns: 1fr 1fr; }

  /* Forms: single column */
  .row2, .row3 { grid-template-columns: 1fr; }

  /* Table scrolls horizontally */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table      { min-width: 560px; }

  /* Footer */
  .dash-footer-inner { grid-template-columns: 1fr; gap: 18px; }
  .footer-bottom     { text-align: center; flex-direction: column; }

  /* Pagination */
  .pagination-wrap { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Contract list adjustments */
  .cl-header { flex-direction: column; gap: 10px; }
  .cl-toolbar { flex-direction: column; gap: 8px; }
  .cl-search  { max-width: 100%; }
}

/* ── SMALL MOBILE: ≤ 480px ── */
@media (max-width: 480px) {
  .cards      { grid-template-columns: 1fr; }
  .ct-btn-row { gap: 6px; }
  .dash-top   { padding: 10px 50px 10px 12px; }

  .cv-actions  { gap: 6px; }
  .ct-btn      { font-size: 12px; padding: 6px 10px; }

  /* Profile grid: stack on small screens */
  .profile-grid { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────────────────────────
   22. Contracts List (cl-* components)
   ────────────────────────────────────────────────────────────── */
.cl-page { direction: rtl; }

.cl-header {
  display:         flex;
  align-items:     flex-start;
  justify-content: space-between;
  flex-wrap:       wrap;
  gap:             12px;
  margin-bottom:   20px;
}

.cl-title {
  font-size:   20px;
  font-weight: 900;
  color:       var(--navy);
  margin:      0 0 4px;
}

.cl-subtitle {
  font-size: 13px;
  color:     var(--muted);
  margin:    0;
}

.cl-btn-add {
  display:     inline-flex;
  align-items: center;
  gap:         7px;
  padding:     9px 18px;
  border-radius: var(--r);
  background:  var(--navy);
  color:       #fff;
  font-size:   13.5px;
  font-weight: 800;
  text-decoration: none;
  transition:  background .18s, transform .15s;
}
.cl-btn-add:hover {
  background: var(--navy-hover);
  color:      #fff;
  transform:  translateY(-1px);
}

/* Summary cards */
.cl-summary {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap:                   12px;
  margin-bottom:         20px;
}

.cl-sum-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--r-card);
  padding:       14px 16px;
  display:       flex;
  align-items:   center;
  gap:           12px;
  box-shadow:    var(--shadow-sm);
}

.cl-sum-icon {
  width:         38px;
  height:        38px;
  border-radius: var(--r);
  display:       flex;
  align-items:   center;
  justify-content: center;
  flex-shrink:   0;
}

.cl-sum-total   { background: var(--teal-soft);   color: var(--navy); }
.cl-sum-pending { background: var(--warning-bg);  color: #92400e; }
.cl-sum-approved{ background: var(--success-bg);  color: #065f46; }
.cl-sum-signed  { background: var(--purple-bg);   color: #4c1d95; }

.cl-sum-info {
  display:        flex;
  flex-direction: column;
  gap:            2px;
  min-width:      0;
}

.cl-sum-num {
  font-size:   22px;
  font-weight: 900;
  color:       var(--navy);
  line-height: 1;
}

.cl-sum-lbl {
  font-size:   11.5px;
  color:       var(--muted);
  white-space: nowrap;
  overflow:    hidden;
  text-overflow: ellipsis;
}

/* Toolbar */
.cl-toolbar {
  display:     flex;
  align-items: center;
  gap:         10px;
  flex-wrap:   wrap;
  padding:     14px 20px;
  border-bottom: 1px solid var(--border);
  background:  var(--bg);
}

.cl-search-wrap {
  position:  relative;
  flex:      1;
  min-width: 180px;
}

.cl-search-icon {
  position:  absolute;
  right:     11px;
  top:       50%;
  transform: translateY(-50%);
  color:     var(--muted-soft);
  pointer-events: none;
}

.cl-search {
  width:         100%;
  padding:       8px 36px 8px 12px;
  border:        1.5px solid var(--border);
  border-radius: var(--r);
  font-family:   var(--font);
  font-size:     13.5px;
  color:         var(--text);
  background:    var(--surface);
  outline:       none;
  transition:    border-color .18s;
}
.cl-search:focus { border-color: var(--teal); }

.cl-filter {
  padding:       8px 13px;
  border:        1.5px solid var(--border);
  border-radius: var(--r);
  font-family:   var(--font);
  font-size:     13.5px;
  color:         var(--text);
  background:    var(--surface);
  cursor:        pointer;
  outline:       none;
}
.cl-filter:focus { border-color: var(--teal); }

/* Table customer cell */
.cl-customer-avatar {
  width:         34px;
  height:        34px;
  border-radius: 50%;
  background:    var(--teal-soft);
  border:        1.5px solid var(--teal);
  color:         var(--navy);
  font-size:     14px;
  font-weight:   800;
  display:       inline-flex;
  align-items:   center;
  justify-content: center;
  flex-shrink:   0;
}

.cl-contract-id {
  font-size:   12px;
  font-weight: 700;
  color:       var(--muted);
}

.cl-actions {
  display:  flex;
  gap:      6px;
  flex-wrap: wrap;
}

.cl-btn-view   { background: var(--teal-soft);  color: var(--navy); }
.cl-btn-edit   { background: var(--info-bg);    color: #1e40af; }
.cl-btn-delete { background: var(--danger-bg);  color: #991b1b; }

.cl-btn-view,
.cl-btn-edit,
.cl-btn-delete {
  padding:       5px 11px;
  border-radius: var(--r);
  font-size:     12.5px;
  font-weight:   700;
  text-decoration: none;
  border:        1.5px solid transparent;
  transition:    all .15s;
}
.cl-btn-view:hover   { background: var(--teal);    color: var(--navy); }
.cl-btn-edit:hover   { background: var(--info);    color: #fff; }
.cl-btn-delete:hover { background: var(--danger);  color: #fff; }

/* Empty states */
.cl-empty,
.cl-no-results {
  text-align: center;
  padding:    56px 24px;
  color:      var(--muted-soft);
}

.cl-empty-icon { font-size: 40px; margin-bottom: 12px; }

.cl-empty-title {
  font-size:   15px;
  font-weight: 700;
  color:       var(--muted);
  margin-bottom: 6px;
}

.cl-empty-sub { font-size: 13px; }

/* ──────────────────────────────────────────────────────────────
   23. Contract View Page (cv-* components)
   ────────────────────────────────────────────────────────────── */

/* Header row inside card-head */
.cv-header-row {
  display:         flex;
  align-items:     flex-start;
  justify-content: space-between;
  flex-wrap:       wrap;
  gap:             12px;
  width:           100%;
}

.cv-info { flex: 1; min-width: 0; }

.cv-contract-type {
  margin:      0 0 6px;
  font-size:   17px;
  font-weight: 900;
  color:       var(--navy);
}

.cv-meta {
  font-size:   13px;
  color:       var(--muted);
  line-height: 2;
}

.cv-meta-val {
  color:       var(--navy);
  font-weight: 700;
}

/* Actions row */
.cv-actions {
  display:   flex;
  gap:       8px;
  flex-wrap: wrap;
  margin:    16px 20px;
}

/* Signed badge */
.cv-signed-badge {
  display:     inline-flex;
  align-items: center;
  gap:         5px;
  font-size:   13px;
  font-weight: 700;
  color:       #065f46;
  padding:     7px 12px;
  background:  var(--success-bg);
  border-radius: var(--r);
}

/* Body */
.cv-body { padding: 0 4px 20px; }

.cv-empty {
  text-align:  center;
  padding:     32px;
  color:       var(--muted-soft);
  font-size:   14px;
}

/* ──────────────────────────────────────────────────────────────
   24. Form Helpers
   ────────────────────────────────────────────────────────────── */

/* Narrow form (create picker) */
.form-narrow { max-width: 480px; }

/* Form actions bar */
.form-actions {
  display:    flex;
  gap:        10px;
  flex-wrap:  wrap;
  margin-top: 16px;
}

/* Form divider (replaces <hr style=...>) */
.form-divider {
  height:     1px;
  background: var(--border);
  margin:     18px 0;
  opacity:    .6;
}

/* ──────────────────────────────────────────────────────────────
   25. Panel Utilities
   ────────────────────────────────────────────────────────────── */

/* Panel with top margin (replaces style="margin-top:18px;") */
.panel-mt { margin-top: 18px; }

/* Action button wrapper inside panel */
.panel-action-wrap {
  padding: 0 20px 14px;
}

/* Panel empty state */
.panel-empty {
  padding:   20px 20px;
  color:     var(--muted-soft);
  font-size: 13px;
}

/* ──────────────────────────────────────────────────────────────
   26. Table Utilities
   ────────────────────────────────────────────────────────────── */

/* Empty cell (replaces style="text-align:center; padding:18px; color:#94a3b8;") */
.td-empty {
  text-align: center;
  padding:    20px 14px;
  color:      var(--muted-soft);
  font-size:  13px;
}

/* ──────────────────────────────────────────────────────────────
   27. Highlight Section
   ────────────────────────────────────────────────────────────── */

.highlight-title {
  font-size:   14px;
  font-weight: 700;
  color:       var(--navy);
  margin-bottom: 4px;
}

.highlight-sub {
  font-size: 12.5px;
  color:     var(--muted);
}

/* ──────────────────────────────────────────────────────────────
   28. Employees Page (emp-* components)
   ────────────────────────────────────────────────────────────── */

.emp-cell {
  display:     flex;
  align-items: center;
  gap:         10px;
}

.emp-avatar {
  width:         36px;
  height:        36px;
  border-radius: 50%;
  background:    var(--navy);
  color:         #fff;
  font-size:     14px;
  font-weight:   700;
  display:       flex;
  align-items:   center;
  justify-content: center;
  flex-shrink:   0;
  font-family:   var(--font);
}

.emp-name {
  font-weight: 600;
  font-size:   14px;
  color:       var(--navy);
}

.emp-email {
  font-size: 13px;
  color:     var(--muted);
}

.emp-actions {
  display:     flex;
  align-items: center;
  gap:         6px;
  flex-wrap:   wrap;
}

/* Small select inside table */
.input-sm {
  padding:   5px 8px;
  font-size: 12px;
  height:    32px;
}

/* ──────────────────────────────────────────────────────────────
   29. Notifications Full Page
   ────────────────────────────────────────────────────────────── */

.notif-full .notif {
  position:     relative;
  border-bottom: 1px solid var(--border);
  padding:       14px 16px;
  transition:    background .15s;
}

.notif-full .notif:last-child { border-bottom: none; }

.notif-full .notif:hover { background: var(--bg); }

.notif-unread-row { background: rgba(31,43,91,.03); }

.notif-dot {
  position:      absolute;
  top:           18px;
  left:          16px;
  width:         8px;
  height:        8px;
  border-radius: 50%;
  background:    var(--teal);
}

.notif-link {
  font-size:   12px;
  color:       var(--teal-dark, var(--navy));
  font-weight: 600;
  text-decoration: none;
  display:     inline-flex;
  align-items: center;
  gap:         3px;
}
.notif-link:hover { text-decoration: underline; }

/* ──────────────────────────────────────────────────────────────
   30. Profile Page
   ────────────────────────────────────────────────────────────── */

.profile-grid {
  display:               grid;
  grid-template-columns: 260px 1fr;
  gap:                   24px;
  align-items:           start;
}

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
}

.profile-card-id {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--r-card);
  padding:       28px 20px;
  text-align:    center;
  box-shadow:    var(--shadow-sm);
}

.profile-avatar-lg {
  width:           72px;
  height:          72px;
  border-radius:   50%;
  background:      var(--navy);
  color:           #fff;
  font-size:       26px;
  font-weight:     800;
  display:         flex;
  align-items:     center;
  justify-content: center;
  margin:          0 auto 12px;
  font-family:     var(--font);
}

.profile-name-lg {
  font-size:   16px;
  font-weight: 800;
  color:       var(--navy);
  margin-bottom: 8px;
}

.profile-role-lg {
  margin-bottom: 16px;
}

.profile-meta-item {
  display:     flex;
  align-items: center;
  justify-content: center;
  gap:         6px;
  font-size:   13px;
  color:       var(--muted);
  margin-top:  8px;
  word-break:  break-all;
}

.profile-forms { min-width: 0; }

/* Form hint text */
.form-hint {
  display:    block;
  font-size:  12px;
  color:      var(--muted-soft);
  margin-top: 4px;
}

/* Info rows (approve confirm page) */
.info-row {
  display:        flex;
  flex-direction: column;
  gap:            2px;
}
.info-label {
  font-size:  12px;
  color:      var(--muted);
  font-weight: 500;
}
.info-val {
  font-size:   14px;
  font-weight: 700;
  color:       var(--navy);
}

/* ──────────────────────────────────────────────────────────────
   31. Hijri Date Picker (Date fields styling)
   ────────────────────────────────────────────────────────────── */

.hijri-field-group {
  display:     flex;
  align-items: stretch;
  border:      1.5px solid var(--border);
  border-radius: var(--r);
  overflow:    hidden;
  background:  var(--surface);
  transition:  border-color .18s;
}

.hijri-field-group:focus-within {
  border-color: var(--navy);
  box-shadow:   0 0 0 3px rgba(31,43,91,.08);
}

.hijri-field-group .hf-input {
  flex:        1;
  border:      none;
  outline:     none;
  background:  transparent;
  font-family: var(--font);
  font-size:   14px;
  color:       var(--text);
  padding:     10px 10px;
  text-align:  center;
  min-width:   0;
  direction:   ltr;
}

.hijri-field-group .hf-sep {
  display:     flex;
  align-items: center;
  color:       var(--muted-soft);
  font-size:   16px;
  padding:     0 2px;
  user-select: none;
}

.hijri-field-group .hf-icon {
  display:     flex;
  align-items: center;
  padding:     0 10px 0 8px;
  color:       var(--muted);
  cursor:      pointer;
}

/* Nationality dropdown */
.nationality-select-wrap {
  position: relative;
}

.nationality-search {
  padding:    9px 36px 9px 12px;
  width:      100%;
}


/* ── Nav badge (إشعارات غير مقروءة في السايدبار) ── */
.nav-badge {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  min-width:       18px;
  height:          18px;
  padding:         0 5px;
  border-radius:   9px;
  background:      var(--teal);
  color:           var(--navy);
  font-size:       11px;
  font-weight:     800;
  margin-right:    auto;
  line-height:     1;
}

/* ──────────────────────────────────────────────────────────────
   32. Hijri Date Picker — Simple Grid Layout (replaces complex flex)
   ────────────────────────────────────────────────────────────── */

.hijri-row {
  display:               grid;
  grid-template-columns: 1fr 2fr 1.2fr;
  gap:                   8px;
  align-items:           end;
}

.hijri-col {
  display:        flex;
  flex-direction: column;
  gap:            4px;
}

.hijri-sub-label {
  font-size:   11.5px;
  color:       var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

/* Read-only end date inputs */
.input-readonly {
  background: var(--bg)    !important;
  color:      var(--muted) !important;
  cursor:     default;
}

/* ── نسبة الأرباح — input مع suffix % ── */
.input-suffix-wrap {
  position: relative;
  display:  flex;
  align-items: stretch;
}

.input-suffix-wrap .input {
  border-radius: var(--r) 0 0 var(--r);
  border-left:   none;
  flex: 1;
  min-width: 0;
}

.input-suffix {
  display:     flex;
  align-items: center;
  padding:     0 12px;
  background:  var(--bg);
  border:      1.5px solid var(--border);
  border-right: none;
  border-radius: 0 var(--r) var(--r) 0;
  font-size:   14px;
  font-weight: 700;
  color:       var(--navy);
  white-space: nowrap;
}

/* ── form-hint-inline ── */
.form-hint-inline {
  font-size:   11.5px;
  color:       var(--muted);
  font-weight: 400;
  margin-right: 4px;
}

/* Mobile: hijri-row stack */
@media (max-width: 480px) {
  .hijri-row {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }
  .hijri-sub-label { font-size: 10.5px; }
}

