/* ==========================================================================
   EPSE Enterprise HR & Contract Management System
   Corporate CSS Design System & Theme Definition
   ========================================================================== */

:root {
  --epse-navy-dark: #0B192C;
  --epse-navy-primary: #0F2A4A;
  --epse-navy-secondary: #1E3E62;
  --epse-navy-accent: #1E3A8A;
  --epse-gold: #D4A017;
  --epse-gold-hover: #B8860B;
  --epse-cyan: #0284C7;
  --epse-emerald: #059669;
  --epse-crimson: #DC2626;
  --epse-amber: #D97706;
  
  --bg-main: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F8FAFC;
  --border-color: #E2E8F0;
  --border-focus: #0284C7;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 15px rgba(212, 160, 23, 0.25);

  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-primary);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================================================
   Typography & Base Utilities
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--epse-navy-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

.d-none { display: none !important; }
.d-flex { display: flex !important; }

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--epse-navy-primary), var(--epse-navy-secondary));
  color: var(--text-inverse);
  box-shadow: 0 2px 4px rgba(15, 42, 74, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--epse-navy-dark), var(--epse-navy-primary));
  box-shadow: 0 4px 8px rgba(15, 42, 74, 0.3);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--epse-gold), #E5A93C);
  color: #0B192C;
  font-weight: 700;
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--epse-gold-hover), var(--epse-gold));
  color: #FFFFFF;
}

.btn-secondary {
  background-color: var(--bg-surface-alt);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background-color: #E2E8F0;
  color: var(--text-primary);
}

.btn-success {
  background-color: var(--epse-emerald);
  color: #FFFFFF;
}

.btn-danger {
  background-color: var(--epse-crimson);
  color: #FFFFFF;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background-color: var(--bg-surface-alt);
  color: var(--epse-navy-primary);
  border-color: var(--epse-navy-accent);
}

/* ==========================================================================
   Badges & Role Indicators
   ========================================================================== */
.badge-role {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-admin {
  background-color: #FEE2E2;
  color: #991B1B;
  border: 1px solid #F87171;
}

.role-hr {
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}

.role-employee {
  background-color: #E0E7FF;
  color: #3730A3;
  border: 1px solid #818CF8;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.pill-active, .pill-ontime, .pill-unlimited {
  background-color: #DCFCE7;
  color: #166534;
}

.pill-expiring, .pill-late {
  background-color: #FEF3C7;
  color: #B45309;
}

.pill-expired, .pill-rejected {
  background-color: #FEE2E2;
  color: #991B1B;
}

.pill-fixed {
  background-color: #E0F2FE;
  color: #075985;
}

/* ==========================================================================
   Authentication Screen Layout
   ========================================================================== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 10% 20%, #0F2A4A 0%, #0B192C 90%);
  padding: 24px;
}

.auth-card {
  background: var(--bg-surface);
  width: 100%;
  max-width: 460px;
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 0.4s ease-out;
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  height: 64px;
  object-fit: contain;
  margin-bottom: 12px;
}

.auth-brand h2 {
  font-size: 1.6rem;
  color: var(--epse-navy-primary);
  margin-bottom: 2px;
}

.brand-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 8px;
}

.auth-system-badge {
  display: inline-block;
  background: #F1F5F9;
  color: var(--epse-navy-secondary);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--epse-cyan);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.demo-accounts-panel {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-color);
}

.demo-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.demo-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-demo-quick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: background-color 0.2s;
}

.btn-demo-quick:hover {
  background-color: #E2E8F0;
  border-color: #CBD5E1;
}

/* ==========================================================================
   Main Application Layout
   ========================================================================== */
.main-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  height: 70px;
  background: var(--epse-navy-dark);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 2px solid var(--epse-gold);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.corporate-header-logo {
  height: 42px;
  object-fit: contain;
  background: #FFFFFF;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
}

.branding-text {
  display: flex;
  flex-direction: column;
}

.company-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--epse-gold);
}

.portal-title {
  font-size: 0.78rem;
  color: #94A3B8;
  font-weight: 500;
  text-transform: uppercase;
}

.perimeter-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(5, 150, 105, 0.15);
  border: 1px solid rgba(5, 150, 105, 0.4);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: #34D399;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-online {
  background-color: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: pulseDot 2s infinite;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.role-switcher-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.07);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.switcher-label {
  font-size: 0.78rem;
  color: #CBD5E1;
  font-weight: 600;
}

.select-role-compact {
  background: var(--epse-navy-primary);
  color: #FFFFFF;
  border: 1px solid var(--epse-gold);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--epse-gold), #F59E0B);
  color: #0B192C;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #FFFFFF;
}

.user-role-badge {
  font-size: 0.7rem;
  font-weight: 700;
}

.btn-logout {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
  color: #F87171;
}

.btn-logout:hover {
  background: rgba(220, 38, 38, 0.3);
  color: #FFFFFF;
}

/* ==========================================================================
   App Body & Sidebar
   ========================================================================== */
.app-header {
  height: 70px;
  background: var(--epse-navy-dark);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 2px solid var(--epse-gold);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.app-body {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 70px);
  position: relative;
}

.app-sidebar {
  width: 270px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 70px);
  position: sticky;
  top: 70px;
  overflow-y: auto;
  padding: 20px 0 16px 0;
  transition: width 0.3s ease;
  z-index: 50;
}

.sidebar-header {
  padding: 0 20px 12px 20px;
}

.nav-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-item:hover {
  background-color: var(--bg-main);
  color: var(--epse-navy-primary);
}

