/* ==========================================================================
   MALTA WORK VISA TRACKER - PREMIUM DESIGN SYSTEM (VANILLA CSS)
   ========================================================================== */

/* --- Design Tokens & Variables --- */
:root {
  --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color Palette */
  --bg-app-gradient: radial-gradient(circle at 50% 30%, #0f3624 0%, #092015 50%, #040d09 100%);
  --bg-card-glass: rgba(16, 44, 30, 0.65);
  --bg-sidebar-glass: rgba(10, 28, 19, 0.82);
  --border-glass: rgba(52, 211, 153, 0.16);
  --border-focus: rgba(52, 211, 153, 0.7);
  
  /* Brand & Status Colors */
  --accent-color: #3ddc97; /* Warm Mint-Sage Emerald */
  --accent-glow: rgba(61, 220, 151, 0.45);
  
  --primary-color: #10b981; /* Emerald Green */
  --primary-glow: rgba(16, 185, 129, 0.4);
  
  --success-color: #059669; /* Rich Green */
  --success-glow: rgba(5, 150, 105, 0.3);
  
  --warning-color: #f59e0b; /* Golden Amber */
  --warning-glow: rgba(245, 158, 11, 0.3);
  
  --info-color: #0ea5e9; /* Icy Blue */
  --info-glow: rgba(14, 165, 233, 0.3);
  
  --danger-color: #ef4444; /* Bright Red */
  --danger-glow: rgba(239, 68, 68, 0.3);
  
  /* Text Colors */
  --text-primary: #f5fdfa;
  --text-secondary: #a8dac0;
  --text-muted: #75a48b;
  
  /* Layout Constants */
  --sidebar-width: 280px;
  --header-height: 80px;
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 24px;
  
  /* Shadows & Blurs */
  --glass-shadow: 0 15px 45px 0 rgba(0, 0, 0, 0.5);
  --neon-shadow: 0 0 15px rgba(61, 220, 151, 0.2);
  --glass-blur: blur(25px);
  
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Base Resets & Global Styles --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background: #05160d;
  background-image: var(--bg-app-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(11, 12, 22, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.6);
}

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

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

.hidden {
  display: none !important;
}

/* --- Interactive Loading Spinner --- */
.app-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #05160d;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.app-loader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(99, 102, 241, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
  box-shadow: var(--neon-shadow);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Shared Form Elements & Glass Input Controls --- */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.password-toggle-icon {
  position: absolute;
  right: 16px;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
  z-index: 2;
}

.password-toggle-icon:hover {
  color: var(--primary-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(4, 20, 10, 0.6);
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
}

.input-wrapper input {
  padding-left: 48px !important;
  padding-right: 48px !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-color);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(52, 211, 153, 0.25);
  background: rgba(4, 20, 10, 0.85);
}

.input-wrapper input:focus + .input-icon {
  color: var(--primary-color);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: rgba(4, 20, 10, 0.35) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
  opacity: 0.75;
}


select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2334d399'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
  padding-right: 48px;
  cursor: pointer;
}

select option {
  background-color: #0a2414;
  color: var(--text-primary);
}

textarea {
  resize: vertical;
}

/* --- Buttons Design System --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease;
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: white;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 5px 0 #035e43, 0 10px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-4px);
}

.btn-primary:hover {
  transform: translateY(-7px);
  box-shadow: 0 7px 0 #035e43, 0 15px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(61, 220, 151, 0.45);
  background: linear-gradient(135deg, #3ddc97 0%, #047857 100%);
}

.btn-primary:active {
  transform: translateY(0px);
  box-shadow: 0 1px 0 #035e43, 0 3px 6px rgba(0, 0, 0, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #3ddc97 0%, #059669 100%);
  color: white;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 5px 0 #047857, 0 10px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-4px);
}

.btn-success:hover {
  transform: translateY(-7px);
  box-shadow: 0 7px 0 #047857, 0 15px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(61, 220, 151, 0.5);
  background: linear-gradient(135deg, #6ee7b7 0%, #059669 100%);
}

.btn-success:active {
  transform: translateY(0px);
  box-shadow: 0 1px 0 #047857, 0 3px 6px rgba(0, 0, 0, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #b91c1c 100%);
  color: white;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 5px 0 #881337, 0 10px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-4px);
}

.btn-danger:hover {
  transform: translateY(-7px);
  box-shadow: 0 7px 0 #881337, 0 15px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(239, 68, 68, 0.35);
  background: linear-gradient(135deg, #f87171 0%, #b91c1c 100%);
}

.btn-danger:active {
  transform: translateY(0px);
  box-shadow: 0 1px 0 #881337, 0 3px 6px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  box-shadow: 0 5px 0 rgba(255, 255, 255, 0.04), 0 10px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-4px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(61, 220, 151, 0.35);
  transform: translateY(-7px);
  box-shadow: 0 7px 0 rgba(255, 255, 255, 0.06), 0 15px 25px rgba(0, 0, 0, 0.5);
}

.btn-secondary:active {
  transform: translateY(0px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 3px 6px rgba(0, 0, 0, 0.3);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #f87171;
  width: 100%;
  box-shadow: 0 5px 0 rgba(239, 68, 68, 0.08), 0 10px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-4px);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
  transform: translateY(-7px);
  box-shadow: 0 7px 0 rgba(239, 68, 68, 0.12), 0 15px 25px rgba(0, 0, 0, 0.4);
}

.btn-logout:active {
  transform: translateY(0px);
  box-shadow: 0 1px 0 rgba(239, 68, 68, 0.05), 0 3px 6px rgba(0, 0, 0, 0.2);
}

.btn-block {
  width: 100%;
}

.btn-icon-only {
  padding: 12px;
  border-radius: var(--border-radius-md);
  aspect-ratio: 1;
}

/* ==========================================================================
   AUTHENTICATION PAGE (LOGIN)
   ========================================================================== */
.auth-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  background: #031008;
  background-image: radial-gradient(circle at 50% 50%, #0c351f 0%, #031008 100%);
  overflow: hidden;
}

.auth-bg-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.auth-bg-shapes .shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}

