@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* âââââââââââââââââââââââââââââââââââââââââââ
   NOMU HR â Light Professional Design
   REVERTED TO STABLE VERSION
âââââââââââââââââââââââââââââââââââââââââââ */
:root {
  /* ð¨ Updated Brand Palette */
  --brand: #1b4f5e;  /* Petrol Blue */
  --brand2: #0D455C; /* Deep Petrol */
  --brand3: #0D4F7C; /* Primary Navy */
  --brand-lt: rgba(27, 79, 94, 0.05);

  /* ð Backgrounds (Light Mode) */
  --bg: #F1F5F9;
  --bg-s: #FFFFFF;
  --bg-c: #FFFFFF;
  --sidebar-bg: #FFFFFF;
  --header-bg: #FFFFFF;
  --font-main: 'Cairo', 'Inter', sans-serif;

  /* âï¸ Typography - Extra large and bold for maximum readability */
  --text: #0F172A;
  /* Deep Slate */
  --text2: #334155;
  /* Slate 700 - Darker for better contrast with bold */
  --text3: #64748B;
  /* Slate 500 - Darker for better contrast with bold */
  --white: #FFFFFF;

  --fs-base: 16px;
  --fs-sb: 16px;
  /* Sidebar font size */
  --fs-sm: 15px;
  --fs-xs: 13px;
  --fs-h1: 28px;
  --fs-h2: 24px;
  --fs-h3: 20px;

  /* ð¡ï¸ Borders */
  --border: #E2E8F0;
  --border2: #CBD5E1;

  /* ð¦ Status Colors */
  --success: #22C55E;
  --success-bg: #f0fdf4;
  --warning: #F97316;
  --warning-bg: #fff7ed;
  --danger: #EF4444;
  --danger-bg: #fef2f2;
  --info: #2563EB;
  --info-bg: #eff6ff;

  /* ð Layout Constants - Expanded for larger text */
  --sw: 260px;
  --swc: 80px;
  --hh: 72px;
  --rs: 12px;
  --r: 22px;
  --r2: 35px;
  --r3: 55px;
  --rf: 9999px;
  --tr: .15s ease;
  --tr2: .25s cubic-bezier(0.4, 0, 0.2, 1);

  /* â¨ Effects */
  --sh: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --sh2: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --sh-brand: 0 4px 14px rgba(27, 79, 94, .25);

  --grad: linear-gradient(135deg, #0D455C, #1b4f5e);
}

/* Global Hover/Highlight Effect */
.card, .nav-i, .btn, .hbtn, .theme-btn, .lang-btn, .h-toggle, .h-profile, .chip, .kpi {
  transition: all var(--tr2) !important;
}

.card:hover, .btn:hover, .h-profile:hover, .qa-item:hover, .emp-card-new:hover, .kpi:hover {
  box-shadow: 0 15px 35px -5px rgba(27, 79, 94, 0.15);
  transform: translateY(-4px);
}

.log-row-hover {
  transition: background 0.2s ease;
}

.log-row-hover:hover {
  background: var(--brand-lt) !important;
}

body.dark-mode .log-row-hover:hover {
  background: rgba(44, 120, 115, 0.2) !important;
}

.nav-i:hover {
  transform: translateX(-4px);
}
body.ltr .nav-i:hover { transform: translateX(4px); }

/* ââ Base ââ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: var(--fs-base);
  font-weight: 700;
  /* SYSTEM-WIDE BOLD */
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
}

button:focus,
button:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}


input,
select,
textarea {
  font-family: inherit;
}

ul,
ol {
  list-style: none;
}



.circular-av {
  width: 64px;
  height: 64px;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: var(--rf);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}

body.rtl {
  direction: rtl;
}

body.ltr {
  direction: ltr;
}

/* ð Updated Dark Mode Palette */
body.dark-mode {
  --bg: #062240;
  /* Dark Background */
  --bg-s: #0F172A;
  /* Secondary Slate / Navy */
  --bg-c: #0D455C;
  /* Primary Navy for Web */
  --sidebar-bg: #0F172A;
  --header-bg: rgba(15, 23, 42, 0.85);
  /* Glassy header */
  --card-bg: #0D455C;

  --text: #F8FAFC;
  --text2: #CBD5E1;
  --text3: #94A3B8;
  --white: #FFFFFF;

  --border: #1A8F7E;
  --border2: #2BBFAA;

  --sh: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --sh2: 0 20px 25px -5px rgba(0, 0, 0, 0.5);

  --brand-lt: rgba(43, 191, 170, 0.15);

  font-weight: 800;
  /* Extra bold for dark mode */
}

body.dark-mode .card,
body.dark-mode .sc,
body.dark-mode .nav-i,
body.dark-mode .hbtn,
body.dark-mode .theme-btn,
body.dark-mode .lang-btn,
body.dark-mode .h-toggle,
body.dark-mode .h-profile,
body.dark-mode .searchbar,
body.dark-mode .emp-sidebar,
body.dark-mode .emp-header-new,
body.dark-mode td,
body.dark-mode th {
  font-weight: 800 !important;
}

body.dark-mode .tab.act {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

body.dark-mode .fi,
body.dark-mode .fsel {
  background: var(--bg-s);
  color: var(--text);
  border-color: var(--border);
}

body.dark-mode .emp-card-side {
  background: #64748B;
}

.kpi {
  background: var(--bg-c);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  cursor: pointer;
  transition: all var(--tr);
}

.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh2);
  border-color: var(--brand);
}

.kpi-icon {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--brand);
  background: transparent !important;
}

.kpi-val {
  font-size: 38px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin: 4px 0;
}

.kpi-lbl {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text2);
}

.kpi-delta {
  font-size: 13px;
  margin-top: 6px;
  font-weight: 600;
}

.kpi-up {
  color: var(--success);
}

.kpi-down {
  color: var(--danger);
}

.kpi-flat {
  color: var(--warning);
}

/* ð Dark Mode Contrast Overrides - MAXIMUM CLARITY */
body.dark-mode .bdg-b {
  background: #334155;
  color: #FFFFFF !important;
  border: 1px solid #475569;
}

body.dark-mode .bdg-ok {
  background: rgba(52, 211, 153, 0.3);
  color: #FFFFFF !important;
}

body.dark-mode .bdg-dn {
  background: rgba(248, 113, 113, 0.3);
  color: #FFFFFF !important;
}

body.dark-mode .bdg-w {
  background: rgba(251, 191, 36, 0.3);
  color: #FFFFFF !important;
}

body.dark-mode .bdg-m {
  background: #1E293B;
  color: #FFFFFF !important;
  border: 1px solid #475569;
}

body.dark-mode thead th {
  background: #0F172A;
  color: #F8FAFC !important;
}

body.dark-mode tbody td {
  border-color: #334155;
  color: #F8FAFC;
}

body.dark-mode tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .sc-lbl,
body.dark-mode .ph-sub,
body.dark-mode .pg-date,
body.dark-mode .sc-trend-sub {
  color: #F8FAFC !important;
}

/* Target the descriptions specifically to be BRIGHT WHITE in dark mode */
body.dark-mode .rbac-desc {
  color: #FFFFFF !important;
  font-weight: 700;
}

/* ââ Typography and Font Scale ââ */
h1,
.ph-title {
  font-size: var(--fs-h1);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

h2,
.prof-name {
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--text);
}

h3,
.c-title {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text);
}

.text-sm {
  font-size: var(--fs-sm);
}

.text-xs {
  font-size: var(--fs-xs);
}

/* ââ New Employee View (Compact & Clean) ââ */
.emp-main-area {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.emp-header-new,
.ph {
  background: var(--bg-c);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 18px 25px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--sh);
  min-height: 80px;
}

