@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&family=Tajawal:wght@400;500;700;800;900&display=swap');

/* ==========================================================
   COLOR PALETTE (as specified):
   - Navy Blue  (Primary)   — headers, sidebar, main branding
   - Green      (Success)   — save, confirm, success states
   - Red        (Danger)    — delete, errors, urgent
   - Orange     (Warning)   — pending, in-progress, caution
   - Turquoise  (Accent)    — links, secondary actions, highlights
   ========================================================== */
:root {
  /* ========== PRIMARY PALETTE — polished & modern ========== */
  --navy:          #0b2b4a;   /* deep royal navy */
  --navy-light:    #1e4976;
  --navy-dark:     #061a2e;
  --navy-soft:     #2c5f8d;   /* friendly mid-navy for hovers */

  --green:         #10b981;   /* emerald */
  --green-light:   #34d399;
  --green-dark:    #059669;

  --red:           #e11d48;   /* rose-red, more elegant than fire-red */
  --red-light:     #f43f5e;
  --red-dark:      #be123c;

  --orange:        #f59e0b;   /* amber — warmer than pure orange */
  --orange-light:  #fbbf24;
  --orange-dark:   #d97706;

  --turquoise:     #0891b2;   /* rich teal-cyan */
  --turquoise-light:#06b6d4;
  --turquoise-alt: #22d3ee;   /* pop accent for highlights */

  /* Semantic aliases */
  --primary:       var(--navy);
  --primary-light: var(--navy-light);
  --accent:        var(--turquoise);
  --ok:            var(--green);
  --warn:          var(--orange);
  --bad:           var(--red);
  --info:          var(--turquoise);

  /* Surfaces — very subtle blue tint for easier reading */
  --surface:       #f0f4fa;
  --surface-alt:   #e8eef7;
  --card:          #ffffff;
  --card-soft:     #fafbfd;
  --border:        #dce4f0;
  --border-strong: #c5d0e0;
  --text:          #0f1e33;
  --text-soft:     #334155;
  --muted:         #64748b;
  --muted-light:   #94a3b8;

  /* Gradients */
  --navy-gradient:   linear-gradient(135deg, #0b2b4a 0%, #1e4976 100%);
  --turq-gradient:   linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
  --green-gradient:  linear-gradient(135deg, #059669 0%, #10b981 100%);
  --red-gradient:    linear-gradient(135deg, #be123c 0%, #e11d48 100%);
  --orange-gradient: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  --accent-gradient: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%);

  /* Layout */
  --sw: 260px;
  --radius:    14px;
  --radius-sm:  8px;
  --radius-lg: 18px;

  /* Richer shadows with a hint of navy */
  --shadow-sm: 0 1px 3px rgba(11,43,74,0.06), 0 1px 2px rgba(11,43,74,0.04);
  --shadow-md: 0 4px 6px -1px rgba(11,43,74,0.08), 0 2px 4px -2px rgba(11,43,74,0.05);
  --shadow-lg: 0 10px 25px -5px rgba(11,43,74,0.10), 0 8px 10px -6px rgba(11,43,74,0.05);
  --shadow-xl: 0 20px 50px -12px rgba(11,43,74,0.18);
  --shadow-glow-turq: 0 4px 20px rgba(8,145,178,0.25);
  --shadow-glow-navy: 0 4px 20px rgba(11,43,74,0.30);
}

* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }
body { font-family: 'Cairo','Tajawal', sans-serif; background: var(--surface); color: var(--text); min-height: 100vh; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--turquoise), var(--turquoise-light)); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(var(--navy-soft), var(--turquoise)); }

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn { transition: all 0.2s cubic-bezier(0.4,0,0.2,1); display: inline-flex; align-items: center; gap: 6px;
       padding: 9px 18px; border-radius: 10px; font-family: 'Cairo'; font-weight: 700; font-size: 12px;
       border: none; cursor: pointer; letter-spacing: 0.2px; }
.btn:active { transform: scale(0.96); }
.btn:hover { transform: translateY(-1px); }