.auth-bg-shapes .shape-1 {
  width: 400px;
  height: 400px;
  background: rgba(52, 211, 153, 0.2);
  top: -100px;
  right: -50px;
}

.auth-bg-shapes .shape-2 {
  width: 300px;
  height: 300px;
  background: rgba(16, 185, 129, 0.15);
  bottom: -50px;
  left: -50px;
}

.auth-container {
  width: 100%;
  max-width: 450px;
  padding: 20px;
  z-index: 5;
  perspective: 1000px;
}

.auth-card {
  background: linear-gradient(145deg, rgba(24, 60, 42, 0.8) 0%, rgba(12, 36, 24, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--border-radius-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 40px;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform-style: preserve-3d;
  transform: rotateX(6deg) rotateY(-4deg);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.5s ease, border-color 0.5s ease;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-card:hover {
  transform: rotateX(0deg) rotateY(0deg) translateY(-5px);
  border-color: rgba(61, 220, 151, 0.4);
  box-shadow: 0 35px 70px rgba(0, 0, 0, 0.65), 0 0 25px rgba(61, 220, 151, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.auth-header {
  text-align: center;
  margin-bottom: 35px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.logo-icon {
  color: var(--accent-color);
  font-size: 2.2rem;
  filter: drop-shadow(0 0 10px rgba(52, 211, 153, 0.4));
}

.accent-text {
  background: linear-gradient(135deg, var(--accent-color) 0%, #10b981 50%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

.auth-footer {
  margin-top: 30px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-footer i {
  color: var(--primary-color);
  margin-right: 4px;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   APP CONTAINER LAYOUT
   ========================================================================== */
.dashboard-section {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* --- Premium Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar-glass);
  border-right: 1px solid var(--border-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5), inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 40px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(52, 211, 153, 0.04);
  border: 1px solid rgba(52, 211, 153, 0.1);
  border-radius: var(--border-radius-md);
  margin-bottom: 30px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.user-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.role-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
  letter-spacing: 0.05em;
}

.admin-badge {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #34d399;
}

.agent-badge {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #22d3ee;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.menu-item i {
  font-size: 1.1rem;
}

.menu-item:hover, .menu-item.active {
  background: rgba(52, 211, 153, 0.12);
  color: var(--text-primary);
}

.menu-item.active {
  border-left: 3px solid var(--primary-color);
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.18) 0%, rgba(52, 211, 153, 0) 100%);
  padding-left: 15px; /* Offset the left border */
}

/* --- Main Content Workspace --- */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 40px;
  flex-grow: 1;
  width: calc(100% - var(--sidebar-width));
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
}

.top-nav h1 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.top-nav .subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 35px;
  perspective: 1000px;
}

.stat-card {
  background: linear-gradient(145deg, rgba(20, 54, 38, 0.8) 0%, rgba(12, 36, 24, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--border-radius-md);
  backdrop-filter: var(--glass-blur);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease, background 0.4s ease;
  transform-style: preserve-3d;
}

.stat-card:hover {
  transform: translateY(-10px) translateZ(25px) rotateX(4deg) rotateY(-2deg);
  border-color: rgba(61, 220, 151, 0.4);
  background: linear-gradient(145deg, rgba(24, 66, 46, 0.9) 0%, rgba(16, 44, 30, 0.7) 100%);
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.6), 0 0 20px rgba(61, 220, 151, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.icon-blue {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-color);
}
.icon-yellow {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning-color);
}
.icon-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
}
.icon-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}
.icon-red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger-color);
}

.stat-details h3 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-details p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

/* --- Controls Panel (Search/Filters) --- */
.control-panel {
  background: var(--bg-card-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  backdrop-filter: var(--glass-blur);
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 450px;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

#search-input {
  padding-left: 48px;
  background: rgba(0, 0, 0, 0.2);
}

.filters-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.filter-group select {
  padding: 10px 16px;
  font-size: 0.9rem;
  border-radius: 10px;
  min-width: 180px;
  background-color: rgba(0, 0, 0, 0.2);
}

.view-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  background: rgba(18, 19, 38, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  margin-bottom: 24px;
}

.view-tab {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 800;
  padding: 12px 24px;
  border-radius: 9px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.view-tab.active {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
  perspective: 1200px;
}

.candidate-pipeline-card {
  background: linear-gradient(145deg, rgba(20, 54, 38, 0.75) 0%, rgba(10, 32, 21, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  padding: 30px;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
  transform-style: preserve-3d;
}

.candidate-pipeline-card:hover {
  transform: translateY(-12px) translateZ(30px) rotateX(4deg) rotateY(-2deg);
  border-color: rgba(61, 220, 151, 0.5);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.65), 0 0 25px rgba(61, 220, 151, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.candidate-card-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.candidate-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #7ed321 0%, #10b981 100%);
  border: 4px solid #0eeaff;
  box-shadow: 0 0 0 4px rgba(14, 234, 255, 0.08);
}

.candidate-main h3 {
  font-size: 1.45rem;
  line-height: 1.15;
  margin-bottom: 6px;
}

.candidate-main p {
  color: var(--text-secondary);
  font-family: monospace;
  font-size: 0.95rem;
}

.candidate-main p span::before {
  content: '•';
  margin: 0 10px;
}

.candidate-employer-chip {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
}

.compact-progress {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 20px 18px 18px;
  margin-bottom: 26px;
}

.compact-progress::before {
  content: '';
  position: absolute;
  left: 38px;
  right: 38px;
  top: 35px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00e5ff 0%, #a78bfa 54%, #16d3a6 100%);
}

.compact-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  z-index: 1;
}

.compact-step span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #334155;
  border: 2px solid rgba(255, 255, 255, 0.08);
}

.compact-step.done span {
  background: #10b981;
  border-color: #10b981;
}

.compact-step strong {
  color: #10d6a3;
  font-size: 0.82rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.candidate-card-footer {
  display: grid;
  grid-template-columns: auto auto minmax(120px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  font-weight: 700;
}

.candidate-card-footer > span:last-child {
  justify-self: end;
}

.completion-pill,
.payment-chip,
.agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: #10d6a3;
  border-radius: 8px;
  padding: 9px 12px;
}

.completion-pill i {
  font-size: 0.6rem;
}

.agent-chip {
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.18);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-open-file {
  padding: 9px 12px;
  font-size: 0.82rem;
  border-radius: 8px;
}

/* --- Dynamic Data Table Layout --- */
.table-container {
  background: var(--bg-card-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  backdrop-filter: var(--glass-blur);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  
  /* CSS Flip Trick: moves the horizontal scrollbar to the top */
  transform: rotateX(180deg);
  display: flex;
  flex-direction: column-reverse;
}

.table-container > * {
  transform: rotateX(180deg);
}

.table-container:hover {
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55), inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

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

.data-table th {
  background: rgba(18, 19, 38, 0.5);
  border-bottom: 1px solid var(--border-glass);
  padding: 18px 24px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: var(--transition-smooth);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.actions-column {
  text-align: right;
}

/* Tables Badges UI */
.passport-badge {
  font-family: monospace;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 50px;
}

/* Custom Step Coloring Mapping */
.step-doc {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: #38bdf8;
}
.step-sub {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}
.step-appr {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
}
.step-appt {
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: #c084fc;
}
.step-visa-ok {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.step-visa-ko {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.step-arrived {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid #0ea5e9;
  color: #e0f2fe;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
}

.step-muted {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--text-secondary);
}

/* Custom Payment Badges */
.pay-pill {
  display: inline-block;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 6px;
  text-align: center;
}

.pay-unpaid {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.pay-deposit {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #f59e0b;
}

.pay-fully {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
}

.document-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: #38bdf8;
}

.agent-name-text {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.agent-name-text i {
  margin-right: 6px;
  color: var(--info-color);
}

.last-updated-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Empty state panel --- */
.empty-state {
  text-align: center;
  padding: 60px 40px;
}

.empty-icon {
  font-size: 3.5rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ==========================================================================
   MODALS AND DRAWERS (GLASSMORPHIC OVERLAYS)
   ========================================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 5, 11, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: #0b2014;
  background-image: linear-gradient(145deg, #0f2e1c 0%, #06140d 100%);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 92vh;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transform: scale(0.9) rotateX(10deg);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.modal.active .modal-content {
  transform: scale(1) rotateX(0deg);
}

.modal-header {
  padding: 24px 30px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.02em;
}

.modal-header h2 i {
  color: var(--primary-color);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--accent-color);
}

.modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.scrollable-body {
  overflow-y: auto;
}

.form-row {
  display: flex;
  gap: 20px;
}

.flex-1 {
  flex: 1;
}

.modal-footer {
  padding: 20px 30px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* --- Right Side Drawer Variant (For Timelines/Edit Files) --- */
.modal-right {
  justify-content: flex-end;
}

.modal-right .modal-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-right.active .modal-backdrop {
  opacity: 1;
}

.modal-right .modal-content {
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  max-width: 100%;
  width: 100%;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-right.active .modal-content {
  transform: translateX(0);
}

/* --- Timeline Clickable Name Link --- */
.candidate-name-field.clickable-name {
  cursor: pointer;
  color: #818cf8; /* Light Indigo */
  transition: var(--transition-smooth);
  display: inline-block;
  position: relative;
}

.candidate-name-field.clickable-name::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--accent-color);
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

.candidate-name-field.clickable-name:hover {
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.candidate-name-field.clickable-name:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* --- Timeline Fullscreen Executive Dashboard Grid Layout --- */
.timeline-dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

@media (min-width: 992px) {
  .timeline-dashboard-grid {
    display: grid;
    grid-template-columns: 4.2fr 5.8fr;
    gap: 32px;
    align-items: start;
  }
}

.footer-left {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
}

/* ==========================================================================
   CANDIDATE DETAILS AND INTERACTIVE TIMELINE DRAWER
   ========================================================================== */
.detail-card {
  background: rgba(16, 48, 28, 0.3);
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-radius: var(--border-radius-md);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.detail-name-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 16px;
}

.detail-name-wrapper h3 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.agent-name-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--info-color);
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.passport-display {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.passport-display strong {
  font-family: monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
  margin-left: 4px;
}

/* --- Premium Interactive Pipeline Roadmap --- */
.pipeline-section {
  margin-bottom: 30px;
}

.pipeline-section h4, 
.edit-quick-panel h4, 
.timeline-section-list h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  border-left: 3px solid var(--accent-color);
  padding-left: 10px;
}

.section-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  margin-top: -8px;
}

.pipeline-tracker {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  padding-left: 0;
  margin-bottom: 20px;
}

/* Connecting timeline line */
.pipeline-tracker::before {
  content: none;
}

.pipeline-phase {
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.02);
  padding: 14px 16px 16px;
}

.pipeline-phase.active-phase {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.06);
}

.pipeline-phase.complete {
  border-color: rgba(16, 185, 129, 0.28);
}

.pipeline-phase.locked {
  opacity: 0.55;
}

.phase-heading {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.phase-heading span {
  color: var(--accent-color);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.phase-heading strong {
  font-size: 0.95rem;
  letter-spacing: 0;
}

.phase-heading i {
  color: var(--text-secondary);
}

.pipeline-phase.complete .phase-heading i {
  color: var(--success-color);
}

.phase-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 30px;
}

.phase-steps::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: rgba(255, 255, 255, 0.06);
  z-index: 1;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 2;
  cursor: pointer;
  user-select: none;
}

/* Interactive step visual bead indicators */
.step-node {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0f1020;
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  transition: var(--transition-smooth);
  position: absolute;
  left: -30px;
}

.step-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.pipeline-step:hover .step-label {
  color: var(--text-primary);
  transform: translateX(4px);
}

.pipeline-step:hover .step-node {
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

/* Active Completed stages logic states */
.pipeline-step.completed .step-node {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.pipeline-step.completed .step-label {
  color: var(--text-primary);
  font-weight: 500;
}

.pipeline-step.active .step-node {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
  box-shadow: 0 0 15px var(--accent-glow);
  transform: scale(1.15);
}

.pipeline-step.active .step-label {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
}

.pipeline-step.locked {
  cursor: not-allowed;
}

.pipeline-step.locked .step-node {
  background: rgba(255, 255, 255, 0.03);
}

.pipeline-step.locked:hover .step-node {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.pipeline-step.locked:hover .step-label {
  color: var(--text-secondary);
  transform: none;
}

/* Active green pipeline highlights when approved */
.pipeline-step.visa-approved.active .step-node {
  background: var(--success-color);
  border-color: var(--success-color);
  box-shadow: 0 0 15px var(--success-glow);
}

/* Connect line highlight logic */
.pipeline-tracker.stage-arrived::before {
  background: linear-gradient(180deg, var(--primary-color) 80%, var(--accent-color) 100%);
}

.current-step-banner {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-sm);
  padding: 10px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  text-align: center;
  font-size: 0.9rem;
}

.current-step-banner strong {
  color: var(--accent-color);
  margin-left: 4px;
}

.btn-step-nav {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
}

.btn-step-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* --- Sleek Quick Edit Panel Inputs --- */
.edit-quick-panel {
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--border-radius-md);
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--border-glass);
}

.payment-radio-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.radio-label {
  cursor: pointer;
}

.radio-label input {
  display: none;
}

.radio-custom {
  display: block;
  text-align: center;
  padding: 10px 4px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.radio-label input:checked + .radio-custom.pay-unpaid-badge {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger-color);
  color: #f87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}

.radio-label input:checked + .radio-custom.pay-deposit-badge {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--warning-color);
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.radio-label input:checked + .radio-custom.pay-fully-badge {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--success-color);
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.edit-actions {
  margin-top: 14px;
}

.payment-summary-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.payment-summary-panel > div {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-sm);
  padding: 12px;
}

.payment-summary-panel span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.payment-summary-panel strong {
  font-size: 1rem;
  color: var(--text-primary);
}

.payment-ledger-section {
  margin-bottom: 24px;
}

.payment-ledger {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-ledger-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px 14px;
}

.payment-ledger-item div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.payment-ledger-item div:last-child {
  align-items: flex-end;
}

.payment-ledger-item strong {
  color: #34d399;
  font-size: 0.95rem;
}

.payment-ledger-item span {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.payment-ledger-item small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.document-section {
  margin-bottom: 24px;
}

.document-section h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  border-left: 3px solid var(--accent-color);
  padding-left: 10px;
}

.document-upload-panel {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  padding: 18px;
  margin-bottom: 14px;
}

.document-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.document-list-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px 14px;
}

.document-file-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
}

.document-file-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.document-file-meta strong,
.document-file-meta span,
.document-file-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-file-meta strong {
  font-size: 0.92rem;
}

.document-file-meta span {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.document-file-meta small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.btn-document-download {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
}

/* --- Interactive Status History Timeline List --- */
.timeline-trail {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  padding-left: 24px;
}

.timeline-trail::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background: rgba(255, 255, 255, 0.04);
}

.timeline-item {
  position: relative;
}

.timeline-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid #15162c;
  position: absolute;
  left: -24px;
  top: 6px;
  z-index: 2;
}

.timeline-item:first-child .timeline-marker {
  background: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-glow);
}

.timeline-bubble {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px 16px;
}

.timeline-bubble p {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

.timeline-actor {
  color: var(--primary-color);
}

/* ==========================================================================
   DYNAMIC TOAST NOTIFICATION CONTAINER
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}

.toast {
  background: rgba(21, 22, 44, 0.9);
  border-left: 4px solid var(--primary-color);
  border-top: 1px solid var(--border-glass);
  border-right: 1px solid var(--border-glass);
  border-bottom: 1px solid var(--border-glass);
  backdrop-filter: var(--glass-blur);
  padding: 16px 20px;
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 320px;
  max-width: 450px;
  transform: translateX(120%);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast-success { border-left-color: var(--success-color); }
.toast-success i { color: var(--success-color); }

.toast-error { border-left-color: var(--danger-color); }
.toast-error i { color: var(--danger-color); }

.toast-warning { border-left-color: var(--warning-color); }
.toast-warning i { color: var(--warning-color); }

.toast i {
  font-size: 1.25rem;
}

.toast-message {
  font-size: 0.9rem;
  font-weight: 600;
  flex-grow: 1;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
}

.toast-close:hover {
  color: var(--text-primary);
}

@keyframes slideIn {
  to { transform: translateX(0); }
}

@keyframes slideOut {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN ADAPTATIONS (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1024px) {
  .sidebar {
    width: 80px;
    padding: 24px 10px;
    align-items: center;
  }
  
  .sidebar-brand span, 
  .sidebar-user .user-info,
  .sidebar-menu span,
  .btn-logout span {
    display: none;
  }
  
  .sidebar-brand {
    justify-content: center;
    margin-bottom: 30px;
  }
  
  .sidebar-user {
    padding: 8px;
    justify-content: center;
    margin-bottom: 24px;
  }
  
  .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }
  
  .menu-item {
    justify-content: center;
    padding: 14px 0;
    aspect-ratio: 1;
  }
  
  .menu-item.active {
    border-left: none;
    border-right: 3px solid var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
  }
  
  .main-content {
    margin-left: 80px;
    width: calc(100% - 80px);
    padding: 30px;
  }
}

@media (max-width: 768px) {
  body {
    overflow-y: auto;
  }
  
  .dashboard-section {
    flex-direction: column;
  }
  

  
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 24px;
  }
  
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .top-nav-actions {
    width: 100%;
  }
  
  .top-nav-actions button {
    width: 100%;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .control-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .view-tabs {
    width: 100%;
  }

  .view-tab {
    flex: 1;
    padding: 12px 10px;
  }

  .pipeline-board {
    grid-template-columns: 1fr;
  }

  .candidate-card-header {
    grid-template-columns: auto 1fr;
  }

  .candidate-employer-chip {
    grid-column: 1 / -1;
    max-width: 100%;
  }

  .compact-progress {
    overflow-x: auto;
    grid-template-columns: repeat(6, minmax(92px, 1fr));
  }
  
  .search-wrapper {
    max-width: 100%;
    flex: none;
  }
  
  .filters-wrapper {
    justify-content: space-between;
    width: 100%;
  }
  
  .filter-group {
    flex: 1;
    min-width: 120px;
  }
  
  .filter-group select {
    min-width: 100%;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .modal-right .modal-content {
    width: 100%;
    border-radius: 0;
  }
  
  .footer-left {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .candidate-pipeline-card {
    padding: 20px;
    border-radius: 16px;
  }

  .candidate-card-footer {
    grid-template-columns: 1fr;
  }

  .candidate-card-footer > span:last-child {
    justify-self: start;
  }
}

/* --- Kanban Columns Layout --- */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

.board-column {
  background: rgba(18, 20, 38, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  backdrop-filter: var(--glass-blur);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 500px;
  transition: var(--transition-smooth);
}

.board-column:hover {
  border-color: rgba(99, 102, 241, 0.15);
  background: rgba(18, 20, 38, 0.5);
}

.column-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}

.column-badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-step-1 {
  background: var(--info-color);
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.5);
}

.dot-step-2 {
  background: var(--warning-color);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.dot-step-3 {
  background: var(--success-color);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.column-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-grow: 1;
}

.column-count {
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 20px;
  color: var(--text-secondary);
}

.column-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 150px;
}

@media (max-width: 1200px) {
  .pipeline-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pipeline-board {
    grid-template-columns: 1fr;
  }

  .current-step-banner {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 800px) {
  .modal-content {
    max-height: 96vh;
  }
  .modal-header {
    padding: 16px 24px;
  }
  .modal-body {
    padding: 20px 24px;
  }
  .modal-footer {
    padding: 14px 24px;
  }
  .form-group {
    margin-bottom: 12px;
    gap: 4px;
  }
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="file"],
  select,
  textarea {
    padding: 10px 12px;
  }
  .form-row {
    gap: 12px;
  }
  .doc-upload-section {
    padding: 12px;
    margin-bottom: 12px;
  }
}

/* ============================================================
   DOCUMENT UPLOAD & MANAGEMENT STYLES
   ============================================================ */

/* Document count pill in table */
.document-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--primary-color);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Document upload section in Add Candidate modal */
.doc-upload-section {
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--border-radius-md);
  padding: 16px;
  margin-bottom: 20px;
  background: rgba(99, 102, 241, 0.04);
}