.ph-title {
  font-size: var(--fs-h1);
  font-weight: 900;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ph-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Global Header Actions Area */
.h-global-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 20px;
  padding: 0 20px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 40px;
}

body.ltr .h-global-actions {
  border-left: none;
  border-right: 1px solid var(--border);
}

.emp-view-toggles {
  display: flex;
  gap: 8px;
  border-left: 1px solid var(--border);
  padding-left: 15px;
  margin-left: 5px;
}

body.ltr .emp-view-toggles {
  border-left: none;
  border-right: 1px solid var(--border);
  padding-left: 0;
  padding-right: 15px;
}

.emp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.emp-cards-grid.small {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

/* Compact Table Styles */
.tw.compact table td {
  padding: 8px 14px;
  font-size: 15px;
}

.tw.compact .av {
  width: 28px;
  height: 28px;
  font-size: 10px;
}

.tw.compact .av-row {
  gap: 8px;
}



.emp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 15px;
}

.emp-card-new {
  background: var(--bg-c);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  display: flex;
  transition: var(--tr2);
  cursor: pointer;
  position: relative;
  min-height: 125px; /* Added height to prevent overlap with large avatar */
}

.emp-card-new:hover {
  box-shadow: var(--sh);
  transform: translateY(-2px);
  border-color: var(--brand);
}

.emp-card-body {
  padding: 12px;
  padding-top: 10px;
  padding-left: 35px; /* Space for the status dot */
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}
body.rtl .emp-card-body {
  padding-left: 12px;
  padding-right: 35px; /* Space for the status dot in RTL */
}

.emp-card-info {
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
}

.emp-card-name {
  font-weight: 900;
  font-size: 16px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.emp-card-title {
  font-size: 13.5px;
  color: var(--brand);
  font-weight: 800;
  margin-bottom: 4px;
}

.emp-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}

.emp-card-meta-i {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text2);
  font-weight: 700;
}

.emp-card-side {
  width: 90px;
  background: var(--brand);
  color: white;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
  font-size: 40px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 0 var(--r2) var(--r2) 0;
}

body.rtl .emp-card-side {
  border-radius: var(--r2) 0 0 var(--r2);
}

.emp-status-dot {
  position: absolute;
  top: 14px;
  left: 15px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid var(--bg-c);
  z-index: 10;
  cursor: help;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
body.rtl .emp-status-dot {
  left: 15px;
  right: auto;
}

/* â”€â”€ New Profile Detail (Odoo Style) â”€â”€ */
.prof-new {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.prof-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 25px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.prof-img-wrap {
  width: 100px;
  height: 100px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  border-radius: var(--rs);
  overflow: hidden;
}

.prof-title-area {
  flex: 1;
}

.prof-name {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.2;
}

.prof-job {
  font-size: 18px;
  color: var(--text2);
  margin-top: 5px;
}

.prof-top-meta {
  position: absolute;
  top: 25px;
  left: 25px;
  text-align: left;
  font-size: 13px;
  color: var(--text3);
}

.prof-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  gap: 2px;
}

.prof-tab {
  padding: 12px 25px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: none;
  border-top: 3px solid transparent;
}

.prof-tab:hover {
  background: #eee;
}

.prof-tab.act {
  background: var(--bg-c);
  color: var(--brand);
  border-top-color: var(--brand);
  border-bottom: 1px solid var(--bg-c);
  margin-bottom: -1px;
}

.prof-body {
  padding: 25px;
  flex: 1;
  overflow-y: auto;
  background: var(--bg-c);
}

.prof-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 30px;
}

.prof-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg);
  font-size: 13.5px;
}

.prof-lbl {
  color: var(--text3);
  font-weight: 500;
}

.prof-val {
  color: var(--text);
  font-weight: 700;
}

.prof-timeline {
  margin-top: 20px;
  border-right: 2px solid var(--brand-lt);
  padding-right: 20px;
  position: relative;
}

.prof-time-i {
  position: relative;
  padding-bottom: 25px;
}

.prof-time-i::after {
  content: '';
  position: absolute;
  top: 5px;
  right: -26px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid white;
}

.prof-time-date {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 2px;
}

.prof-time-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.prof-time-desc {
  font-size: 12px;
  color: var(--text2);
}

body.dark-mode .emp-sidebar,
body.dark-mode .emp-header-new,
body.dark-mode .prof-tabs,
body.dark-mode .prof-body {
  background: var(--bg-c);
  border-color: var(--border);
}

body.dark-mode .prof-tab:hover {
  background: var(--glass2);
}

/* ââââââââââââââââââââââââââââââââââ
   LAYOUT
ââââââââââââââââââââââââââââââââââ */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ââ SIDEBAR ââ */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sw);
  height: 100vh;
  background: var(--sidebar-bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--tr2);
  overflow: hidden;
}

.sidebar.col {
  width: var(--swc);
}

body.ltr .sidebar {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--border);
}

/* Sidebar brand */
.sb-brand {
  padding: 0 16px;
  height: var(--hh);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sb-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--grad-brand);
  box-shadow: 0 3px 10px rgba(27, 79, 94, .3);
}

.sb-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sb-logo-text {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.sb-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.sb-sub {
  font-size: 13px;
  color: var(--text3);
  white-space: nowrap;
  margin-top: 1px;
}

.sidebar.col .sb-name,
.sidebar.col .sb-sub {
  opacity: 0;
  pointer-events: none;
}

/* Sidebar nav */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px;
}

.nav-sec {
  font-size: var(--fs-sb);
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--text);
  opacity: 1;
  padding: 16px 12px 6px;
  white-space: nowrap;
  transition: opacity var(--tr);
}

.sidebar.col .nav-sec {
  opacity: 0;
}

.nav-i {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: var(--r);
  cursor: pointer;
  transition: all var(--tr);
  white-space: nowrap;
  color: var(--text2);
  font-size: var(--fs-xs);
  font-weight: 800;
  /* Extra bold sidebar links */
}

.nav-i:hover {
  background: var(--brand-lt);
  color: var(--brand);
}

.nav-i.act {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.nav-ic {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.nav-lbl {
  flex: 1;
  transition: opacity var(--tr);
}

.nav-bdg {
  background: #EF4444;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--rf);
  min-width: 18px;
  text-align: center;
}

.nav-i.act .nav-bdg {
  background: rgba(255, 255, 255, .3);
}

.sidebar.col .nav-lbl,
.sidebar.col .nav-bdg {
  opacity: 0;
  pointer-events: none;
}

/* Sidebar tooltip in collapsed mode */
.nav-tip {
  display: none;
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--r);
  white-space: nowrap;
  z-index: 200;
  box-shadow: var(--sh2);
}

body.ltr .nav-tip {
  right: auto;
  left: calc(100% + 8px);
}

.sidebar.col .nav-i:hover .nav-tip {
  display: block;
}

/* Sidebar footer */
.sb-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sb-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background var(--tr);
}

.sb-user:hover {
  transform: translateY(-2px);
}

.u-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

.u-nm {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.u-rl {
  font-size: 13px;
  color: var(--text3);
  white-space: nowrap;
}

.sidebar.col .u-nm,
.sidebar.col .u-rl {
  opacity: 0;
  pointer-events: none;
}

/* ââ MAIN ââ */
.main {
  margin-right: var(--sw);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  transition: margin var(--tr2);
  position: relative;
}

.main.col {
  margin-right: var(--swc);
}

body.ltr .main {
  margin-right: 0;
  margin-left: var(--sw);
}

body.ltr .main.col {
  margin-left: var(--swc);
}

/* ââ HEADER ââ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--hh);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Right Side: Logo & Toggle */
.h-right-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.h-logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.h-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

/* Center: Search */
.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--rf);
  padding: 6px 14px;
  width: 280px;
  max-width: 100%;
  transition: all var(--tr);
}