.nav-item:hover i {
  color: var(--epse-navy-primary);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--epse-navy-primary), var(--epse-navy-secondary));
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(15, 42, 74, 0.2);
}

.nav-item.active i {
  color: var(--epse-gold);
}

.sidebar-footer {
  padding: 14px 16px 0 16px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.system-status-card {

  background: var(--bg-surface-alt);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--epse-navy-primary);
}

.system-status-card small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ==========================================================================
   Main Content Views
   ========================================================================== */
.app-content {
  flex: 1;
  padding: 28px 36px;
  overflow-y: auto;
  max-width: 1600px;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.view-title-group h1 {
  font-size: 1.7rem;
  color: var(--epse-navy-primary);
}

.view-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   Cards & Data Grids
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-surface);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.icon-blue { background: #E0F2FE; color: #0284C7; }
.icon-amber { background: #FEF3C7; color: #D97706; }
.icon-emerald { background: #DCFCE7; color: #059669; }
.icon-navy { background: #E2E8F0; color: var(--epse-navy-primary); }

.kpi-data {
  display: flex;
  flex-direction: column;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--epse-navy-primary);
  line-height: 1.1;
}

.kpi-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.content-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #FAFAFA;
}

.card-header h3 {
  font-size: 1.1rem;
  color: var(--epse-navy-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 24px;
}

/* ==========================================================================
   Advanced Search & Filter Bar
   ========================================================================== */
.search-filter-panel {
  background: #FFFFFF;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.filter-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: flex-end;
}

.search-input-wrapper {
  position: relative;
}

.search-input-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input-wrapper input {
  padding-left: 40px;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table thead th {
  background-color: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 18px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: #F8FAFC;
}

/* ==========================================================================
   Biometric Terminal Simulator
   ========================================================================== */
.biometric-simulator-card {
  background: radial-gradient(circle at center, #1E293B 0%, #0F172A 100%);
  color: #FFFFFF;
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.biometric-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 32px;
  align-items: center;
}

.fingerprint-scanner-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.scanner-pad {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, #0284C7 0%, #0F2A4A 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 3px solid var(--epse-gold);
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.scanner-pad:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(212, 160, 23, 0.6);
}

.scanner-pad i {
  font-size: 3.5rem;
  color: #FFFFFF;
}

.scanner-pad.scanning::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #34D399;
  box-shadow: 0 0 12px #34D399;
  animation: scanLine 1.5s infinite linear;
}

.scanner-label {
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--epse-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.perimeter-selector-box {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.perimeter-selector-box label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #CBD5E1;
  margin-bottom: 8px;
  display: block;
}

/* ==========================================================================
   Anti-Fraud Perimeter Alert Banner
   ========================================================================== */
.perimeter-alert-banner {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 600;
  animation: shake 0.5s ease-in-out;
}

.alert-danger-banner {
  background-color: #FEF2F2;
  border: 1.5px solid #F87171;
  color: #991B1B;
}

.alert-danger-banner i {
  font-size: 1.8rem;
  color: #DC2626;
}

.alert-success-banner {
  background-color: #F0FDF4;
  border: 1.5px solid #4ADE80;
  color: #166534;
}

.alert-success-banner i {
  font-size: 1.8rem;
  color: #16A34A;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 25, 44, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-box {
  background: #FFFFFF;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.25s ease-out;
}

.modal-box.modal-lg {
  max-width: 1000px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-alt);
}

.modal-header h3 {
  font-size: 1.25rem;
  color: var(--epse-navy-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--epse-crimson);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* Modal Tab Styles */
.modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 18px;
  background: transparent;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
}

.tab-btn.active {
  color: var(--epse-navy-primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--epse-gold);
}

/* ==========================================================================
   Version History Timeline
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: 32px;
  margin-top: 16px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 11px;
  width: 2px;
  background: #CBD5E1;
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--epse-navy-primary);
  color: var(--epse-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 2px var(--epse-navy-primary);
}

.timeline-content {
  background: var(--bg-surface-alt);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.timeline-title {
  font-weight: 700;
  color: var(--epse-navy-primary);
  font-size: 0.95rem;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
}

.toast {
  background: #FFFFFF;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-left: 4px solid var(--epse-navy-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideInRight 0.3s ease-out;
}

.toast-success { border-left-color: var(--epse-emerald); }
.toast-error { border-left-color: var(--epse-crimson); }
.toast-warning { border-left-color: var(--epse-amber); }

/* ==========================================================================
   Keyframes
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scanLine {
  0% { top: 0; }
  50% { top: 100%; }
  100% { top: 0; }
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* ==========================================================================
   RTL & Arabic Localization Styling
   ========================================================================== */
[dir="rtl"] {
  font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-align: right;
}

[dir="rtl"] .app-sidebar {
  border-right: none;
  border-left: 1px solid var(--border-color);
}

[dir="rtl"] .header-branding {
  margin-right: 0;
  margin-left: 20px;
}

[dir="rtl"] .data-table th,
[dir="rtl"] .data-table td {
  text-align: right;
}

[dir="rtl"] .search-input-wrapper i {
  left: auto;
  right: 14px;
}

[dir="rtl"] .search-input-wrapper input {
  padding-left: 14px;
  padding-right: 38px;
}

[dir="rtl"] .kpi-card {
  border-left: 1px solid var(--border-color);
}

[dir="rtl"] .toast-container {
  right: auto;
  left: 24px;
}

[dir="rtl"] .toast {
  border-left: none;
  border-right: 4px solid var(--epse-navy-primary);
  animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}