.doc-upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.doc-upload-header label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-upload-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Each dynamic document row: name input + file input + remove button */
.doc-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(13, 14, 28, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-sm);
  padding: 10px 12px;
  animation: fadeInRow 0.2s ease forwards;
}

@keyframes fadeInRow {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Styled file input */
.file-input-styled {
  width: 100%;
  padding: 10px 12px;
  background: rgba(13, 14, 28, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.file-input-styled::-webkit-file-upload-button {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 6px;
  color: var(--primary-color);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-right: 10px;
}

.file-input-styled::-webkit-file-upload-button:hover {
  background: rgba(99, 102, 241, 0.3);
}

.file-input-styled:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Small button variant */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
  gap: 6px;
}

/* Documents panel in the drawer */
.documents-panel-section {
  margin-bottom: 28px;
}

.documents-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.documents-panel-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.document-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

/* Each document row in the drawer */
.document-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(18, 20, 38, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  transition: var(--transition-smooth);
}

.document-list-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.05);
}

.document-file-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.document-file-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.document-file-meta strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-file-meta span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.document-file-meta small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Download button in document list */
.btn-document-download {
  flex-shrink: 0;
  padding: 7px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
  gap: 6px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.btn-document-download:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

/* Admin drawer upload panel */
.doc-drawer-upload {
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--border-radius-md);
  padding: 16px;
  background: rgba(99, 102, 241, 0.04);
  margin-top: 4px;
}