.searchbar:focus-within {
  border-color: var(--brand);
  width: 320px;
  background: var(--card-bg);
  box-shadow: var(--sh1);
}

.searchbar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  width: 100%;
}

/* Left Side: Actions */
.h-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hbtn,
.theme-btn,
.lang-btn,
.h-toggle {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r);
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  transition: all var(--tr);
  font-family: inherit;
  outline: none !important;
}

.h-toggle {
  width: 36px;
  font-size: 18px;
}

.theme-btn {
  width: 36px;
  font-size: 16px;
}

.lang-btn {
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: 0.02em;
  outline: none !important;
}

.hbtn {
  width: 36px;
  position: relative;
  font-size: 16px;
}

.hbtn .dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: #EF4444;
  color: #fff;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--header-bg);
}

.hbtn:hover,
.theme-btn:hover,
.lang-btn:hover,
.h-toggle:hover {
  transform: translateY(-2px);
}

.hbtn.act {
  background: var(--brand) !important;
  color: #fff !important;
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(27, 79, 94, .3);
}


/* User Profile in Header */
.h-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 12px;
  border-radius: var(--rf);
  background: var(--card-bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--tr);
}

.h-profile:hover {
  border-color: var(--brand);
  background: var(--brand-lt);
}

.h-profile-info {
  text-align: right;
}

.h-profile-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.h-profile-role {
  font-size: 10px;
  color: var(--text3);
  line-height: 1.2;
}

.h-chevron {
  font-size: 10px;
  color: var(--text3);
}

/* In RTL, we might need to adjust profile padding */
[dir="rtl"] .h-profile {
  padding: 4px 12px 4px 4px;
}

[dir="rtl"] .h-profile-info {
  text-align: right;
}

/* ââ Option 4: Executive Command Center ââ */
.prof-exec {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  height: 100%; /* Fill the container */
  border-radius: 0;
  overflow: hidden;
}

/* Full Screen Immersive Modal Override */
.modal:has(.prof-exec) {
  max-width: 98vw !important;
  width: 98vw;
  max-height: 96vh;
  height: 96vh;
  border-radius: var(--r2);
  overflow: hidden;
  border: none;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal:has(.prof-exec) .m-bd {
  padding: 0;
  height: 100%;
  overflow: hidden;
}

.modal:has(.prof-exec) .m-hd, 
.modal:has(.prof-exec) .m-ft {
  display: none;
}

.prof-exec-hero {
  height: 220px;
  background: linear-gradient(135deg, var(--brand) 0%, #1b4f5e 100%);
  padding: 40px;
  display: flex;
  align-items: flex-end;
  position: relative;
  color: #fff;
}

.prof-exec-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, rgba(0,0,0,0.2), transparent);
}

.prof-exec-avatar {
  width: 140px;
  height: 140px;
  border-radius: 20px;
  border: 6px solid #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  font-weight: 800;
  z-index: 2;
  margin-bottom: -20px;
}

.prof-exec-name-wrap {
  margin-right: 25px;
  padding-bottom: 5px;
  z-index: 2;
}

body.ltr .prof-exec-name-wrap {
  margin-right: 0;
  margin-left: 25px;
}

.pex-name {
  font-size: 32px;
  font-weight: 950;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.pex-job {
  font-size: 16px;
  opacity: 0.9;
  font-weight: 700;
}

.prof-exec-stats {
  display: flex;
  background: var(--bg-s);
  padding: 30px 40px;
  gap: 40px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  z-index: 1;
}

.pex-stat-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 15px;
}

.pex-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r);
  background: var(--bg-s);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.pex-stat-info {
  display: flex;
  flex-direction: column;
}

.pex-stat-val {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
}

.pex-stat-lbl {
  font-size: 12px;
  color: var(--text3);
  font-weight: 700;
}

.prof-exec-body {
  flex: 1;
  display: flex;
  background: var(--bg);
  overflow: hidden;
}

.pex-sidebar {
  width: 280px;
  padding: 30px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pex-side-link {
  padding: 14px 20px;
  border-radius: var(--r);
  border: none;
  background: transparent;
  text-align: right;
  font-weight: 800;
  font-size: 15px;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 12px;
}

body.ltr .pex-side-link {
  text-align: left;
}

.pex-side-link i {
  font-size: 18px;
  opacity: 0.7;
}

.pex-side-link:hover {
  background: rgba(27, 79, 94, 0.05);
  color: var(--brand);
}

.pex-side-link.act {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 20px rgba(27, 79, 94, 0.2);
}

.pex-main {
  flex: 1;
  background: var(--bg-c);
  margin: 20px;
  margin-right: 0;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(0,0,0,0.02);
  padding: 40px;
  overflow-y: auto;
}

body.ltr .pex-main {
  margin-right: 20px;
  margin-left: 0;
}

.pex-section-title {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--brand);
}

.pex-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.pex-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pex-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--text3);
}

.pex-input-wrap {
  position: relative;
}

.pex-input-wrap .fi, .pex-input-wrap .fsel {
  background: var(--bg-s);
  border: 1.5px solid var(--border);
  height: 48px;
  border-radius: var(--r);
  padding: 0 15px;
  font-weight: 800;
  width: 100%;
  color: var(--text);
}

.pex-input-wrap .fi:focus {
  border-color: var(--brand);
  background: var(--bg-c);
}

/* ââ Actions Bar ââ */
.pex-actions {
  position: absolute;
  top: 30px;
  left: 30px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

body.ltr .pex-actions {
  left: auto;
  right: 30px;
}

.pex-btn {
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r);
  font-weight: 900;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.pex-btn-glass {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

.pex-btn-glass:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

body.dark-mode .prof-exec { background: var(--bg-c); }
body.dark-mode .prof-exec-stats { background: var(--bg-s); border-color: var(--border); }
body.dark-mode .pex-main { background: var(--bg-c); border: 1px solid var(--border); }
body.dark-mode .pex-side-link:hover { background: var(--border); }
/* ââ Enhanced Documents Sidebar & List ââ */
.pex-doc-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.pex-doc-card {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 15px 20px;
  transition: all 0.2s;
  gap: 20px;
}

.pex-doc-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.pex-doc-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--r);
  background: var(--bg-s);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--brand);
}

.pex-doc-info {
  flex: 1;
}

.pex-doc-name {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 4px;
}

.pex-doc-meta {
  font-size: 12px;
  color: var(--text3);
  font-weight: 700;
  display: flex;
  gap: 15px;
}

.pex-doc-actions {
  display: flex;
  gap: 8px;
}

.pex-doc-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--bg-s);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.pex-doc-btn:hover {
  background: var(--brand);
  color: #fff;
}

.pex-doc-btn.del:hover {
  background: #ef4444;
}

/* Document Form (Odoo Look) */
.pex-doc-form {
  border: 1px solid var(--border);
  border-radius: var(--rs);
  padding: 30px;
  background: #fdfdfd;
  margin-top: 20px;
}