.bp  { background: var(--navy-gradient); color: #fff; box-shadow: 0 2px 8px rgba(11,43,74,0.25); }
.bp:hover  { box-shadow: var(--shadow-glow-navy); }

.ba  { background: var(--turq-gradient); color: #fff; box-shadow: 0 2px 8px rgba(8,145,178,0.25); }
.ba:hover  { box-shadow: var(--shadow-glow-turq); }

.bs  { background: var(--green-gradient); color: #fff; box-shadow: 0 2px 8px rgba(16,185,129,0.25); }
.bs:hover  { box-shadow: 0 4px 20px rgba(16,185,129,0.35); }

.bd  { background: var(--red-gradient); color: #fff; box-shadow: 0 2px 8px rgba(225,29,72,0.25); }
.bd:hover  { box-shadow: 0 4px 20px rgba(225,29,72,0.35); }

.bw  { background: var(--orange-gradient); color: #fff; box-shadow: 0 2px 8px rgba(245,158,11,0.25); }
.bw:hover  { box-shadow: 0 4px 20px rgba(245,158,11,0.35); }

.bo  { background: #fff; color: var(--navy); border: 1.5px solid var(--border-strong); }
.bo:hover { border-color: var(--turquoise); color: var(--turquoise); box-shadow: var(--shadow-glow-turq); }

.bwa { background: #25d366; color: #fff; box-shadow: 0 2px 8px rgba(37,211,102,0.25); }
.bsm { padding: 5px 10px; font-size: 11px; border-radius: 8px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ==========================================================
   LOGIN
   ========================================================== */
#loginScreen { position: fixed; inset: 0; background: var(--navy); display: flex; align-items: center;
               justify-content: center; z-index: 9999; overflow: hidden; }
#loginScreen::before { content: ''; position: absolute; width: 600px; height: 600px;
                      background: radial-gradient(circle, rgba(20,184,166,0.15), transparent 70%);
                      top: -200px; right: -200px; border-radius: 50%; }
#loginScreen::after  { content: ''; position: absolute; width: 400px; height: 400px;
                      background: radial-gradient(circle, rgba(20,184,166,0.1), transparent 70%);
                      bottom: -100px; left: -100px; border-radius: 50%; }
.lbox { background: #fff; border-radius: 24px; padding: 44px 38px; width: 90%; max-width: 420px;
        box-shadow: var(--shadow-xl); text-align: center; position: relative; z-index: 1; }
.llogo { width: 72px; height: 72px; background: var(--navy-gradient); border-radius: 18px;
         display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 900;
         color: #fff; margin: 0 auto 20px; box-shadow: 0 8px 20px rgba(10,37,64,0.3); }
.lbox h2 { font-size: 21px; font-weight: 900; color: var(--navy); margin-bottom: 4px; }
.lbox p  { font-size: 12px; color: var(--muted); margin-bottom: 25px; }

.auth-tabs { display: flex; border-radius: 10px; overflow: hidden; border: 1.5px solid var(--border); margin-bottom: 20px; }
.auth-tab  { flex: 1; padding: 9px; border: none; background: #f8fafc; color: var(--muted);
             font-family: 'Cairo'; font-size: 12px; font-weight: 700; cursor: pointer; transition: 0.2s; }
.auth-tab.active { background: var(--navy); color: #fff; }

.lg { margin-bottom: 14px; text-align: right; }
.lg label { font-size: 12px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 6px; }
.lg input, .lg select, .lg textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 16px;
  font-family: 'Cairo', sans-serif; font-size: 13px; outline: none; transition: 0.2s; background: #f8fafc; }
.lg input:focus, .lg select:focus {
  border-color: var(--turquoise); background: #fff; box-shadow: 0 0 0 4px rgba(20,184,166,0.15); }

.lbtn { width: 100%; background: var(--navy-gradient); color: #fff; border: none; border-radius: 12px;
        padding: 14px; font-family: 'Cairo'; font-size: 15px; font-weight: 700; cursor: pointer;
        transition: 0.2s; margin-top: 10px; box-shadow: 0 4px 12px rgba(10,37,64,0.25); }
.lbtn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(10,37,64,0.35); }

.lerr { color: var(--red); font-size: 12px; margin-top: 10px; font-weight: 700; display: none; }
.pass-strength { height: 4px; border-radius: 2px; margin-top: 4px; transition: 0.3s; }
.ps-weak   { background: var(--red);       width: 33%; }
.ps-ok     { background: var(--orange);    width: 66%; }
.ps-strong { background: var(--green);     width: 100%; }

/* ==========================================================
   TOPBAR + LIVE CLOCK
   ========================================================== */
.topbar { background: var(--navy-gradient); color: #fff; display: flex; align-items: center;
          justify-content: space-between; padding: 0 20px; height: 60px; position: fixed;
          top: 0; right: 0; left: 0; z-index: 100; box-shadow: 0 2px 10px rgba(11,43,74,0.15); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { width: 36px; height: 36px; background: var(--turq-gradient); border-radius: 10px;
               display: flex; align-items: center; justify-content: center;
               font-size: 17px; font-weight: 900; color: #fff; }
.brand span  { font-size: 14px; font-weight: 800; letter-spacing: 0.2px; }
.brand small { display: block; font-size: 10px; color: #94a3b8; font-weight: 600; }

.live-clock { background: rgba(255,255,255,0.08); border: 1px solid rgba(20,184,166,0.3);
              padding: 6px 14px; border-radius: 10px; text-align: center; line-height: 1.2; }
.clock-date { font-size: 10px; color: #94a3b8; font-weight: 700; }
.clock-time { font-size: 14px; color: var(--turquoise-light); font-weight: 900;
              font-variant-numeric: tabular-nums; letter-spacing: 1px; }
@media (max-width: 640px) { .live-clock { display: none; } }

.top-right { display: flex; align-items: center; gap: 8px; }
.greeting-text { font-size: 12px; font-weight: 700; color: #94a3b8; margin-left: 10px; display: none; }
@media (min-width: 768px) { .greeting-text { display: block; } }
.uchip { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
         padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; color: #e2e8f0; }
.btnlo { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
         color: #e2e8f0; padding: 6px 12px; border-radius: 8px; font-family: 'Cairo';
         font-size: 12px; font-weight: 700; cursor: pointer; transition: 0.2s; position: relative; }
.btnlo:hover { background: var(--turquoise); color: #fff; border-color: var(--turquoise); }
.msg-badge { position: absolute; top: -5px; right: -5px; background: var(--red); color: #fff;
             width: 16px; height: 16px; border-radius: 50%; font-size: 10px; display: none;
             align-items: center; justify-content: center; font-weight: bold; }

/* ==========================================================
   SIDEBAR
   ========================================================== */
.sidebar { width: var(--sw); background: #fff; border-left: 1px solid var(--border);
           position: fixed; top: 60px; right: 0; bottom: 0; overflow-y: auto; padding: 16px 0; z-index: 90; }
.ns { padding: 10px 20px 5px; font-size: 10px; letter-spacing: 1.5px; color: var(--muted);
      text-transform: uppercase; font-weight: 800; }
.sidebar a { display: flex; align-items: center; gap: 12px; padding: 10px 18px; color: var(--text);
             text-decoration: none; font-size: 13px; font-weight: 700; border-right: 3px solid transparent;
             transition: 0.15s; cursor: pointer; margin: 2px 10px; border-radius: 10px; }
.sidebar a:hover  { background: rgba(8,145,178,0.10); color: var(--turquoise); }
.sidebar a.active { background: var(--accent-gradient); color: #fff;
                    box-shadow: var(--shadow-glow-turq); }
.sidebar a .ic { font-size: 16px; width: 20px; text-align: center; }

/* SIDEBAR COUNTERS — visually styled */
.nb { margin-right: auto; background: var(--turquoise); color: #fff; font-size: 10px;
      padding: 2px 8px; border-radius: 20px; font-weight: 800; min-width: 22px; text-align: center; }
.nb.w { background: var(--orange); }
.sidebar a.active .nb { background: #fff; color: var(--navy); }

@media (max-width: 900px) {
  .sidebar { transform: translateX(100%); transition: 0.25s; box-shadow: -4px 0 20px rgba(0,0,0,0.1); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-right: 0 !important; }
}

/* ==========================================================
   MAIN
   ========================================================== */
.main { margin-right: var(--sw); flex: 1; padding: 28px; margin-top: 60px; min-height: calc(100vh - 60px); }
.page { display: none; animation: fadeIn 0.35s cubic-bezier(0.25,0.8,0.25,1); }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.ph { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
.pt { font-size: 22px; font-weight: 900; color: var(--navy); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); transition: 0.25s; }
.card:hover { box-shadow: var(--shadow-md); }
.card h3, .card h2 { color: var(--navy); margin-bottom: 12px; }

/* STATS GRID */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
              gap: 14px; margin-bottom: 20px; }
.sc { background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
      padding: 22px 20px 20px; text-align: center; transition: 0.25s; position: relative; overflow: hidden; }
.sc::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--turq-gradient); opacity: 0.7;
}
.sc:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--turquoise); }
.sc:hover::before { opacity: 1; height: 4px; }
.sc .ic { font-size: 30px; margin-bottom: 8px; }
.sc .sv { font-size: 30px; font-weight: 900; color: var(--navy); transition: 0.2s; }
.sc .sl { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 4px; }

/* Color-coded top borders per card type (nth-child) */
.sc:nth-child(1)::before { background: var(--turq-gradient); }
.sc:nth-child(2)::before { background: var(--green-gradient); }
.sc:nth-child(3)::before { background: var(--navy-gradient); }
.sc:nth-child(4)::before { background: var(--orange-gradient); }
.sc:nth-child(5)::before { background: var(--red-gradient); }
.sc:nth-child(6)::before { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.sc:nth-child(7)::before { background: linear-gradient(135deg, #06b6d4, #22d3ee); }

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

/* TABLES */
.table-wrap { overflow-x: auto; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead { background: var(--navy-gradient); color: #fff; }
th { padding: 12px 8px; font-weight: 700; text-align: right; letter-spacing: 0.2px; }
td { padding: 10px 8px; border-bottom: 1px solid var(--border); }
tbody tr { transition: 0.15s; }
tbody tr:hover { background: linear-gradient(90deg, rgba(8,145,178,0.04), rgba(8,145,178,0.08)); }

/* BADGES */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 10px; font-weight: 800; letter-spacing: 0.3px;}
.b-done    { background: rgba(16,185,129,0.12); color: var(--green-dark); border: 1px solid rgba(16,185,129,0.25); }
.b-urgent  { background: rgba(225,29,72,0.12);  color: var(--red-dark);   border: 1px solid rgba(225,29,72,0.25); }
.b-delayed { background: rgba(225,29,72,0.12);  color: var(--red-dark);   border: 1px solid rgba(225,29,72,0.25); }
.b-progress{ background: rgba(245,158,11,0.14); color: var(--orange-dark);border: 1px solid rgba(245,158,11,0.28); }

/* FILTERS */
.filters-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filters-row input, .filters-row select {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: 'Cairo'; font-size: 12px; background: #f8fafc; flex: 1; min-width: 140px; }
.filters-row input:focus, .filters-row select:focus {
  border-color: var(--turquoise); background: #fff; outline: none; }

/* RECORD FORM */
.record-form label { display: block; margin-bottom: 12px; font-weight: 700; font-size: 12px;
                     color: var(--muted); }
.record-form input, .record-form select, .record-form textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: 'Cairo'; font-size: 13px; margin-top: 4px; background: #f8fafc; }
.record-form input:focus, .record-form select:focus, .record-form textarea:focus {
  border-color: var(--turquoise); background: #fff; outline: none;
  box-shadow: 0 0 0 3px rgba(20,184,166,0.1); }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .g2 { grid-template-columns: 1fr; } }

.file-preview { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.file-item { background: #f1f5f9; padding: 6px 12px; border-radius: 8px; font-size: 11px; font-weight: 700; }

/* PAGINATION */
.pagination-info { margin-top: 12px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; }

/* RECORD ACTIONS */
.rec-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.btn-open    { background: var(--navy);      color: #fff; }
.btn-share   { background: var(--turquoise); color: #fff; }
.btn-wa      { background: #25d366;          color: #fff; }
.btn-preview { background: var(--orange);    color: #fff; }
.btn-attach  { background: #e2e8f0;          color: var(--navy); }
.btn-link    { background: var(--turquoise-light); color: #fff; }
.btn-transfer{ background: var(--green);     color: #fff; }

.link-badge { display: inline-block; background: var(--turquoise); color: #fff; padding: 2px 8px;
              border-radius: 20px; font-size: 10px; font-weight: 800; cursor: pointer; }

/* MODALS */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
         z-index: 500; align-items: center; justify-content: center; padding: 20px; }
.modal.active { display: flex; }
.modal-content { background: #fff; border-radius: var(--radius); padding: 28px; width: 100%;
                 max-width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-xl); }
.modal-content h3 { color: var(--navy); margin-bottom: 16px; }
.modal-content label { display: block; margin-bottom: 12px; font-size: 12px; font-weight: 700; color: var(--muted); }
.modal-content input, .modal-content select, .modal-content textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: 'Cairo'; font-size: 13px; margin-top: 4px; background: #f8fafc; }

/* TOAST */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px);
         background: var(--navy); color: #fff; padding: 14px 24px; border-radius: 12px;
         font-weight: 700; font-size: 13px; z-index: 10000; opacity: 0; transition: 0.3s;
         box-shadow: var(--shadow-lg); }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* MESSAGES */
.msg-bubble { background: #f1f5f9; padding: 12px 16px; border-radius: 14px; margin-bottom: 10px; max-width: 80%; }
.msg-bubble.mine   { background: var(--turq-gradient); color: #fff; margin-right: auto; }
.msg-bubble.theirs { background: #fff; border: 1px solid var(--border); }
.msg-header { display: flex; justify-content: space-between; font-size: 10px; opacity: 0.8; margin-bottom: 6px; font-weight: 700; }
.msg-text   { font-size: 13px; line-height: 1.6; }
.msg-file   { display: block; margin-top: 8px; font-size: 11px; color: inherit; text-decoration: underline; }
.msg-actions { margin-top: 8px; display: flex; gap: 6px; }

/* AI CHAT */
.ai-chat-card { display: flex; flex-direction: column; height: calc(100vh - 160px); min-height: 500px; }
.ai-chat-window { flex: 1; overflow-y: auto; padding: 16px; background: #f8fafc;
                   border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.ai-msg { padding: 12px 16px; border-radius: 14px; margin-bottom: 10px; max-width: 85%; font-size: 13px; line-height: 1.7; }
.ai-msg ul { margin: 8px 16px; }
.ai-msg-bot  { background: #fff; border: 1px solid var(--border); margin-left: auto; }
.ai-msg-user { background: var(--navy-gradient); color: #fff; margin-right: auto; }
.ai-input-row { display: flex; gap: 8px; align-items: center; }
.ai-input-row input[type="text"] { flex: 1; padding: 12px 16px; border: 1.5px solid var(--border);
                                    border-radius: 12px; font-family: 'Cairo'; font-size: 13px; background: #f8fafc; }
.ai-input-row input[type="text"]:focus { border-color: var(--turquoise); background: #fff; outline: none; }

/* LOADER */
.loader { border: 3px solid #f1f5f9; border-top: 3px solid var(--turquoise); border-radius: 50%;
          width: 16px; height: 16px; animation: spin 1s linear infinite; display: inline-block;
          vertical-align: middle; margin-left: 5px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ROW STATES — ⑦ urgent = green, done = muted */
tbody tr.row-urgent {
  background: linear-gradient(90deg, rgba(16,185,129,0.10), rgba(16,185,129,0.05)) !important;
  border-right: 3px solid var(--green);
}
tbody tr.row-urgent td { color: var(--green-dark); font-weight: 700; }
tbody tr.row-done {
  background: rgba(100,116,139,0.05) !important;
  opacity: 0.72;
}
tbody tr.row-urgent:hover { background: rgba(16,185,129,0.15) !important; }

/* CLICKABLE CELLS (num / subject) */
.cell-link {
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: 0.15s;
  padding: 2px 4px;
  border-radius: 4px;
}
.cell-link:hover {
  color: var(--turquoise);
  background: rgba(20,184,166,0.08);
  border-bottom-color: var(--turquoise);
}

/* CLICKABLE DASHBOARD STAT CARDS */
.sc.clickable { cursor: pointer; }
.sc.clickable:hover .sv { color: var(--turquoise); }
.sc.clickable:active { transform: scale(0.97); }

/* BULK ACTIONS BAR */
.bulk-bar {
  background: var(--navy-gradient);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
  animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bulk-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.bulk-count {
  font-size: 14px;
  font-weight: 800;
}
.bulk-count b {
  color: var(--turquoise-light);
  font-size: 18px;
  margin: 0 4px;
}
.bulk-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.bulk-actions .btn { font-size: 11px; padding: 6px 12px; }

/* DEPARTMENTS GRID */
.departments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.dept-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px 16px;
  cursor: pointer;
  transition: 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}
.dept-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0.3);
  transform-origin: right;
  transition: 0.3s;
}
.dept-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-turq);
  border-color: var(--turquoise);
}
.dept-card:hover::before {
  transform: scaleX(1);
}
.dept-card-icon {
  font-size: 34px;
  margin-bottom: 8px;
}
.dept-card-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.3;
}
.dept-card-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.dept-card-count b {
  color: var(--turquoise);
  font-size: 16px;
  margin-left: 4px;
}
.dept-card-del {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px !important;
  font-size: 10px !important;
}

/* DEPARTMENT DETAIL TABS */
.dept-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 10px;
  background: var(--surface-alt);
  border-radius: var(--radius);
}
.dept-tab {
  padding: 8px 16px;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  color: var(--navy);
  border-radius: 10px;
  font-family: 'Cairo';
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dept-tab:hover {
  border-color: var(--turquoise);
  color: var(--turquoise);
}
.dept-tab.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow-turq);
}
.dept-tab-badge {
  background: rgba(255,255,255,0.25);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
}
.dept-tab:not(.active) .dept-tab-badge {
  background: var(--surface-alt);
  color: var(--navy);
}

/* REPORT PRINT STYLES */
@media print {
  body * { visibility: hidden; }
  #report-print-area, #report-print-area * { visibility: visible; }
  #report-print-area { position: absolute; left: 0; top: 0; width: 100%; padding: 20px; }
  .topbar, .sidebar, .btn-group, .filters-row { display: none !important; }
}
#report-print-area { background: #fff; padding: 24px; }
#report-print-area h1 { color: var(--navy); margin-bottom: 8px; }
#report-print-area .report-meta { color: var(--muted); font-size: 12px; margin-bottom: 20px; border-bottom: 2px solid var(--navy); padding-bottom: 10px; }
#report-print-area table { width: 100%; border-collapse: collapse; font-size: 11px; }
#report-print-area th { background: var(--navy); color: #fff; padding: 8px; border: 1px solid #ccc; }
#report-print-area td { padding: 6px 8px; border: 1px solid #ccc; }

/* ============================================================
   🆕 PASSWORD VISIBILITY TOGGLE
   ============================================================ */
.lg-pass { position: relative; }
.lg-pass input { padding-left: 44px !important; } /* مساحة للزرار يسار في RTL */

.pw-wrap { position: relative; }

.pw-eye {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  border-radius: 8px;
  transition: 0.2s;
  z-index: 2;
  user-select: none;
}
.pw-eye:hover {
  background: rgba(20, 184, 166, 0.12);
  color: var(--turquoise);
}
.pw-eye:focus { outline: 2px solid var(--turquoise); outline-offset: 1px; }

/* لو الزرار جوة .pw-wrap داخل label (صفحة البروفايل) — العنصر العلوي label له padding-top
   فالـ top: 50% هتكون منضبطة على الـ wrapper لوحده، وده اللي عايزينه. */
.pw-wrap .pw-eye {
  /* عشان الـ label فيه margin-top:4px على الـ input، نضبط مكان العين شوية */
  top: calc(50% + 2px);
}