.doc-drawer-upload .doc-upload-header {
  margin-bottom: 14px;
}

/* ---- Inline document cards inside candidate detail card ---- */
.detail-card-docs {
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 12px;
}

.detail-card-docs-header {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-card-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--border-radius-sm);
  padding: 8px 12px;
  margin-bottom: 7px;
  transition: var(--transition-smooth);
}

.detail-card-doc-item:last-child {
  margin-bottom: 0;
}

.detail-card-doc-item:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
}

.detail-card-doc-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-card-doc-name i {
  color: var(--primary-color);
  flex-shrink: 0;
}

.detail-card-doc-view-btn {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--primary-color);
  flex-shrink: 0;
  white-space: nowrap;
}

.detail-card-doc-view-btn:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}

/* ==========================================================================
   MOBILE RESPONSIVENESS AND DYNAMIC SIDEBAR DRAWERS
   ========================================================================== */

.top-nav-left {
  display: flex;
  align-items: center;
}

.sidebar-toggle-btn {
  display: none; /* Hidden on standard desktops by default */
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%; /* Perfect Circle Shape */
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  margin-right: 18px;
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary-color);
  color: var(--text-primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
  transform: scale(1.05);
}

.sidebar-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: none; /* Hidden on desktop */
  transition: var(--transition-smooth);
  line-height: 1;
  z-index: 10;
}