/* ââ Normal (Light) Mode Clarity Overrides ââ */
body:not(.dark-mode) .pex-header { background: #f8fafc !important; }
body:not(.dark-mode) .pex-sidebar { background: #f1f5f9 !important; border-left: 1px solid #e2e8f0 !important; }
body:not(.dark-mode) .pex-main { background: #ffffff !important; border-color: #e2e8f0 !important; }
body:not(.dark-mode) .pex-side-link:not(.act) { color: #475569 !important; }
body:not(.dark-mode) .pex-side-link.act { background: var(--brand) !important; color: #ffffff !important; }
body:not(.dark-mode) .pex-section-title { color: var(--brand) !important; font-weight: 900 !important; }
body:not(.dark-mode) .pex-label { color: #1e293b !important; font-weight: 800 !important; }
body:not(.dark-mode) .pex-stat-val { color: #0f172a !important; font-weight: 900 !important; }
body:not(.dark-mode) .pex-stat-label { color: #64748b !important; }

/* ââ Full Immersion Dark Mode Overrides ââ */
body.dark-mode .modal-box { background: #0b0e14 !important; border-color: #1e293b !important; }
body.dark-mode .modal-body { background: #0b0e14 !important; }
body.dark-mode .prof-exec { background: #0b0e14 !important; }
body.dark-mode .pex-header { border-bottom: 1px solid #1e293b; background: #0b0e14 !important; }
body.dark-mode .prof-exec-stats { background: #161a23 !important; border-color: #242b38 !important; }
body.dark-mode .pex-stat-label { color: #94a3b8 !important; }
body.dark-mode .pex-stat-val { color: #ffffff !important; font-weight: 900; }

body.dark-mode .pex-sidebar { background: #11141d !important; border-left: 1px solid #1e293b !important; }
body.dark-mode .pex-side-link { color: #f1f5f9 !important; }
body.dark-mode .pex-side-link.act { background: var(--brand) !important; color: #fff !important; }
body.dark-mode .pex-side-link:hover:not(.act) { background: #1e293b !important; }

/* Fixed Badges Visibility in Dark Mode */
body.dark-mode .pex-sidebar span {
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
}

body.dark-mode .pex-main { background: #11141d !important; border-color: #1e293b !important; }
body.dark-mode .pex-section-title { color: var(--brand) !important; text-shadow: 0 0 10px rgba(0,0,0,0.5); }
body.dark-mode .pex-label { color: #f1f5f9 !important; font-weight: 700; }

/* Doc cards in dark mode */
body.dark-mode .pex-doc-card { background: #1a1e28 !important; border-color: #2d3343 !important; }
body.dark-mode .pex-doc-name { color: #ffffff !important; }
body.dark-mode .pex-doc-meta span { color: #94a3b8 !important; }
body.dark-mode .pex-doc-icon { background: #0b0e14 !important; border: 1px solid #2d3343; }

/* Normal Mode Clarity */
body:not(.dark-mode) .pex-label { color: #1e293b; font-weight: 800; }
body:not(.dark-mode) .pex-stat-val { color: #1e293b; font-weight: 900; }
body:not(.dark-mode) .pex-doc-name { color: #1e293b; }

.pex-doc-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 40px;
}

body.dark-mode .pex-doc-card { background: #252932; border-color: #313640; }
body.dark-mode .pex-doc-form { background: #1a1c23; border-color: #313640; }
body.dark-mode .pex-doc-icon { background: #2d313a; color: var(--brand); }
body.dark-mode .pex-doc-btn { background: #2d313a; color: #fff; }
body.dark-mode .pex-doc-name { color: #fff; }
body.dark-mode .pex-doc-meta { color: #8a94a6; }

/* ── Dark Mode: Employee Profile Full Fix ── */
body.dark-mode .prof-exec-stats {
  background: #0f1521 !important;
  border-color: #1e293b !important;
}

body.dark-mode .prof-exec-body {
  background: #0b0e14 !important;
}

body.dark-mode .pex-main {
  background: #111827 !important;
  border-color: #1e293b !important;
  box-shadow: none !important;
}

body.dark-mode .pex-sidebar {
  background: #0d1117 !important;
}

/* Input fields inside profile */
body.dark-mode .pex-input-wrap .fi,
body.dark-mode .pex-input-wrap .fsel {
  background: #1a2235 !important;
  border-color: #2d3a52 !important;
  color: #f1f5f9 !important;
}

body.dark-mode .pex-input-wrap .fi:focus {
  background: #1e2940 !important;
  border-color: var(--brand) !important;
}

/* General fi/fsel inputs in dark mode profile */
body.dark-mode .prof-exec .fi,
body.dark-mode .prof-exec .fsel,
body.dark-mode .prof-exec input[type="text"],
body.dark-mode .prof-exec input[type="email"],
body.dark-mode .prof-exec input[type="date"],
body.dark-mode .prof-exec textarea,
body.dark-mode .prof-exec select {
  background: #1a2235 !important;
  border-color: #2d3a52 !important;
  color: #f1f5f9 !important;
}

body.dark-mode .prof-exec .fi:focus,
body.dark-mode .prof-exec input:focus,
body.dark-mode .prof-exec textarea:focus,
body.dark-mode .prof-exec select:focus {
  background: #1e2940 !important;
  border-color: var(--brand) !important;
  outline: none !important;
}

/* Doc form background */
body.dark-mode .pex-doc-form {
  background: #111827 !important;
  border-color: #1e293b !important;
}

/* Stats white background */
body.dark-mode .pex-stat-card {
  background: transparent !important;
}

/* Any remaining white panels inside modal */
body.dark-mode .modal .prof-exec *:not([style*="background:linear"]):not(.prof-exec-hero):not(.prof-exec-hero *):not(.pex-side-link.act):not(.pex-btn) {
  --white-override: var(--bg-c);
}

body.dark-mode .pex-doc-card {
  background: #141b2a !important;
  border-color: #1e293b !important;
}

body.dark-mode .pex-doc-card:hover {
  border-color: var(--brand) !important;
  background: #1a2235 !important;
}

body.dark-mode .pex-doc-icon {
  background: #0d1117 !important;
}

/* Fix jitter in number inputs */
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}


/* ââââââââââââââââââââââââââââââââââ
/* ── Validation Feedback ── */
.val-error {
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.05) !important;
}

.val-error-msg {
  color: #ef4444;
  font-size: 11px;
  font-weight: 800;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

   PAGES
ââââââââââââââââââââââââââââââââââ */
.page {
  flex: 1;
  padding: 25px 40px;
  margin: 0;
  max-width: 100%;
  width: 100%;
  display: none !important;
  animation: fadeIn .22s ease;
}

.page.act {
  display: block !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* Page header */
.ph {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 14px;
  flex-wrap: wrap;
}

.ph-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.ph-sub {
  font-size: 12.5px;
  color: var(--text3);
  margin-top: 3px;
}

.ph-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

/* Page greeting */
.pg-greet {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.pg-date {
  font-size: 16px;
  color: var(--text3);
  margin-top: 3px;
}

/* ââââââââââââââââââââââââââââââââââ
   BUTTONS
ââââââââââââââââââââââââââââââââââ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--r2);
  font-size: var(--fs-sm);
  font-weight: 800;
  transition: all var(--tr2);
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

/* Photo Upload Styles */
.prof-exec-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-right: 15px;
}
.pex-edit-photo {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: 3px solid var(--bg-c);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--tr);
  box-shadow: var(--sh);
}
.pex-edit-photo:hover {
  transform: scale(1.1);
  background: var(--brand-hv);
}
.pex-edit-photo {
  z-index: 100;
}
.av {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  flex-shrink: 0;
}
.av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-p {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(27, 79, 94, .3);
}

.btn-p:hover {
  box-shadow: 0 10px 20px rgba(27, 79, 94, .4);
  transform: translateY(-4px);
}

.btn-s {
  background: #fff;
  border-color: var(--border2);
  color: var(--text2);
}

.btn-s:hover {
  transform: translateY(-4px);
}

.btn-d {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, .25);
  color: var(--danger);
}

.btn-d:hover {
  transform: translateY(-4px);
}

.btn-ok {
  background: var(--success-bg);
  border-color: rgba(34, 197, 94, .25);
  color: var(--success);
}

.btn-ok:hover {
  transform: translateY(-4px);
}

.btn-w {
  background: var(--warning-bg);
  border-color: rgba(245, 158, 11, .25);
  color: var(--warning);
}

.btn-w:hover {
  transform: translateY(-4px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
}

.btn-xs {
  padding: 4px 9px;
  font-size: 11px;
}

/* ââââââââââââââââââââââââââââââââââ
   CARDS
ââââââââââââââââââââââââââââââââââ */
.card {
  background: var(--bg-c);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 18px;
  box-shadow: var(--sh);
  transition: box-shadow var(--tr2);
}

.card:hover {
  box-shadow: var(--sh2);
}

.c-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.c-title {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--text);
}

.c-sub {
  font-size: var(--fs-xs);
  color: var(--text3);
  margin-top: 2px;
}

/* ââââââââââââââââââââââââââââââââââ
   STAT CARDS (Reference image style)
ââââââââââââââââââââââââââââââââââ */
.sg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.sc {
  background: var(--bg-c);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 24px 20px;
  box-shadow: var(--sh);
  transition: all var(--tr2);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sc:hover {
  box-shadow: var(--sh2);
  transform: translateY(-1px);
}

.sc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sc-lbl {
  font-size: 12.5px;
  color: var(--text3);
  font-weight: 500;
}

.sc-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  background: var(--brand-lt) !important;
  color: var(--brand) !important;
  border: 1px solid var(--brand-lt);
}

.sc-val {
  font-size: 42px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  margin: 10px 0 10px;
}

.sc-trend {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.tr-up {
  color: var(--success);
}

.tr-dn {
  color: var(--danger);
}

.tr-nt {
  color: var(--warning);
}

.sc-trend-sub {
  font-size: 10.5px;
  color: var(--text3);
  margin-top: 1px;
}

/* ââââââââââââââââââââââââââââââââââ
   QUICK ACTIONS (Reference image style)
ââââââââââââââââââââââââââââââââââ */
.qa-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.qa-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--bg-c);
  border-radius: var(--r2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--tr2);
  min-width: 90px;
  box-shadow: var(--sh);
}

.qa-item:hover {
  box-shadow: var(--sh2);
  transform: translateY(-2px);
  border-color: var(--brand);
}

.qa-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--bg) !important;
  color: var(--brand) !important;
}
  /* Brand color icons */
}

.qa-lbl {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

/* ââââââââââââââââââââââââââââââââââ
   TABLE
ââââââââââââââââââââââââââââââââââ */
.tw {
  overflow-x: auto;
  border-radius: var(--r2);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 18px 20px;
  text-align: right;
  font-size: var(--fs-sm);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--brand);
  background: var(--bg-c);
  border-bottom: 2px solid var(--border);
  vertical-align: middle;
}

body.ltr thead th {
  text-align: left;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--tr);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--brand-lt);
}

tbody td {
  padding: 20px 20px;
  font-size: var(--fs-base);
  color: var(--text);
  vertical-align: middle;
  font-weight: 700;
}

.tw.compact tbody td {
  padding: 12px 20px;
  font-size: var(--fs-sm);
}

.tw.compact thead th {
  padding: 12px 20px;
  font-size: var(--fs-xs);
}

/* ââââââââââââââââââââââââââââââââââ
   AVATAR
ââââââââââââââââââââââââââââââââââ */
.av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

.av-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* ââââââââââââââââââââââââââââââââââ
   BADGES
ââââââââââââââââââââââââââââââââââ */
.bdg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--rf);
  font-size: 11px;
  font-weight: 800;
  white-space: normal;
  text-align: center;
  line-height: 1.4;
  width: fit-content;
  flex-shrink: 0;
}

.bdg-ok {
  background: var(--success-bg);
  color: var(--success);
}

.bdg-dn {
  background: var(--danger-bg);
  color: var(--danger);
}

.bdg-w {
  background: var(--warning-bg);
  color: var(--warning);
}

.bdg-i {
  background: var(--info-bg);
  color: var(--info);
}

.bdg-b {
  background: var(--brand-lt);
  color: var(--brand);
}

.bdg-m {
  background: var(--bg);
  color: var(--text2);
  border: 1px solid var(--border);
}

/* ââââââââââââââââââââââââââââââââââ
   PROGRESS BARS
   ââââââââââââââââââââââââââââââââââ */
.pb {
  height: 8px;
  background: var(--bg-s);
  border-radius: var(--rf);
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.05);
}

body.dark-mode .pb {
  background: rgba(255, 255, 255, 0.05);
}

.pf {
  height: 100%;
  border-radius: var(--rf);
  transition: width 0.4s ease;
  background: var(--grad-brand);
}

/* ââââââââââââââââââââââââââââââââââ
   TOGGLE SWITCH
   ââââââââââââââââââââââââââââââââââ */
.tg-grp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.tg-grp:last-child {
  border-bottom: none;
}

.tg-info {
  flex: 1;
}

.tg-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.tg-desc {
  font-size: 11.5px;
  color: var(--text3);
  margin-top: 2px;
}

.sw {
  position: relative;
  width: 42px;
  height: 23px;
  flex-shrink: 0;
}

.sw input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sl {
  position: absolute;
  inset: 0;
  background: var(--border2);
  border-radius: var(--rf);
  cursor: pointer;
  transition: all var(--tr);
}

.sl::before {
  content: '';
  position: absolute;
  width: 17px;
  height: 17px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: all var(--tr);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.sw input:checked+.sl {
  background: var(--brand);
}

.sw input:checked+.sl::before {
  transform: translateX(19px);
}

/* ââââââââââââââââââââââââââââââââââ
   FORMS
ââââââââââââââââââââââââââââââââââ */
.fg {
  margin-bottom: 14px;
}

.fl {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 5px;
}

.fi {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: all var(--tr);
  outline: none;
  text-align: center;
}

.fi:focus {
  border-color: var(--brand3);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(44, 120, 115, .12);
}

.fi::placeholder {
  color: var(--text3);
}

.fsel {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: all var(--tr);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236B7A8D' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 11px center;
  padding-left: 30px;
  text-align: center;
  text-align-last: center;
}

body.rtl .fsel {
  background-position: left 11px center;
  padding-right: 12px;
}

body.ltr .fsel {
  background-position: right 11px center;
  padding-right: 30px;
}

.fsel:focus {
  border-color: var(--brand3);
  background-color: #fff;
}

.fr {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

/* ââââââââââââââââââââââââââââââââââ
   PROGRESS
ââââââââââââââââââââââââââââââââââ */
.pb {
  height: 6px;
  background: var(--bg);
  border-radius: var(--rf);
  overflow: hidden;
  border: 1px solid var(--border);
}

.pf {
  height: 100%;
  border-radius: var(--rf);
  background: var(--grad-brand);
  transition: width .8s ease;
}

/* ââââââââââââââââââââââââââââââââââ
   TABS
ââââââââââââââââââââââââââââââââââ */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 3px;
  width: fit-content;
  margin-bottom: 18px;
}

.tab {
  padding: 6px 16px;
  border-radius: var(--rs);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--tr);
}

.tab.act {
  background: #fff;
  color: var(--brand);
  font-weight: 700;
  box-shadow: var(--sh);
}

.tab:hover:not(.act) {
  color: var(--text);
}

/* ââââââââââââââââââââââââââââââââââ
   MODAL
ââââââââââââââââââââââââââââââââââ */
.ov {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 20px;
}

.ov.open {
  display: flex;
  animation: fadeIn .2s ease;
}

.modal {
  background: var(--bg-c);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  width: 100%;
  max-width: 1200px; /* Increased for better flexibility */
  width: fit-content;
  min-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
  display: flex;
  flex-direction: column;
  animation: slideUp .25s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(18px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.m-hd {
  padding: 24px 32px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

#modal-header-actions {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 15px;
}

body.ltr #modal-header-actions {
  justify-content: flex-end;
}

.m-close {
  width: 30px;
  height: 30px;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--tr);
}

.m-close:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(239, 68, 68, .3);
}

.m-bd {
  padding: 24px 32px;
  overflow-y: auto;
  flex: 1;
}

.m-ft {
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ââââââââââââââââââââââââââââââââââ
   GRIDS
ââââââââââââââââââââââââââââââââââ */
.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.g3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.ga {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
}

/* ââââââââââââââââââââââââââââââââââ
   FILTERS / CHIPS
ââââââââââââââââââââââââââââââââââ */
.fbar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.chip {
  padding: 6px 14px;
  border-radius: var(--rf);
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  transition: all var(--tr);
}

.chip:hover,
.chip.act {
  background: var(--brand-lt);
  border-color: var(--brand3);
  color: var(--brand);
}

/* ââââââââââââââââââââââââââââââââââ
   LIVE DOT
ââââââââââââââââââââââââââââââââââ */
.ldot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .4);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(34, 197, 94, .0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .0);
  }
}

/* ââââââââââââââââââââââââââââââââââ
   ACTIVITY FEED
ââââââââââââââââââââââââââââââââââ */
.af-i {
  display: flex;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.af-i:last-child {
  border-bottom: none;
}

.af-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.af-txt {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.af-time {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

/* ââââââââââââââââââââââââââââââââââ
   APPROVAL CHAIN
ââââââââââââââââââââââââââââââââââ */
.apc {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ap-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.ap-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid;
}

.ap-done {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
}

.ap-pend {
  border-color: var(--warning);
  background: var(--warning-bg);
  color: var(--warning);
}

.ap-wait {
  border-color: var(--border2);
  background: var(--bg);
  color: var(--text3);
}

.ap-lbl {
  font-size: 9.5px;
  color: var(--text3);
  text-align: center;
}

.ap-con {
  flex: 1;
  height: 2px;
  background: var(--border);
  max-width: 50px;
}

.ap-con.done {
  background: var(--success);
}

/* ââââââââââââââââââââââââââââââââââ
   DONUT CHART
ââââââââââââââââââââââââââââââââââ */
.donut-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.donut {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(#1B4F5E 0% 60%, #2C7873 60% 80%, #4DB6AC 80% 100%);
  position: relative;
}

.donut::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #fff;
}

.d-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  text-align: center;
}

.d-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.d-lbl {
  font-size: 9px;
  color: var(--text3);
}

/* ââââââââââââââââââââââââââââââââââ
   MAP
ââââââââââââââââââââââââââââââââââ */
.map-box {
  background: #EEF6F5;
  border-radius: var(--r2);
  overflow: hidden;
  position: relative;
  height: 260px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--text3);
}

.map-grid-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(27, 79, 94, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 79, 94, .05) 1px, transparent 1px);
  background-size: 28px 28px;
}

.map-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(44, 120, 115, .2) 0%, transparent 70%);
  animation: pulse 3s ease infinite;
}

.map-pin-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: var(--brand);
  border-radius: 50%;
  border: 3px solid rgba(27, 79, 94, .3);
  box-shadow: 0 0 0 8px rgba(27, 79, 94, .1);
}

/* ââââââââââââââââââââââââââââââââââ
   CHART BARS
ââââââââââââââââââââââââââââââââââ */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding-top: 12px;
}

.cb {
  flex: 1;
  border-radius: 5px 5px 0 0;
  background: var(--grad-brand);
  opacity: .8;
  transition: all var(--tr);
  cursor: pointer;
  min-height: 10px;
}

.cb:hover {
  opacity: 1;
}

.cb.acc {
  background: linear-gradient(135deg, #22C55E, #16A34A);
}

.chart-lbls {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.chart-lbl {
  flex: 1;
  text-align: center;
  font-size: 10.5px;
  color: var(--text3);
}

/* ââââââââââââââââââââââââââââââââââ
   DEVICE CARD
ââââââââââââââââââââââââââââââââââ */
.dvc {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.dvc-ic {
  width: 34px;
  height: 34px;
  border-radius: var(--r);
  background: var(--info-bg);
  color: var(--info);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.dvc-id {
  font-size: 11px;
  font-family: monospace;
  color: var(--text3);
  margin-top: 2px;
}

/* ââââââââââââââââââââââââââââââââââ
   SYNC ROW
ââââââââââââââââââââââââââââââââââ */
.sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--r);
  margin-bottom: 7px;
  border: 1px solid var(--border);
  transition: background var(--tr);
}

.sync-row:hover {
  background: var(--brand-lt);
}

.sync-inf {
  flex: 1;
  margin: 0 10px;
}

.sync-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.sync-det {
  font-size: 10.5px;
  color: var(--text3);
  margin-top: 2px;
}

/* ââââââââââââââââââââââââââââââââââ
   NOTIFICATION PANEL
ââââââââââââââââââââââââââââââââââ */
.notif-panel {
  position: fixed;
  top: var(--hh);
  left: 16px;
  width: 310px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  z-index: 500;
  box-shadow: var(--sh2);
  display: none;
  animation: slideDown .2s ease;
}

.notif-panel.open {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

body.rtl .notif-panel {
  left: 16px;
  right: auto;
}

.notif-list {
  max-height: 480px;
  overflow-y: auto;
}

.notif-item {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 14px;
  cursor: pointer;
  transition: all var(--tr);
  position: relative;
}

.notif-item:hover {
  background: var(--bg);
  transform: scale(0.99);
}

.notif-item.unread::before {
  content: '';
  position: absolute;
  top: 16px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand3);
  box-shadow: 0 0 8px var(--brand3);
}

body.ltr .notif-item.unread::before {
  right: auto;
  left: 8px;
}

.notif-ic-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--bg-s);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: var(--tr);
}

.notif-item:hover .notif-ic-wrap {
  background: var(--brand-lt);
  border-color: var(--brand3);
  transform: rotate(-5deg);
}

.notif-content {
  flex: 1;
}

.notif-item-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.notif-item-body {
  font-size: 13px;
  color: var(--text2);
  margin-top: 4px;
  font-weight: 600;
  line-height: 1.4;
}

.notif-item-time {
  font-size: 11px;
  color: var(--text3);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}


@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
    width: var(--sw) !important;
    box-shadow: var(--sh2);
  }

  body.ltr .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mob-open {
    transform: translateX(0);
  }

  .main,
  .main.col {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  .sg {
    grid-template-columns: repeat(2, 1fr);
  }

  .g2,
  .g3 {
    grid-template-columns: 1fr;
  }

  .searchbar {
    display: none;
  }

  .page {
    padding: 14px;
  }

  .qa-grid {
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .sg {
    grid-template-columns: 1fr;
  }
}

/* ââââââââââââââââââââââââââââââââââ
   LTR â Sidebar LEFT
ââââââââââââââââââââââââââââââââââ */
body.ltr .sidebar {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--border);
}

body.ltr .main {
  margin-right: 0;
  margin-left: var(--sw);
}

body.ltr .main.col {
  margin-left: var(--swc);
}

body.ltr .notif-panel {
  left: auto;
  right: 16px;
}

body.ltr .notif-item.unread {
  border-right: none;
  border-left: 3px solid var(--brand);
}

body.ltr table thead th {
  text-align: left;
}

body.ltr .nav-tip {
  right: auto;
  left: calc(100% + 8px);
}

body.ltr .fsel {
  background-position: right 11px center;
  padding-left: 12px;
  padding-right: 30px;
}

body.ltr .h-left {
  flex-direction: row-reverse;
}

body.ltr .h-right {
  flex-direction: row-reverse;
}

body.ltr .sc-top {
  flex-direction: row-reverse;
}

body.ltr .pg-greet,
body.ltr .pg-date {
  text-align: left;
}

body.ltr .ph {
  flex-direction: row;
}

body.ltr .ph-actions {
  margin-right: auto;
  margin-left: 0;
}

body.ltr .c-hd {
  flex-direction: row;
}

body.ltr .av-row {
  flex-direction: row;
}

body.ltr .qa-grid {
  flex-direction: row;
}

body.ltr .chart-bars {
  flex-direction: row;
}

body.ltr .sync-row {
  flex-direction: row;
}

body.ltr .sync-inf {
  margin: 0 10px;
}

/* ââââââââââââââââââââââââââââââââââ
   DARK MODE â FULLY WORKING
ââââââââââââââââââââââââââââââââââ */
body.dark-mode {
  --bg: #0F1923;
  --bg-s: #151F2C;
  --bg-c: #1A2535;
  --sidebar-bg: #131D2A;
  --header-bg: #131D2A;
  --text: #E8EDF2;
  --text2: #8FA0B4;
  --text3: #556576;
  --white: #E8EDF2;
  --border: #1F2E3D;
  --border2: #2A3F55;
  --glass: rgba(255, 255, 255, 0.04);
  --glass2: rgba(255, 255, 255, 0.08);
  --brand-lt: rgba(44, 120, 115, 0.18);
  --success-bg: rgba(34, 197, 94, 0.12);
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info-bg: rgba(59, 130, 246, 0.12);
}

body.dark-mode .card {
  background: var(--bg-c);
  border-color: var(--border);
}

body.dark-mode .sc {
  background: var(--bg-c);
  border-color: var(--border);
}

body.dark-mode .modal {
  background: #1A2535;
  border-color: var(--border);
}

body.dark-mode .ov {
  background: rgba(0, 0, 0, 0.65);
}

body.dark-mode tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .chip {
  background: var(--bg-c);
  border-color: var(--border2);
  color: var(--text2);
}

body.dark-mode .chip.act,
body.dark-mode .chip:hover {
  background: var(--brand-lt);
  border-color: var(--brand3);
  color: var(--brand3);
}

body.dark-mode .fi,
body.dark-mode .fsel {
  background: var(--bg);
  border-color: var(--border2);
  color: var(--text);
}

body.dark-mode .fi:focus,
body.dark-mode .fsel:focus {
  background: var(--bg-c);
  border-color: var(--brand3);
}

body.dark-mode .btn-s {
  background: var(--bg-c);
  border-color: var(--border2);
  color: var(--text2);
}

body.dark-mode .btn-s:hover {
  background: var(--brand-lt);
  border-color: var(--brand3);
  color: var(--brand3);
}

body.dark-mode .notif-panel {
  background: #1A2535;
  border-color: var(--border);
}

body.dark-mode thead th {
  background: var(--bg);
  border-color: var(--border);
}

body.dark-mode tbody tr {
  border-color: var(--border);
}

body.dark-mode .donut::after {
  background: var(--bg-c);
}

body.dark-mode .map-box {
  background: #101922;
  border-color: var(--border);
}

body.dark-mode .dvc {
  background: var(--bg);
  border-color: var(--border);
}

body.dark-mode .sync-row {
  background: var(--bg);
  border-color: var(--border);
}

body.dark-mode .pb {
  background: var(--bg);
  border-color: var(--border2);
}

body.dark-mode .tabs {
  background: var(--bg);
  border-color: var(--border);
}

body.dark-mode .tab.act {
  background: var(--bg-c);
}

body.dark-mode .h-toggle {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text2);
}

body.dark-mode .hbtn {
  background: var(--bg);
  border-color: var(--border);
}

body.dark-mode .lang-btn {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text2);
}

body.dark-mode .theme-btn {
  background: var(--bg);
  border-color: var(--border);
}

body.dark-mode .searchbar {
  background: var(--bg);
  border-color: var(--border);
}

body.dark-mode .h-profile {
  background: var(--bg);
  border-color: var(--border);
}

body.dark-mode .sb-user:hover {
  transform: translateY(-2px);
}

body.dark-mode .nav-i:hover:not(.act) {
  transform: translateX(-4px);
}

body.dark-mode .af-i {
  border-color: var(--border);
}

body.dark-mode .tg-grp {
  border-color: var(--border);
}

/* ââââââââââââââââââââââââââââââââââ
   KPI CARDS
ââââââââââââââââââââââââââââââââââ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi {
  background: var(--bg-c);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 20px;
  box-shadow: var(--sh);
  transition: all var(--tr2);
  position: relative;
  overflow: hidden;
}

.kpi:hover {
  box-shadow: var(--sh2);
  transform: translateY(-2px);
}

.kpi::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  border-radius: 0 var(--r2) 0 60px;
  opacity: .08;
}

.kpi-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.kpi-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.kpi-lbl {
  font-size: 12.5px;
  color: var(--text3);
  margin-top: 5px;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--rf);
  margin-top: 8px;
}

.kpi-up {
  background: var(--success-bg);
  color: var(--success);
}

.kpi-down {
  background: var(--danger-bg);
  color: var(--danger);
}

.kpi-flat {
  background: var(--warning-bg);
  color: var(--warning);
}

.logout-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logout-btn:hover {
    background: rgba(255,77,77,0.1);
    color: #ff4d4d;
}
.logout-btn i { width: 18px; height: 18px; }

/* ══════════════════════════════════════════════════════════════════ 
   SVG / INLINE CHART (Canvas-free)
══════════════════════════════════════════════════════════════════  */
.chart-svg-wrap {
  width: 100%;
  overflow: visible;
}

.chart-line {
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  opacity: .15;
}

.chart-dot {
  r: 4;
}

/* ââââââââââââââââââââââââââââââââââ
   SPIN ANIMATION
ââââââââââââââââââââââââââââââââââ */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spin-loader {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto;
}

/* ââââââââââââââââââââââââââââââââââ
   MINI TREND LINE (sparkline)
ââââââââââââââââââââââââââââââââââ */
.spark {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
  margin-top: 6px;
}

.spark-bar {
  width: 4px;
  border-radius: 2px;
  background: var(--brand3);
  opacity: .6;
  transition: opacity var(--tr);
  min-height: 3px;
}

.spark-bar:hover {
  opacity: 1;
}

/* ââââââââââââââââââââââââââââââââââ
   GAUGE / RING CHART
ââââââââââââââââââââââââââââââââââ */
.gauge-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.gauge-svg {
  width: 90px;
  height: 90px;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.gauge-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dasharray .8s ease;
}

.gauge-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

.gauge-sub {
  font-size: 9px;
  color: var(--text3);
  display: block;
}
/* === PREMIUM PROFILE UI (NEW & MODERN) === */
.premium-profile { background: var(--bg-c); color: var(--text); position:relative; overflow:hidden; border-radius: var(--r2); }
.prof-hero { position: relative; padding: 45px 30px; color: #fff; overflow: hidden; border-radius: var(--r2) var(--r2) 0 0; }
.prof-hero-bg { position: absolute; top:0; left:0; right:0; bottom:0; z-index: 1; filter: brightness(0.7); background-size: cover; background-position: center; }
.prof-hero-content { position: relative; z-index: 2; display: flex; align-items: center; gap: 30px; }
.prof-avatar-big { width: 110px; height: 110px; border-radius: var(--r2); display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 900; box-shadow: 0 10px 40px rgba(0,0,0,0.4); border: 5px solid rgba(255,255,255,0.25); color: #fff; }
.prof-name-title { font-size: 34px; font-weight: 950; margin: 0; color: #fff; text-shadow: 0 3px 15px rgba(0,0,0,0.3); }
.prof-job-title { font-size: 18px; font-weight: 800; opacity: 0.95; margin-top: 6px; }
.prof-quick-contact { display: flex; gap: 20px; font-size: 14px; margin-top: 15px; opacity: 0.85; }

.prof-kpi-bar { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg-s); border-bottom: 1px solid var(--border); padding: 20px 10px; box-shadow: inset 0 -2px 10px rgba(0,0,0,0.02); }
.kpi-mini { text-align: center; border-left: 1px solid var(--border); }
[dir="rtl"] .kpi-mini { border-left: none; border-right: 1px solid var(--border); }
[dir="rtl"] .kpi-mini:first-child { border-right: none; }
.kpi-mini-val { font-size: 24px; font-weight: 900; color: var(--brand); line-height: 1; margin-bottom: 5px; }
.kpi-mini-lbl { font-size: 12px; font-weight: 800; color: var(--text3); text-transform: uppercase; }

.prof-nav-tabs { display: flex; background: var(--bg-s); padding: 8px 15px; gap: 8px; border-bottom: 2px solid var(--border); position: sticky; top: 0; z-index: 10; }
.nav-tab-btn { padding: 12px 20px; border: none; background: none; color: var(--text3); font-weight: 900; font-size: 14px; cursor: pointer; border-radius: var(--r); transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; gap: 10px; border: 1px solid transparent; }
.nav-tab-btn.act { background: var(--brand); color: #fff; box-shadow: 0 5px 15px rgba(27, 79, 94, 0.3); }
.nav-tab-btn:hover:not(.act) { background: var(--brand-lt); color: var(--brand); border-color: var(--brand-lt); }

.prof-content-scroll { padding: 30px; max-height: 600px; overflow-y: auto; background: var(--bg-c); }
.data-section { background: var(--bg-s); border-radius: var(--r2); padding: 25px; border: 1px solid var(--border); box-shadow: 0 4px 20px rgba(0,0,0,0.03); }
.section-title { font-size: 17px; font-weight: 900; color: var(--brand); margin-bottom: 25px; letter-spacing: -0.5px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.data-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.data-item { display: flex; flex-direction: column; gap: 6px; }
.data-item label { font-size: 12px; font-weight: 800; color: var(--text3); opacity: 0.8; }
.data-item span { font-size: 15px; font-weight: 900; color: var(--text); }

.modern-timeline { border-right: 3px solid var(--brand-lt); margin-right: 15px; padding-right: 25px; }
[dir="ltr"] .modern-timeline { border-right: none; border-left: 3px solid var(--brand-lt); margin-left: 15px; padding-left: 25px; }
.mt-item { position: relative; margin-bottom: 30px; }
.mt-dot { position: absolute; right: -33px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); border: 4px solid var(--bg-s); box-shadow: 0 0 10px rgba(27, 79, 94, 0.3); }
[dir="ltr"] .mt-dot { left: -33px; right: auto; }


.modern-doc-list { display: grid; gap: 12px; }
.doc-item { display: flex; align-items: center; gap: 18px; padding: 15px; background: var(--bg-c); border-radius: var(--r); border: 1px solid var(--border); transition: 0.2s; }
.doc-item:hover { border-color: var(--brand); background: var(--brand-lt); }
.doc-icon { width: 45px; height: 45px; background: var(--brand-lt); color: var(--brand); border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-weight: 950; font-size: 12px; box-shadow: inset 0 0 10px rgba(0,0,0,0.05); }

.slide-in { animation: slideInModern 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards; }
@keyframes slideInModern { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
.empty-state { padding: 60px; text-align: center; color: var(--text3); font-weight: 900; font-size: 16px; border: 3px dashed var(--border); border-radius: 20px; background: var(--bg-lt); }

body.dark-mode .premium-profile { background: #0f172a; }
body.dark-mode .data-section, body.dark-mode .prof-kpi-bar, body.dark-mode .prof-nav-tabs { background: #1e293b; border-color: #334155; }
body.dark-mode .nav-tab-btn:hover:not(.act) { background: #334155; color: #fff; }
body.dark-mode .section-title { color: #38bdf8; border-color: #334155; }

/* ââââââââââââââââââââââââââââââââââ
   CUSTOM CONFIRM DIALOG (PREMIUM)
   ââââââââââââââââââââââââââââââââââ */
.confirm-ov {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.confirm-box {
  background: var(--bg-c);
  border-radius: var(--r2);
  width: 400px;
  padding: 32px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.4);
  text-align: center;
  border: 1px solid var(--border);
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cb-ic { font-size: 50px; margin-bottom: 20px; display:block; }
.cb-tt { font-size: 19px; font-weight: 800; color: var(--text); margin-bottom: 12px; }
.cb-txt { font-size: 14.5px; color: var(--text3); line-height: 1.6; margin-bottom: 28px; }
.cb-btns { display: flex; flex-direction: column; gap: 12px; }
.cb-btns .btn { width: 100%; border-radius: var(--r); padding: 12px; font-weight: 700; }

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ââââââââââââââââââââââââââââââââââ
   FIELD PROJECTS UI
   ââââââââââââââââââââââââââââââââââ */
.modern-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.project-card {
  background: var(--bg-c);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
  border-color: var(--brand);
}

.pc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.pc-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--rs);
  text-transform: uppercase;
}

.pc-badge.active { background: #d1fae5; color: #065f46; }
.pc-id { font-size: 11px; color: var(--text3); font-weight: 600; }

.pc-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.4;
}

.pc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  background: var(--bg-s);
  padding: 15px;
  border-radius: var(--r);
  margin-bottom: 25px;
}

.pc-stat {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pc-icon { font-size: 20px; }

.pc-stat-info strong { display: block; font-size: 15px; color: var(--text); }
.pc-stat-info span { font-size: 11px; color: var(--text3); font-weight: 600; }

.pc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 15px;
}

.pc-manager { display: flex; align-items: center; gap: 10px; }
.pc-m-avatar {
  width: 34px; height: 34px;
  background: var(--brand-lt);
  color: var(--brand);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 12px;
}

.pc-m-info label { display: block; font-size: 10px; color: var(--text3); font-weight: 700; margin-bottom: 1px; }
.pc-m-info strong { font-size: 13px; color: var(--text); font-weight: 700; }

.pc-geo-tag {
  position: absolute;
  bottom: 0px;
  right: 0px;
  left: 0px;
  background: var(--bg-lt);
  font-size: 9px;
  color: var(--text3);
  text-align: center;
  padding: 4px;
  font-family: monospace;
  opacity: 0.6;
}

/* Project Inactive Badge Style */
.pc-badge.inactive { background: #fee2e2; color: #991b1b; }

 / *   =ØÜ  L u c i d e   I c o n s   C u s t o m   S t y l i n g   * / 
 s v g . l u c i d e   { 
     w i d t h :   2 0 p x ; 
     h e i g h t :   2 0 p x ; 
     s t r o k e - w i d t h :   2 . 2 p x ; 
     s t r o k e :   c u r r e n t C o l o r ; 
     f i l l :   n o n e ; 
 } 
 
 . n a v - i c   s v g . l u c i d e   { 
     w i d t h :   1 9 p x ; 
     h e i g h t :   1 9 p x ; 
 } 
 
 . s i d e b a r . c o l   . n a v - i c   s v g . l u c i d e   { 
     w i d t h :   2 2 p x ; 
     h e i g h t :   2 2 p x ; 
 } 
 
 . h - t o g g l e   s v g . l u c i d e ,   . t h e m e - b t n   s v g . l u c i d e ,   . h b t n   s v g . l u c i d e   { 
     w i d t h :   2 0 p x ; 
     h e i g h t :   2 0 p x ; 
 } 
  
 