/* MAWJ Marine Awareness Dashboard — v4.0 */
:root {
  --navy: #0a2342;
  --navy-light: #12345c;
  --navy-dark: #061729;
  --turquoise: #00bcd4;
  --turquoise-light: #4dd0e1;
  --turquoise-dark: #0097a7;
  --sand: #f5f0e8;
  --sand-dark: #e8e0d0;
  --white: #ffffff;
  --grey-light: #f8fafc;
  --grey: #94a3b8;
  --grey-dark: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --sidebar-w: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Tajawal', 'Cairo', sans-serif;
  background: var(--grey-light);
  color: #1e293b;
  direction: rtl;
  overflow-x: hidden;
}
#app {
  overflow-x: hidden;
  width: 100%;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: var(--turquoise-dark); border-radius: 3px; }

/* =================== LOGIN =================== */
#login-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 40%, var(--turquoise-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* wave-bg animation layer */
.wave-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.wave-bg::before, .wave-bg::after {
  content: '';
  position: absolute;
  bottom: -60px;
  width: 200%;
  height: 200px;
  background: rgba(0,188,212,0.08);
  border-radius: 50%;
  animation: waveMove 8s ease-in-out infinite;
}
.wave-bg::after {
  bottom: -90px;
  background: rgba(0,188,212,0.05);
  animation-duration: 12s;
  animation-direction: reverse;
}
@keyframes waveMove { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-10%); } }

#login-screen::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300bcd4' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
  animation: bgMove 20s linear infinite;
  z-index: 0;
}
@keyframes bgMove { 0% { transform: translate(0,0); } 100% { transform: translate(60px,60px); } }

.login-card {
  background: rgba(255,255,255,0.97);
  border-radius: 20px;
  padding: 48px 40px;
  width: 420px;
  max-width: 95vw;
  box-shadow: 0 25px 80px rgba(0,0,0,0.4);
  position: relative;
  z-index: 1;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-circle {
  width: 90px; height: 90px;
  background: linear-gradient(135deg, var(--navy), var(--turquoise-dark));
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(0,188,212,0.3);
}
.login-logo h1 { font-size: 28px; font-weight: 800; color: var(--navy); }
.login-logo p { color: var(--grey-dark); font-size: 13px; }
.login-field { margin-bottom: 20px; }
.login-field label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--navy); font-size: 14px; }
.login-field input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #f8fafc;
  direction: ltr;
  text-align: right;
}
.login-field input:focus { outline: none; border-color: var(--turquoise); background: white; }