.sidebar-close-btn:hover {
  color: var(--accent-color);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 5, 11, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-wrapper {
  position: relative;
  flex: 1 1 300px;
  max-width: 450px;
}

.filters-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  justify-content: flex-end;
}

/* Responsive breakpoint for Tablets and Laptops */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1001;
    box-shadow: 0 0 32px rgba(0, 0, 0, 0.6);
    background: #0f1020;
    background-image: linear-gradient(180deg, #121328 0%, #0a0b14 100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .sidebar-close-btn {
    display: block;
  }
  
  .sidebar-toggle-btn {
    display: inline-flex;
  }
  
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 24px 20px;
  }
}

/* Responsive breakpoint for Mobile Screens */
@media (max-width: 768px) {
  .top-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 24px;
  }
  
  .top-nav-actions {
    width: 100%;
  }
  
  .top-nav-actions .btn {
    width: 100%;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .control-panel {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 16px;
  }
  
  .search-wrapper {
    max-width: 100%;
    flex: none;
  }
  
  .filters-wrapper {
    justify-content: space-between;
    width: 100%;
    gap: 12px;
  }
  
  .filter-group {
    flex: 1;
  }
  
  .filter-group select {
    min-width: 0;
    width: 100%;
  }
  
  .view-tabs {
    width: 100%;
    display: flex;
  }
  
  .view-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
  }
}

/* Privacy Mode Toggle & Hide Names Switch */
.privacy-toggle-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-glass);
  height: 46px;
  user-select: none;
  transition: var(--transition-smooth);
}

.privacy-toggle-wrapper:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.privacy-toggle-wrapper span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border: 1px solid var(--border-glass);
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s;
}

.switch input:checked + .slider {
  background-color: rgba(99, 102, 241, 0.2);
  border-color: var(--primary-color);
}

.switch input:checked + .slider:before {
  transform: translateX(22px);
  background-color: var(--primary-color);
  box-shadow: 0 0 8px var(--primary-glow);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Privacy Mask styling */
body.privacy-mode-active .candidate-name-field {
  filter: blur(5.5px);
  user-select: none;
  transition: filter 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: help;
}

body.privacy-mode-active .candidate-name-field:hover {
  filter: blur(0px);
}

/* Pagination Container Styling */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(18, 19, 38, 0.4);
  border-top: 1px solid var(--border-glass);
  border-bottom-left-radius: var(--border-radius-md);
  border-bottom-right-radius: var(--border-radius-md);
}

.pagination-info {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .privacy-toggle-wrapper {
    width: 100%;
    justify-content: space-between;
    height: auto;
    padding: 10px 16px;
  }
  .pagination-container {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    text-align: center;
  }
}