/* password toggle wrapper */
.pw-wrap { position: relative; }
.pw-wrap input { padding-left: 40px; }
.pw-toggle {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--grey);
  font-size: 14px;
  padding: 0;
}
.pw-toggle:hover { color: var(--navy); }

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--navy), var(--turquoise-dark));
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0,151,167,0.4);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,151,167,0.5); }
.login-error { background: #fee2e2; color: #dc2626; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; display: none; }

/* login hint cards */
.login-hint { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 12px; margin-top: 16px; font-size: 12px; color: #0369a1; }
.login-hint code { background: #dbeafe; padding: 1px 5px; border-radius: 3px; font-family: monospace; }
.hint-row { display: flex; gap: 6px; margin-bottom: 6px; }
.hint-row:last-child { margin-bottom: 0; }
.hint-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.admin-role { background: rgba(10,35,66,0.12); color: var(--navy); }
.emp-role { background: rgba(0,151,167,0.12); color: var(--turquoise-dark); }

/* =================== DASHBOARD LAYOUT =================== */
#dashboard { display: none; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 60%, #0d3060 100%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--turquoise), var(--turquoise-dark));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,188,212,0.4);
}
.logo-text h2 { font-size: 18px; font-weight: 800; color: white; }
.logo-text p { font-size: 10px; color: rgba(255,255,255,0.5); margin-top: 1px; }

/* sidebar version label */
.sidebar-version {
  font-size: 9px;
  color: rgba(255,255,255,0.25);
  padding: 4px 20px 0;
  letter-spacing: 0.5px;
}

.sidebar-user {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--turquoise-light);
  flex-shrink: 0;
}
/* admin avatar gets gold tint, employee gets teal */
.admin-avatar { background: rgba(245,158,11,0.2) !important; color: #fbbf24 !important; }
.emp-avatar   { background: rgba(0,188,212,0.2) !important;  color: var(--turquoise-light) !important; }

.user-info h4 { font-size: 13px; font-weight: 600; color: white; }
.user-info p  { font-size: 11px; color: rgba(255,255,255,0.5); }

/* user role pill shown under name */
.user-role-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-top: 3px;
}
.user-role-label.admin { background: rgba(245,158,11,0.25); color: #fbbf24; }
.user-role-label.emp   { background: rgba(0,188,212,0.2);   color: var(--turquoise-light); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1px;
  padding: 16px 20px 6px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  cursor: pointer;
  transition: all 0.2s;
  color: rgba(255,255,255,0.65);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active {
  background: rgba(0,188,212,0.15);
  color: var(--turquoise-light);
  border-right: 3px solid var(--turquoise);
}
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-right: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}
/* lock icon for restricted nav items (employee view) */
.nav-item .nav-lock { margin-right: auto; color: rgba(255,255,255,0.25); font-size: 12px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.btn-logout {
  width: 100%;
  padding: 10px;
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-logout:hover { background: rgba(239,68,68,0.25); color: #f87171; }

/* MAIN CONTENT */
.main-content {
  margin-right: var(--sidebar-w);
  margin-left: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-w));
  overflow-x: hidden;
  box-sizing: border-box;
  width: calc(100% - var(--sidebar-w));
}
.topbar {
  background: white;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title h2 { font-size: 18px; font-weight: 700; color: var(--navy); }
.topbar-title p  { font-size: 12px; color: var(--grey); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-dark);
  font-size: 14px;
  transition: all 0.2s;
  position: relative;
}
.topbar-btn:hover { background: var(--sand); border-color: var(--turquoise); color: var(--turquoise); }

/* topbar notification badge */
.topbar-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 10px;
  line-height: 1;
  min-width: 16px;
  text-align: center;
}
/* badge on a button element */
.badge-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.badge-btn .topbar-badge { top: -6px; left: -6px; }

.topbar-date { font-size: 13px; color: var(--grey); background: var(--sand); padding: 6px 12px; border-radius: 8px; }

.page-content { flex: 1; padding: 28px; width: 100%; box-sizing: border-box; overflow-x: hidden; }

/* =================== NO-ACCESS PAGE =================== */
.no-access-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  color: var(--grey-dark);
  padding: 40px;
}
.no-access-icon {
  width: 90px; height: 90px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--grey);
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.no-access-page h2 { font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.no-access-page p  { font-size: 14px; color: var(--grey-dark); max-width: 340px; }

/* =================== KPI CARDS =================== */
.kpi-grid { display: grid; gap: 16px; }
.kpi-grid-5 { grid-template-columns: repeat(5, 1fr); }
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }

.kpi-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.kpi-card.navy::before     { background: linear-gradient(90deg, var(--navy), var(--navy-light)); }
.kpi-card.turquoise::before{ background: linear-gradient(90deg, var(--turquoise-dark), var(--turquoise-light)); }
.kpi-card.success::before  { background: linear-gradient(90deg, #059669, #34d399); }
.kpi-card.warning::before  { background: linear-gradient(90deg, #d97706, #fbbf24); }
.kpi-card.danger::before   { background: linear-gradient(90deg, #dc2626, #f87171); }
.kpi-card.info::before     { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.kpi-card.purple::before   { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

.kpi-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.kpi-card.navy .kpi-icon     { background: rgba(10,35,66,0.1);    color: var(--navy); }
.kpi-card.turquoise .kpi-icon{ background: rgba(0,188,212,0.1);   color: var(--turquoise-dark); }
.kpi-card.success .kpi-icon  { background: rgba(16,185,129,0.1);  color: #059669; }
.kpi-card.warning .kpi-icon  { background: rgba(245,158,11,0.1);  color: #d97706; }
.kpi-card.danger .kpi-icon   { background: rgba(239,68,68,0.1);   color: #dc2626; }
.kpi-card.info .kpi-icon     { background: rgba(59,130,246,0.1);  color: #2563eb; }
.kpi-card.purple .kpi-icon   { background: rgba(124,58,237,0.1);  color: #7c3aed; }

.kpi-data { flex: 1; min-width: 0; }
.kpi-data .value { font-size: 22px; font-weight: 800; color: var(--navy); line-height: 1.2; }
.kpi-data .label { font-size: 12px; color: var(--grey-dark); margin-top: 3px; }
.kpi-data .trend { font-size: 11px; margin-top: 5px; font-weight: 600; }
.trend-up   { color: var(--success); }
.trend-down { color: var(--danger); }

/* =================== CHARTS & SECTIONS =================== */
.section-card {
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
}
.section-header {
  padding: 18px 22px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.section-title { font-size: 16px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--turquoise-dark); }
.section-body { padding: 22px; }
.chart-container { position: relative; height: 260px; }

/* =================== TABLES =================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: white;
  padding: 12px 14px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  font-size: 12.5px;
}
thead th:first-child { border-radius: 0 8px 0 0; }
thead th:last-child  { border-radius: 8px 0 0 0; }
tbody tr { transition: background 0.15s; }
tbody tr:nth-child(even) { background: #f8fafc; }
tbody tr:hover { background: #f0f9ff; }
tbody td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }
.table-actions { display: flex; gap: 6px; }

/* totals row styling */
.totals-row td { background: linear-gradient(135deg, #eff6ff, #dbeafe) !important; font-weight: 700; color: var(--navy) !important; border-top: 2px solid var(--info); }
.table-total { font-weight: 800; color: var(--navy); }

/* toolbar above a table */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 22px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

/* pending row (unapproved record) */
.pending-row td { background: #fffbeb !important; }
.pending-row:hover td { background: #fef3c7 !important; }

.btn-tbl {
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.btn-edit   { background: rgba(59,130,246,0.1);  color: #2563eb; }
.btn-edit:hover   { background: rgba(59,130,246,0.2); }
.btn-delete { background: rgba(239,68,68,0.1);   color: #dc2626; }
.btn-delete:hover { background: rgba(239,68,68,0.2); }
.btn-view   { background: rgba(16,185,129,0.1);  color: #059669; }
.btn-view:hover   { background: rgba(16,185,129,0.2); }

/* =================== BADGES =================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-active, .badge-success, .badge-signed, .badge-approved { background: #dcfce7; color: #15803d; }
.badge-warning, .badge-review, .badge-draft { background: #fef3c7; color: #92400e; }
.badge-danger, .badge-expired, .badge-delayed { background: #fee2e2; color: #991b1b; }
.badge-info, .badge-submitted, .badge-progress { background: #dbeafe; color: #1d4ed8; }
.badge-navy, .badge-completed { background: #e0e7ff; color: #3730a3; }
.badge-grey, .badge-not-started { background: #f1f5f9; color: #64748b; }
.badge-turquoise, .badge-active-project { background: #cffafe; color: #0e7490; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
/* new amber pending badge */
.badge-pending { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

/* =================== ALERTS =================== */
.alert-card {
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  border: 1px solid;
}
.alert-danger  { background: #fff5f5; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-card .alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-card .alert-text h4 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.alert-card .alert-text p  { font-size: 12px; opacity: 0.8; }

/* =================== BUTTONS =================== */
.btn {
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-primary  { background: var(--navy);         color: white; }
.btn-primary:hover  { background: var(--navy-light); }
.btn-success  { background: var(--success);      color: white; }
.btn-success:hover  { background: #059669; }
.btn-info     { background: var(--info);          color: white; }
.btn-info:hover     { background: #2563eb; }
.btn-turquoise{ background: var(--turquoise-dark); color: white; }
.btn-turquoise:hover{ background: var(--turquoise); }
.btn-warning  { background: var(--warning);      color: white; }
.btn-warning:hover  { background: #d97706; }
.btn-danger   { background: var(--danger);       color: white; }
.btn-danger:hover   { background: #dc2626; }
.btn-outline  { background: white; color: var(--navy); border: 1.5px solid #e2e8f0; }
.btn-outline:hover  { border-color: var(--turquoise); color: var(--turquoise-dark); }

/* Excel / PDF export buttons */
.btn-excel {
  background: linear-gradient(135deg, #1a7f37, #2da44e);
  color: white;
  border: none;
}
.btn-excel:hover { background: linear-gradient(135deg, #116329, #1a7f37); box-shadow: 0 4px 12px rgba(26,127,55,0.3); }
.btn-excel-outline {
  background: white;
  color: #1a7f37;
  border: 1.5px solid #2da44e;
}
.btn-excel-outline:hover { background: #f0fdf4; }
.btn-pdf {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  color: white;
  border: none;
}
.btn-pdf:hover { background: linear-gradient(135deg, #962d22, #c0392b); box-shadow: 0 4px 12px rgba(192,57,43,0.3); }

/* size variants */
.btn-xs { padding: 4px 8px;  font-size: 11px; border-radius: 5px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.mt-1   { margin-top: 4px; }

/* =================== TABS =================== */
/* Generic tab bar */
.tab-bar { display: flex; gap: 0; border-bottom: 2px solid #f1f5f9; margin-bottom: 20px; overflow-x: auto; }
.tab-item {
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--grey-dark);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.2s;
}
.tab-item.active { color: var(--turquoise-dark); border-bottom-color: var(--turquoise-dark); }
.tab-item:hover  { color: var(--navy); }

/* Financial / Employee page tabs container */
.tabs-container { margin-bottom: 24px; }
.tabs-header {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e2e8f0;
  overflow-x: auto;
  background: white;
  border-radius: 12px 12px 0 0;
  padding: 0 16px;
}
.tab-btn {
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--grey-dark);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tab-btn:hover  { color: var(--navy); }
.tab-btn.active { color: var(--turquoise-dark); border-bottom-color: var(--turquoise-dark); background: rgba(0,188,212,0.04); }
.tab-content    { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.25s ease; }

/* =================== KANBAN =================== */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col {
  min-width: 240px;
  flex-shrink: 0;
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px;
}
.kanban-col-header {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-count {
  background: rgba(0,0,0,0.08);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.kanban-card {
  background: white;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
  border-right: 4px solid;
  transition: transform 0.2s;
}
.kanban-card:hover { transform: translateY(-2px); }
.kanban-card h4 { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.kanban-card p  { font-size: 11.5px; color: var(--grey-dark); margin-bottom: 4px; }
.kanban-card .progress-bar { height: 4px; background: #f1f5f9; border-radius: 2px; margin-top: 8px; overflow: hidden; }
.kanban-card .progress-fill { height: 100%; border-radius: 2px; }

/* =================== PROGRESS =================== */
.progress-bar-h { height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.progress-bar-h .fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.progress-bar-h .fill-turquoise { background: linear-gradient(90deg, var(--turquoise-dark), var(--turquoise-light)); }
.progress-bar-h .fill-navy      { background: linear-gradient(90deg, var(--navy), var(--navy-light)); }
.progress-bar-h .fill-success   { background: linear-gradient(90deg, #059669, #34d399); }
.progress-bar-h .fill-warning   { background: linear-gradient(90deg, #d97706, #fbbf24); }
.progress-bar-h .fill-danger    { background: linear-gradient(90deg, #dc2626, #f87171); }

/* =================== STAT ROWS =================== */
.stat-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.stat-row:last-child { border-bottom: none; }
.stat-row-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.stat-row-info { flex: 1; }
.stat-row-info h4 { font-size: 13px; font-weight: 600; color: var(--navy); }
.stat-row-info p  { font-size: 12px; color: var(--grey); }
.stat-row-value   { font-size: 15px; font-weight: 700; color: var(--navy); }

/* =================== MODAL =================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  display: none;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalIn 0.25s ease;
}
.modal-lg { max-width: 780px; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--navy); }
.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--grey-dark);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: #fee2e2; color: var(--danger); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; padding-top: 16px; border-top: 1px solid #f1f5f9; }

/* =================== FORMS =================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { margin-bottom: 16px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #f8fafc;
  color: #1e293b;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--turquoise); background: white;
}
.form-field textarea { min-height: 80px; resize: vertical; }

/* inline edit input inside a table cell */
.inline-input {
  padding: 5px 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  background: white;
  width: 100%;
}
.inline-input:focus { outline: none; border-color: var(--turquoise); }

/* =================== FILTERS =================== */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 22px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}
.filters-bar select, .filters-bar input {
  padding: 7px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  color: #1e293b;
}
.filters-bar select:focus, .filters-bar input:focus { outline: none; border-color: var(--turquoise); }
.filter-select {
  padding: 7px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  color: #1e293b;
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--turquoise); }

/* =================== IMPACT CARDS =================== */
.impact-card {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  border-radius: 16px;
  padding: 24px;
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.impact-card::after {
  content: '';
  position: absolute;
  bottom: -20px; right: -20px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.impact-card .imp-icon  { font-size: 32px; margin-bottom: 12px; opacity: 0.9; }
.impact-card .imp-value { font-size: 36px; font-weight: 800; color: var(--turquoise-light); }
.impact-card .imp-label { font-size: 13px; opacity: 0.8; margin-top: 4px; }

/* =================== STARS / SOCIAL =================== */
.stars { color: #fbbf24; font-size: 12px; }
.social-metric { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.social-metric:last-child { border-bottom: none; }
.social-metric-label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #334155; }
.social-metric-value  { font-size: 16px; font-weight: 700; color: var(--navy); }
.social-metric-change { font-size: 11px; font-weight: 600; }

/* =================== PAGE HEADER =================== */
.page-header { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-header-info h2 { font-size: 22px; font-weight: 800; color: var(--navy); }
.page-header-info p  { font-size: 13px; color: var(--grey-dark); margin-top: 3px; }
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* export section inside a page header */
.export-section { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.export-btns    { display: flex; gap: 8px; flex-wrap: wrap; }

/* =================== TOTALS BAR =================== */
.totals-bar {
  display: flex;
  gap: 24px;
  padding: 16px 22px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: white;
  flex-wrap: wrap;
}
.totals-item { text-align: center; }
.totals-item .t-value { font-size: 20px; font-weight: 800; }
.totals-item .t-label { font-size: 11px; opacity: 0.7; margin-top: 2px; }

/* =================== DETAIL GRID =================== */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.detail-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
}
.detail-row .d-label { font-size: 11px; color: var(--grey-dark); font-weight: 600; }
.detail-row .d-value { font-size: 14px; font-weight: 700; color: var(--navy); }

/* =================== EMPLOYEE CARDS =================== */
.employee-card {
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.employee-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }

.emp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.emp-header:hover { background: #f8fafc; }

.emp-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.emp-avatar-lg {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}
.emp-avatar-lg.admin-av { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; }
.emp-avatar-lg.emp-av   { background: linear-gradient(135deg, var(--turquoise), var(--turquoise-dark)); color: white; }

/* performance ring overlaid on avatar corner */
.perf-ring {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 22px;
  height: 22px;
}
.perf-score {
  position: absolute;
  bottom: -4px;
  left: -4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  border: 2px solid white;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 800;
  color: var(--turquoise-light);
  line-height: 1;
}

.emp-name { font-size: 16px; font-weight: 700; color: var(--navy); }
.emp-title { font-size: 12.5px; color: var(--grey-dark); margin-top: 2px; }
.emp-dept  { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; background: #f0f9ff; color: #0369a1; padding: 3px 8px; border-radius: 10px; margin-top: 5px; }

.emp-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.emp-status { }  /* uses badge classes */
.emp-toggle {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--grey-dark);
  transition: all 0.2s;
}
.emp-toggle:hover { background: var(--sand); color: var(--navy); }
.emp-toggle.open  { background: rgba(0,188,212,0.1); color: var(--turquoise-dark); transform: rotate(180deg); }

.emp-body {
  border-top: 1px solid #f1f5f9;
  display: none;
  animation: fadeIn 0.25s ease;
}
.emp-body.open { display: block; }

/* employee tabs inside card */
.emp-tabs {
  display: flex;
  gap: 0;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  overflow-x: auto;
  padding: 0 22px;
}
.emp-tab {
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--grey-dark);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.emp-tab:hover  { color: var(--navy); }
.emp-tab.active { color: var(--turquoise-dark); border-bottom-color: var(--turquoise-dark); background: rgba(0,188,212,0.04); }

.emp-tab-content { display: none; padding: 22px; }
.emp-tab-content.active { display: block; animation: fadeIn 0.2s ease; }

/* =================== ACHIEVEMENTS GRID =================== */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.ach-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #f1f5f9;
  transition: box-shadow 0.2s;
  position: relative;
}
.ach-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); background: white; }
.ach-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--turquoise-dark), var(--turquoise));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  margin-bottom: 10px;
}
.ach-body h4 { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 5px; }
.ach-body p  { font-size: 12px; color: var(--grey-dark); line-height: 1.5; }
.ach-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ach-kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(0,188,212,0.1);
  color: var(--turquoise-dark);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.ach-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

/* =================== APPROVALS CENTER =================== */
.approvals-list { display: flex; flex-direction: column; gap: 12px; }

.approval-item {
  background: white;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.approval-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.09); }
.approval-item.pending { border-right: 4px solid var(--warning); }
.approval-item.approved { border-right: 4px solid var(--success); }
.approval-item.rejected { border-right: 4px solid var(--danger); }
.approval-item.revision { border-right: 4px solid var(--info); }

.approval-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.approval-header-left { display: flex; align-items: center; gap: 12px; }
.approval-type-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: #f0f9ff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  color: var(--turquoise-dark);
  flex-shrink: 0;
}
.approval-title    { font-size: 14px; font-weight: 700; color: var(--navy); }
.approval-subtitle { font-size: 12px; color: var(--grey-dark); margin-top: 2px; }
.approval-meta { display: flex; align-items: center; gap: 10px; }

.approval-body {
  padding: 14px 18px;
  border-top: 1px solid #f8fafc;
  background: #f8fafc;
  font-size: 13px;
  color: #334155;
  line-height: 1.7;
}
.approval-body strong { color: var(--navy); }

.approval-footer {
  padding: 12px 18px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.approval-comment {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  color: #1e293b;
}
.approval-comment:focus { outline: none; border-color: var(--turquoise); }
.approval-comment::placeholder { color: var(--grey); }

/* =================== AUDIT LOG =================== */
.audit-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 22px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  align-items: center;
}
.audit-search {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: white;
}
.audit-search:focus { outline: none; border-color: var(--turquoise); }

/* action type color pills in audit */
.audit-action {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.audit-action.login   { background: #dbeafe; color: #1d4ed8; }
.audit-action.add     { background: #dcfce7; color: #15803d; }
.audit-action.edit    { background: #fef3c7; color: #92400e; }
.audit-action.delete  { background: #fee2e2; color: #991b1b; }
.audit-action.export  { background: #ede9fe; color: #6d28d9; }
.audit-action.perm    { background: #cffafe; color: #0e7490; }
.audit-action.approve { background: #dcfce7; color: #15803d; }

/* =================== SETTINGS & PERMISSIONS =================== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: white;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  gap: 12px;
}
.setting-item-info h4 { font-size: 14px; font-weight: 600; color: var(--navy); }
.setting-item-info p  { font-size: 12px; color: var(--grey-dark); margin-top: 2px; }
.setting-input {
  padding: 8px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #f8fafc;
  min-width: 120px;
}
.setting-input:focus { outline: none; border-color: var(--turquoise); background: white; }

/* permission employee block */
.perm-emp-block {
  background: white;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  margin-bottom: 14px;
  overflow: hidden;
}
.perm-emp-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}
.perm-emp-header h4 { font-size: 14px; font-weight: 700; color: var(--navy); }
.perm-emp-header p  { font-size: 12px; color: var(--grey-dark); }
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  padding: 16px 18px;
}

/* permission toggle pill */
.perm-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-dark);
  gap: 8px;
  transition: all 0.2s;
  user-select: none;
}
.perm-toggle:hover { background: #e2e8f0; color: var(--navy); }
.perm-toggle.active {
  background: rgba(0,188,212,0.1);
  border-color: var(--turquoise-dark);
  color: var(--turquoise-dark);
}
/* sensitive pages (financial) get a warning tint when toggled */
.perm-toggle.sensitive.active {
  background: rgba(245,158,11,0.1);
  border-color: var(--warning);
  color: #92400e;
}
.perm-toggle .pt-icon { font-size: 11px; }

/* toggle switch (on/off slider) */
.toggle-switch {
  width: 38px; height: 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
  display: inline-block;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  width: 14px; height: 14px;
  background: white;
  border-radius: 50%;
  transition: right 0.25s, left 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch.on  { background: var(--success); }
.toggle-switch.on::after  { right: 3px; left: auto; }
.toggle-switch.off { background: #cbd5e1; }
.toggle-switch.off::after { left: 3px; right: auto; }

/* =================== EXPORT CENTER =================== */
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.export-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1.5px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
  cursor: pointer;
}
.export-card:hover { border-color: var(--turquoise-dark); box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }
.export-card-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.export-card-icon.green  { background: #dcfce7; color: #15803d; }
.export-card-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.export-card-icon.navy   { background: rgba(10,35,66,0.1); color: var(--navy); }
.export-card-icon.purple { background: #ede9fe; color: #6d28d9; }
.export-card-icon.orange { background: #fff7ed; color: #c2410c; }
.export-card h4 { font-size: 14px; font-weight: 700; color: var(--navy); }
.export-card p  { font-size: 12px; color: var(--grey-dark); flex: 1; }
.export-card .export-sheets { font-size: 11px; color: var(--turquoise-dark); font-weight: 600; }

/* =================== TOAST NOTIFICATIONS =================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 360px;
  animation: toastIn 0.35s ease;
  pointer-events: auto;
  border: 1px solid transparent;
  direction: rtl;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
.toast-hide { animation: toastOut 0.35s ease forwards; }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(-20px); } }

.toast-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.toast-error   { background: #fff5f5; color: #991b1b; border-color: #fecaca; }
.toast-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.toast-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.toast-icon    { font-size: 16px; flex-shrink: 0; }

/* =================== EMPTY STATES =================== */
.empty-state {
  text-align: center;
  padding: 60px 48px;
  color: var(--grey);
}
.empty-icon {
  width: 70px; height: 70px;
  margin: 0 auto 16px;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  opacity: 0.5;
}
.empty-state i  { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p  { font-size: 14px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 6px; opacity: 0.6; }

/* =================== MISC UTILITIES =================== */
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-info    { color: var(--info); }
.text-muted   { color: var(--grey-dark); }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.mt-1  { margin-top: 4px; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 12px; }
.mb-2  { margin-bottom: 8px; }
.gap-8 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }

/* Currency / number formatting */
.currency { color: var(--navy-light); font-size: 11px; }
input[type=number] { direction: ltr; text-align: right; }

/* Loading spinner */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =================== RESPONSIVE =================== */
@media (max-width: 1200px) {
  .kpi-grid-5 { grid-template-columns: repeat(3,1fr); }
  .kpi-grid-4 { grid-template-columns: repeat(2,1fr); }
  .export-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-right: 0; max-width: 100vw; width: 100%; }
  .kpi-grid-5, .kpi-grid-4 { grid-template-columns: repeat(2,1fr); }
  .kpi-grid-3 { grid-template-columns: repeat(2,1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .perm-grid { grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); }
}
@media (max-width: 600px) {
  .kpi-grid-5, .kpi-grid-4, .kpi-grid-3 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .achievements-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .export-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .modal { padding: 20px; }
}

/* =================== ANIMATIONS =================== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-content > * { animation: fadeIn 0.3s ease; }

/* =================== PRINT =================== */
@media print {
  .sidebar, .topbar { display: none !important; }
  .main-content { margin-right: 0 !important; max-width: 100% !important; width: 100% !important; }
  .btn, .btn-tbl { display: none !important; }
}

/* =================== ROUND 4 — TASK CARDS =================== */
.task-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}
.task-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}
.task-card.task-overdue {
  border-right: 4px solid #ef4444;
  background: linear-gradient(to left, #fff5f5, #fff);
}
.task-card.task-pending {
  border-right: 4px solid #f59e0b;
}
.task-card-header {
  padding: 16px 16px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.task-card-body {
  padding: 12px 16px;
  flex: 1;
}
.task-card-footer {
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.task-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  line-height: 1.4;
}
.task-meta {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.task-meta i { color: var(--turquoise-dark); }
.task-desc {
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 8px;
}

/* Progress bar inside task card */
.task-progress-bar {
  background: #e2e8f0;
  border-radius: 999px;
  height: 6px;
  margin: 8px 0 4px;
  overflow: hidden;
}
.task-progress-fill {
  height: 6px;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Attachment chips */
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e0f2fe;
  color: #0369a1;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid #bae6fd;
}
.attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #f0f9ff;
  border-radius: 8px;
  font-size: 12px;
  color: #0369a1;
  border: 1px solid #bae6fd;
  margin-bottom: 4px;
}
.attach-item i { color: var(--turquoise-dark); flex-shrink: 0; }

/* External link */
.link-external {
  color: var(--turquoise-dark);
  font-size: 13px;
  word-break: break-all;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 500;
}
.link-external:hover { text-decoration: underline; color: var(--navy); }

/* Task notes */
.task-admin-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-right: 3px solid #f59e0b;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #92400e;
  margin-top: 8px;
}
.task-emp-note {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-right: 3px solid var(--turquoise-dark);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #0369a1;
  margin-top: 8px;
}

/* Task link row */
.task-link {
  font-size: 12px;
  color: var(--turquoise-dark);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.task-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* =================== EMPLOYEE WELCOME BANNER =================== */
.emp-welcome-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--turquoise-dark) 60%, var(--turquoise) 100%);
  border-radius: 16px;
  padding: 28px 32px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.emp-welcome-banner::before {
  content: '';
  position: absolute;
  top: -40px;
  left: -40px;
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.emp-welcome-banner::after {
  content: '';
  position: absolute;
  bottom: -30px;
  right: 10%;
  width: 100px;
  height: 100px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.emp-welcome-left {
  flex: 1;
  z-index: 1;
}
.emp-welcome-left h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}
.emp-welcome-left p {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 4px;
}
.emp-welcome-right {
  display: flex;
  gap: 20px;
  align-items: center;
  z-index: 1;
}
.emp-welcome-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

/* Performance circle */
.perf-circle {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}
.perf-label {
  font-size: 11px;
  text-align: center;
  opacity: 0.8;
  margin-top: 4px;
}

/* =================== TABLE ROW STATES =================== */
.overdue-row {
  background: #fff5f5 !important;
}
.overdue-row:hover {
  background: #fee2e2 !important;
}
.notif-row {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.notif-row:hover {
  background: #f8fafc;
}
.notif-row.unread {
  background: #f0f9ff;
  border-right: 3px solid var(--turquoise-dark);
}
.notif-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--turquoise), var(--turquoise-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.notif-row-body {
  flex: 1;
}
.notif-row-msg {
  font-size: 13px;
  color: var(--navy);
  font-weight: 500;
  margin-bottom: 3px;
  line-height: 1.5;
}
.notif-row-time {
  font-size: 11px;
  color: #94a3b8;
}

/* =================== TASK ROW SIMPLE (quick list) =================== */
.task-row-simple {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}
.task-row-simple:last-child { border-bottom: none; }
.task-row-simple .task-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.task-row-simple .task-info { flex: 1; }
.task-row-simple .task-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 2px;
}
.task-row-simple .task-due {
  font-size: 11px;
  color: #94a3b8;
}

/* =================== BADGE ADDITIONS =================== */
.badge-danger {
  background: #fee2e2;
  color: #dc2626;
}
.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

/* =================== EXPORT CARD HOVER =================== */
.export-card:hover {
  background: #f0f9ff !important;
  border-color: var(--turquoise) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,150,170,0.12);
}

/* =================== RESPONSIVE FIXES R4 =================== */
@media (max-width: 768px) {
  .emp-welcome-banner {
    flex-direction: column;
    text-align: center;
  }
  .emp-welcome-right {
    justify-content: center;
  }
  .task-card-header {
    flex-direction: column;
  }
  .task-card-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .task-card-footer .btn,
  .task-card-footer .btn-sm {
    width: 100%;
    justify-content: center;
  }
}

/* =================== ROUND 5 STYLES =================== */

/* Login Logo Image */
.login-logo-img {
  max-height: 100px;
  max-width: 220px;
  object-fit: contain;
  margin: 0 auto 12px;
  display: block;
  border-radius: 12px;
}

/* Sidebar Logo Image */
.sidebar-logo-img {
  height: 42px;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
}

/* Password Strength Bar */
.pwd-strength-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.pwd-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.4s, background 0.4s;
}

/* Password Requirements */
.pwd-requirements {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0 12px;
}
.req-row {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.req-row.req-ok {
  color: #10b981;
}
.req-row .req-dot {
  font-size: 8px;
}

/* Permission Toggle (Checkbox style) */
.perm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.perm-toggle input { display: none; }
.perm-toggle-track {
  width: 44px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 999px;
  position: relative;
  transition: background 0.3s;
}
.perm-toggle input:checked + .perm-toggle-track {
  background: var(--turquoise-dark, #00bcd4);
}
.perm-toggle-track::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 3px;
  right: 23px;
  transition: right 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.perm-toggle input:checked + .perm-toggle-track::after {
  right: 3px;
}

/* Permission Checkbox Item */
.perm-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #475569;
  transition: background 0.2s, border-color 0.2s;
}
.perm-check-item:hover { background: #f0f9ff; border-color: #00bcd4; }
.perm-check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--turquoise-dark, #00bcd4);
  flex-shrink: 0;
}

/* User Status Badges */
.badge-active   { background: #dcfce7; color: #166534; }
.badge-purple   { background: #f3e8ff; color: #6b21a8; }

/* MAWJ WATCH Page */
.mawj-watch-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #00bcd4 100%);
  color: white;
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 24px;
}
.mawj-watch-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Email Log Modal */
.email-log-row {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.email-log-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a5f, #00bcd4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

/* btn-sm utility */
.btn-sm {
  padding: 6px 12px !important;
  font-size: 12px !important;
}
.btn-danger {
  background: #ef4444 !important;
  color: white !important;
  border: none !important;
}
.btn-danger:hover { background: #dc2626 !important; }

/* Form grid 2-col */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media(max-width:600px){ .form-grid { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: #475569; }
.form-control {
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  background: white;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}
.form-control:focus { border-color: var(--turquoise-dark, #00bcd4); outline: none; box-shadow: 0 0 0 3px rgba(0,188,212,0.1); }

/* KPI cards for users page */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 16px; }
.kpi-card { background: white; border-radius: 14px; padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #f1f5f9; }
.kpi-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-size: 20px; flex-shrink: 0; }
.kpi-info { flex: 1; }
.kpi-value { font-size: 24px; font-weight: 800; color: var(--navy, #1e3a5f); line-height: 1.2; }
.kpi-label { font-size: 12px; color: #64748b; margin-top: 2px; }

/* Ensure RTL table cells */
.data-table th, .data-table td { text-align: right; }


/* =================== ROUND 5 CSS CLASSES =================== */

/* Settings Tabs */
.settings-tab { border-radius:0; }
.settings-tab-active { background:var(--navy) !important; color:white !important; }
.settings-tab:hover:not(.settings-tab-active) { background:#f8fafc; color:var(--navy); }

/* Password Strength Bar */
.pwd-strength-bar { height:5px; background:#e2e8f0; border-radius:3px; margin-top:6px; overflow:hidden; }
.pwd-strength-fill { height:100%; border-radius:3px; transition:all .3s; width:0%; }
.pwd-requirements { margin-top:8px; }
.req-row { display:flex; align-items:center; gap:6px; font-size:12px; color:#94a3b8; padding:3px 0; }
.req-row.req-ok { color:#10b981; }
.req-row.req-ok .req-dot { color:#10b981; }
.req-dot { color:#cbd5e1; font-size:8px; }
.pw-wrap { position:relative; }
.pw-wrap input { padding-left:40px; width:100%; }
.pw-toggle { position:absolute; left:10px; top:50%; transform:translateY(-50%); background:none; border:none; cursor:pointer; color:#94a3b8; }

/* KPI Cards (MAWJ Watch) */
.kpi-card { transition:all .2s; }
.kpi-card:hover { transform:translateY(-2px); box-shadow:0 4px 16px rgba(0,0,0,.1); }

/* User Management */
.users-avatar { width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,var(--navy),var(--turquoise-dark)); display:flex; align-items:center; justify-content:center; color:white; font-weight:700; }
.badge-primary { background:#dbeafe; color:#1d4ed8; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:600; display:inline-flex; align-items:center; gap:4px; }
.badge-info { background:#e0f2fe; color:#0369a1; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:600; display:inline-flex; align-items:center; gap:4px; }
.badge-success { background:#d1fae5; color:#065f46; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:600; display:inline-flex; align-items:center; gap:4px; }

/* Role Cards */
.role-card { background:#f8fafc; border:1px solid #e2e8f0; border-radius:12px; padding:16px; transition:all .2s; }
.role-card:hover { border-color:var(--turquoise-dark); box-shadow:0 4px 12px rgba(0,188,212,.1); }

/* Granular Permission Matrix */
.perm-matrix-header { background:linear-gradient(to left,var(--navy),var(--turquoise-dark)); color:white; font-weight:700; font-size:12px; padding:8px 14px; }

/* MAWJ Watch */
.watch-kpi-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:16px; margin-bottom:24px; }
.watch-heatmap-cell { width:100%; height:22px; border-radius:4px; display:flex; align-items:center; justify-content:center; color:white; font-size:10px; font-weight:700; }
.watch-activity-item { display:flex; gap:12px; align-items:flex-start; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.watch-activity-icon { width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }

/* Login Logo Styling */
.login-logo-img { max-width:180px; max-height:80px; object-fit:contain; margin-bottom:12px; filter:drop-shadow(0 2px 8px rgba(0,0,0,.2)); }
.sidebar-logo-img { max-width:120px; max-height:48px; object-fit:contain; }

/* Export Cards */
.export-card { background:#f8fafc; border:1px solid #e2e8f0; border-radius:12px; padding:20px; text-align:center; cursor:pointer; transition:all .2s; }
.export-card:hover { background:#f0f9ff; border-color:var(--turquoise-dark); transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,188,212,.12); }

/* Tabbed Settings */
#settings-tabs { overflow-x:auto; white-space:nowrap; }
.settings-tab { white-space:nowrap; }

/* Security Section */
.sec-panel { background:#fef2f2; border:1px solid #fecaca; border-radius:10px; padding:16px; }
.sec-input-group { position:relative; }

/* Email Log */
.email-status-badge { background:#d1fae5; color:#065f46; padding:2px 8px; border-radius:999px; font-size:11px; }

/* MAWJ Watch Banner */
.mawjwatch-banner { background:linear-gradient(135deg,#1e3a5f 0%,#006064 60%,#00bcd4 100%); border-radius:16px; padding:24px; color:white; }
.mawjwatch-stat { text-align:center; background:rgba(255,255,255,.1); padding:10px 16px; border-radius:10px; }

/* Responsive adjustments */
@media (max-width:768px) {
  .watch-kpi-grid { grid-template-columns:repeat(2,1fr); }
  .mawjwatch-banner { flex-direction:column; }
  #settings-tabs button { padding:8px 12px; font-size:12px; }
}