/* ==========================================================================
   RESPONSIVE TOGGLEABLE SIDEBAR ON DESKTOP & TRANSITION EFFECTS
   ========================================================================== */
@media (min-width: 993px) {
  /* Ensure the toggle hamburger button is always visible on desktop */
  .sidebar-toggle-btn {
    display: inline-flex !important;
  }

  /* Transition smooth for standard layouts */
  .sidebar {
    transition: var(--transition-smooth);
  }
  
  .main-content {
    transition: var(--transition-smooth);
  }

  /* Collapsed States on Desktop (Full Screen View) */
  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }

  body.sidebar-collapsed .main-content {
    margin-left: 0;
    width: 100%;
  }

  /* Premium Spacing & Spacing Fix when Sidebar is Active/Expanded on Desktop */
  body:not(.sidebar-collapsed) .main-content {
    padding-left: 56px; /* Spacious elegant left padding */
  }

  body:not(.sidebar-collapsed) .sidebar-toggle-btn {
    margin-left: 8px; /* Elegant breathing room next to sidebar right border */
  }
}

/* ==========================================================================
   PROGRESS BAR & METRICS COMPONENTS (PREMIUM SPECIFICATION)
   ========================================================================== */
.progress-container-outer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.progress-bar-wrapper {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

.progress-bar-fill-default {
  background: linear-gradient(90deg, #6366f1 0%, #4f46e5 100%); /* Neon Indigo */
}

.progress-bar-fill-medium {
  background: linear-gradient(90deg, #0ea5e9 0%, #6366f1 100%); /* Blue to Indigo */
}

.progress-bar-fill-high {
  background: linear-gradient(90deg, #10b981 0%, #0ea5e9 100%); /* Emerald to Blue */
}

.progress-bar-fill-complete {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%); /* Vibrant Emerald */
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.progress-bar-fill-refused {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%); /* Crimson Red */
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.progress-percent-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.progress-percent-label.text-danger {
  color: #fb7185;
}

/* ==========================================================================
   ADMIN CHAT HUB STYLES (PREMIUM GLASSMORPHIC)
   ========================================================================== */
.chat-drawer-body {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height) - 80px);
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background: rgba(11, 12, 22, 0.4);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

/* Custom Sleek Scrollbar */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  transition: background 0.2s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Chat Message Bubbles & Row Layout */
.chat-message-item {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chat-message-item.msg-left {
  align-self: flex-start;
}

.chat-message-item.msg-right {
  align-self: flex-end;
}

.chat-message-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  width: 100%;
}

.chat-message-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: calc(100% - 48px);
}

.msg-right .chat-message-wrapper {
  align-items: flex-end;
}

/* Message Metadata & Badges */
.chat-message-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
  user-select: none;
}

.msg-right .chat-message-meta {
  flex-direction: row-reverse;
}

.chat-message-meta .sender-name {
  font-weight: 700;
  color: var(--text-secondary);
}

.chat-message-meta .sender-role {
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.chat-message-meta .admin-badge {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.chat-message-meta .agent-badge {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.chat-message-meta .time-label {
  opacity: 0.85;
}

/* Elegant Avatar Gradients */
.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  user-select: none;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.avatar-admin {
  background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
}

.avatar-agent {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
}

.avatar-self {
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
}

/* Dynamic Bubble Borders & Glow */
.chat-message-bubble {
  padding: 12px 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  transition: all 0.2s ease;
}

.msg-left .chat-message-bubble {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px 18px 18px 4px;
}

.msg-right .chat-message-bubble {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  color: #ffffff;
}

/* Chat Input Form */
.chat-send-form {
  padding: 20px;
  background: rgba(18, 19, 38, 0.85);
  border-top: 1px solid var(--border-glass);
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

#chat-message-input {
  flex: 1;
  background: rgba(10, 11, 20, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: var(--text-primary);
  padding: 12px 16px;
  font-size: 0.95rem;
  resize: none;
  min-height: 48px;
  max-height: 120px;
  transition: var(--transition-smooth);
}

#chat-message-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.chat-send-btn {
  padding: 12px 18px;
  border-radius: 12px;
  height: 48px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-hints {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-hints i {
  color: var(--info-color);
}

/* Clickable Mention Badges & Pills */
.mention-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.88rem;
}

.mention-file-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.88rem;
  margin: 1px 2px;
}

.mention-file-badge:hover {
  background: rgba(14, 165, 233, 0.3);
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.4);
  transform: translateY(-1px);
}

/* Autocomplete Mentions Dropdown */
.chat-autocomplete-dropdown {
  position: absolute;
  bottom: 100px;
  left: 20px;
  right: 20px;
  background: #121326;
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1100;
  backdrop-filter: var(--glass-blur);
  animation: fadeInUp 0.2s ease-out;
}

.autocomplete-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: var(--transition-smooth);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover, .autocomplete-item.selected {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-primary);
}

.autocomplete-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.autocomplete-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.autocomplete-item-icon.icon-admin {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.autocomplete-item-icon.icon-candidate {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.autocomplete-item-info {
  display: flex;
  flex-direction: column;
}

.autocomplete-item-info strong {
  font-size: 0.88rem;
  font-weight: 700;
}

.autocomplete-item-info span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.autocomplete-item-badge {
  font-family: monospace;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

/* --- Premium Chat Hub Unread Notification Badge --- */
.menu-item {
  position: relative;
}

.unread-badge {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--danger-color, #ef4444);
  color: white;
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
  transition: var(--transition-smooth);
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.15); }
  100% { transform: translateY(-50%) scale(1); }
}

/* Premium Chat Sent/Seen Status Indicators */
.seen-status {
  font-size: 0.78rem;
  margin-left: 5px;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

.seen-status.delivered {
  color: rgba(255, 255, 255, 0.4);
}

.seen-status.seen {
  color: #38bdf8; /* Telegram/WhatsApp premium blue seen status */
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

/* --- Remaining Days countdown pill styling --- */
.remaining-days-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  white-space: nowrap;
}

.remaining-pending {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.remaining-active {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.remaining-normal {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.remaining-warning {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  animation: pulse-overdue 1.5s infinite;
}

.remaining-overdue {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  animation: pulse-overdue 1.5s infinite;
}

.remaining-completed {
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.remaining-na {
  background: transparent;
  color: var(--text-muted);
}

@keyframes pulse-overdue {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}






