:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --border-radius: 8px;
  --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --transition: all 0.3s ease;
  /* Pastel tints for activity cards */
  --priority-low-bg: rgba(23, 162, 184, 0.06);
  --priority-medium-bg: rgba(255, 193, 7, 0.08);
  --priority-high-bg: rgba(220, 53, 69, 0.06);
  --priority-urgent-bg: rgba(232, 62, 140, 0.07);
}

/* Hide handles and drag affordances when layout is locked */
.layout-locked .resize-handle { display: none !important; pointer-events: none !important; }
.layout-locked .draggable-widget { cursor: default !important; }
.layout-editing .draggable-widget { outline: 1px dashed rgba(13,110,253,.18); }

/* Floating toggle button for edit mode */
.layout-toggle {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 1050; /* above cards */
  border-radius: 999px;
  padding: 6px 12px;
  background: #f5f6f8;
  color: #495057;
  border: 1px solid rgba(0,0,0,0.12);
  font-size: 12px;
  line-height: 1.2;
  box-shadow: 0 6px 12px rgba(0,0,0,0.06);
}
.layout-toggle i { color: #6c757d; }
.layout-toggle:hover { background: #e9ecef; border-color: #ced4da; color: #343a40; }

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Navigation */
.navbar {
  box-shadow: var(--box-shadow);
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
}

/* Modern Navbar */
.navbar-modern {
  background: linear-gradient(90deg, #0d6efd, #6f42c1);
  color: #fff;
  box-shadow: 0 8px 24px rgba(13, 110, 253, 0.25);
  backdrop-filter: saturate(180%) blur(6px);
}

.navbar-modern .navbar-brand {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.navbar-modern .navbar-brand i { opacity: 0.9; }

.navbar-modern .navbar-nav .nav-link {
  color: rgba(255,255,255,0.9);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  margin: 0 0.15rem;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.navbar-modern .navbar-nav .nav-link:hover,
.navbar-modern .navbar-nav .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.16);
}

.navbar-modern .dropdown-menu {
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

/* Ensure toggler is visible on gradient */
.navbar-modern .navbar-toggler { border-color: rgba(255,255,255,0.5); }
.navbar-modern .navbar-toggler:focus { box-shadow: 0 0 0 0.15rem rgba(255,255,255,0.35); }
.navbar-modern .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,0.9)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Connection status pill in navbar */
.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 2px 10px;
  font-size: 0.8rem;
  line-height: 1.2;
  backdrop-filter: saturate(140%) blur(2px);
}
.connection-pill i { color: #fff; opacity: 0.95; }
.connection-pill.online {
  border-color: rgba(25,135,84,0.9);
  background: rgba(25,135,84,0.22);
}
.connection-pill.degraded {
  border-color: rgba(255,193,7,0.95);
  background: rgba(255,193,7,0.25);
}
.connection-pill.offline {
  border-color: rgba(220,53,69,0.95);
  background: rgba(220,53,69,0.28);
}

/* Impersonation badge in navbar */
.impersonation-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #dc3545; /* red icon conveys impersonation */
  background: transparent; /* icon-only */
  border: none; /* remove pill border */
  padding: 0 4px; /* minimal footprint */
  font-size: 0.9rem; /* slightly larger icon for visibility */
  line-height: 1;
  cursor: help; /* indicates tooltip */
}


/* Tiny avatar in navbar */
.navbar-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  vertical-align: middle;
}

/* Generic avatar sizes */
.avatar-xs {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.06);
}

/* Profile dropdown styles */
.dropdown-menu.profile-menu {
  min-width: 320px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transform-origin: top right;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 160ms ease, transform 160ms ease;
}

.dropdown-menu.profile-menu.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.profile-dropdown-header {
  background: linear-gradient(135deg, rgba(0, 123, 255, 0.06), rgba(0, 123, 255, 0.03));
}

.dropdown-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.profile-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  transition: background-color 140ms ease, padding-left 140ms ease;
}

.profile-menu .dropdown-item i {
  width: 18px;
  text-align: center;
  color: #6c757d;
}

.profile-menu .dropdown-item:hover {
  background-color: rgba(0, 123, 255, 0.08);
  padding-left: 20px;
}

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

.bg-primary-subtle { background-color: rgba(13, 110, 253, 0.12) !important; }
.border-primary-subtle { border-color: rgba(13, 110, 253, 0.24) !important; }

/* Main Content */
.main-content {
  min-height: calc(100vh - 56px);
  position: relative;
}

.main-content.full-height {
  min-height: 100vh;
}

/* Dashboard Container */
#dashboardContainer {
  position: relative !important;
  top: 0 !important;
  padding-top: 1rem !important;
}

/* Equal height helpers for side-by-side cards */
.row-eq-height {
  display: flex;
  flex-wrap: wrap;
}
.row-eq-height > [class*='col-'] {
  display: flex;
}
.row-eq-height > [class*='col-'] > .card { /* first-level card in column */
  height: 100%;
  display: flex;
  flex-direction: column;
}
.row-eq-height > [class*='col-'] > .card > .card-body { flex: 1 1 auto; }

/* Login Page */
#loginPage {
  position: relative;
}

#loginPage.hidden {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  top: -9999px !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Dashboard Container Positioning */
#dashboardContainer {
  position: absolute !important;
  top: 56px !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  overflow-y: auto !important;
  z-index: 10 !important;
}

/* Smooth view transitions */
#dashboardContainer.fade-in {
  animation: fadeIn 380ms ease-in;
}

/* ================================
   STUNNING LOGIN PAGE STYLES
   ================================ */

/* Login Container */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, 
    #667eea 0%, 
    #764ba2 25%, 
    #f093fb 50%, 
    #f5576c 75%, 
    #4facfe 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  overflow: hidden;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Floating Background Animation */
.login-bg-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.floating-shape {
  position: absolute;
  opacity: 0.1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(2px);
  animation: float 20s infinite ease-in-out;
}

.shape-1 {
  width: 200px;
  height: 200px;
  top: 10%;
  left: 10%;
  animation-delay: -2s;
}

.shape-2 {
  width: 150px;
  height: 150px;
  top: 60%;
  right: 15%;
  animation-delay: -8s;
}

.shape-3 {
  width: 100px;
  height: 100px;
  bottom: 20%;
  left: 20%;
  animation-delay: -4s;
}

.shape-4 {
  width: 300px;
  height: 300px;
  top: 20%;
  right: 10%;
  animation-delay: -12s;
}

.shape-5 {
  width: 80px;
  height: 80px;
  top: 80%;
  left: 60%;
  animation-delay: -6s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.1;
  }
  25% {
    transform: translateY(-20px) rotate(90deg);
    opacity: 0.2;
  }
  50% {
    transform: translateY(-10px) rotate(180deg);
    opacity: 0.15;
  }
  75% {
    transform: translateY(-30px) rotate(270deg);
    opacity: 0.25;
  }
}

/* Login Content */
.login-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 15px;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Glass Card Effect */
.glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.1),
    0 8px 25px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  overflow: hidden;
  animation: slideUpFadeIn 0.8s ease-out;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  min-height: 540px;
}

@keyframes slideUpFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Brand Section */
.login-brand-section {
  text-align: center;
  padding: 25px 30px 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-logo-container {
  position: relative;
  display: inline-block;
  margin-bottom: 15px;
}

.brand-logo {
  max-width: 160px;
  max-height: 60px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.brand-logo:hover {
  transform: scale(1.05);
}

.brand-fallback {
  width: 60px;
  height: 60px;
  margin: 0 auto;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.brand-icon {
  font-size: 24px;
  color: white;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  color: #6c757d;
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
  opacity: 0.8;
}

/* Form Container */
.login-form-container {
  padding: 18px 30px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 320px;
}

.auth-step {
  animation: fadeIn 0.6s ease-out;
}

/* Step Header */
.step-header {
  text-align: center;
  margin-bottom: 20px;
}

.step-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.step-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.step-icon:hover::before {
  transform: translateX(100%);
}

.email-icon {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.otp-icon {
  background: linear-gradient(135deg, #11998e, #38ef7d);
}

.step-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.step-subtitle {
  color: #718096;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.5;
}

.email-display {
  color: #667eea;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 8px 0 0;
  padding: 8px 16px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 20px;
  display: inline-block;
}

/* Form Styles */
.auth-form {
  margin-top: 16px;
}

/* Floating Input Group */
.form-floating-group {
  position: relative;
  margin-bottom: 24px;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 12px 45px 12px 16px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  outline: none;
}

.form-input:focus {
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
  box-shadow: 
    0 10px 25px rgba(102, 126, 234, 0.1),
    0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-floating-group .form-input:focus + .form-label {
  color: #667eea;
  transform: translateY(-28px) scale(0.85);
}

.form-floating-group .form-input:not(:placeholder-shown) + .form-label {
  transform: translateY(-28px) scale(0.85);
}

.form-floating-group .form-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #718096;
  font-size: 0.95rem;
  font-weight: 500;
  pointer-events: none;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
  padding: 0 6px;
  border-radius: 4px;
}

.form-floating-group .input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.form-floating-group .form-input:focus ~ .input-icon {
  color: #667eea;
}

/* OTP Input */
.otp-input-container {
  position: relative;
  margin-bottom: 24px;
}

.otp-input {
  width: 100%;
  height: 65px;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 6px;
  border: none;
  background: transparent;
  color: #2d3748;
  outline: none;
  z-index: 2;
  position: relative;
}

.otp-input-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.otp-input:focus ~ .otp-input-bg {
  border-color: #11998e;
  transform: scale(1.02);
  box-shadow: 
    0 10px 25px rgba(17, 153, 142, 0.15),
    0 0 0 3px rgba(17, 153, 142, 0.1);
}

.otp-label {
  position: absolute;
  top: -10px;
  left: 16px;
  color: #718096;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  padding: 3px 10px;
  border-radius: 16px;
  z-index: 3;
}

/* Buttons */
.btn-auth {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
}

.btn-content {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s ease;
  z-index: 2;
  position: relative;
}

.btn-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.btn-auth:disabled .btn-content {
  opacity: 0;
}

.btn-auth:disabled .btn-loading {
  opacity: 1;
}

.btn-primary-gradient {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary-gradient:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.btn-success-gradient {
  background: linear-gradient(135deg, #11998e, #38ef7d);
  color: white;
  box-shadow: 0 10px 25px rgba(17, 153, 142, 0.3);
}

.btn-success-gradient:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(17, 153, 142, 0.4);
}

.btn-secondary-glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  color: #667eea;
  border: 1px solid rgba(102, 126, 234, 0.2);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.btn-secondary-glass:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
  margin-bottom: 8px;
}

/* Loading Animations */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.auth-loading {
  text-align: center;
  padding: 30px 20px;
}

.loading-animation {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.loading-circle {
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  animation: loadingBounce 1.4s ease-in-out infinite both;
}

.loading-circle:nth-child(1) { animation-delay: -0.32s; }
.loading-circle:nth-child(2) { animation-delay: -0.16s; }
.loading-circle:nth-child(3) { animation-delay: 0s; }

@keyframes loadingBounce {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.loading-text {
  color: #718096;
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}

/* Security Footer */
.security-footer {
  padding: 16px 30px 18px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  min-height: 60px;
  margin-top: auto;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #718096;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  backdrop-filter: blur(5px);
  white-space: nowrap;
}

.security-badge i {
  color: #11998e;
}

/* Login Footer */
.login-footer {
  text-align: center;
  margin-top: 20px;
  animation: fadeIn 1s ease-out 0.5s both;
}

.copyright-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-content {
    max-width: 380px;
    padding: 15px;
  }
  
  .login-brand-section {
    padding: 30px 20px 20px;
  }
  
  .brand-title {
    font-size: 1.5rem;
  }
  
  .login-form-container {
    padding: 30px 20px;
  }
  
  .step-icon {
    width: 60px;
    height: 60px;
    font-size: 22px;
  }
  
  .step-title {
    font-size: 1.3rem;
  }
  
  .otp-input {
    height: 70px;
    font-size: 1.8rem;
    letter-spacing: 6px;
  }
  
  .floating-shape {
    opacity: 0.05;
  }
}

@media (max-width: 480px) {
  .login-content {
    max-width: 320px;
    padding: 10px;
  }
  
  .glass-card {
    border-radius: 20px;
  }
  
  .login-brand-section {
    padding: 25px 15px 15px;
  }
  
  .login-form-container {
    padding: 25px 15px;
  }
  
  .security-footer {
    padding: 15px 20px;
  }
  
  .otp-input {
    letter-spacing: 4px;
  }
}

/* ================================
   LOGOUT PAGE STYLES
   ================================ */

.logout-content-container {
  padding: 18px 30px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 320px;
}

.logout-step {
  animation: fadeIn 0.6s ease-out;
  text-align: center;
}

.logout-icon {
  background: linear-gradient(135deg, #ff6b6b, #feca57);
}

.motivational-message {
  font-size: 1.1rem;
  font-weight: 500;
  color: #4a5568;
  line-height: 1.6;
  margin: 16px 0 0;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.08), rgba(254, 202, 87, 0.08));
  border-radius: 16px;
  border-left: 4px solid #ff6b6b;
  font-style: italic;
  animation: messageSlideIn 0.8s ease-out 0.3s both;
}

@keyframes messageSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.logout-actions {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

.logout-actions .btn-auth {
  max-width: 200px;
  animation: buttonSlideIn 0.8s ease-out 0.5s both;
}

@keyframes buttonSlideIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Legacy classes for compatibility */
.letter-spacing {
  letter-spacing: 0.2rem;
}

.card {
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Dashboard Cards */
.stat-card {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.1);
}

.stat-card .card-body {
  position: relative;
}

.stat-card .stat-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  opacity: 0.1;
}

/* Soft themed stat cards */
.stat-card.soft-primary { background: linear-gradient(135deg, rgba(13,110,253,.08), #fff); border: 1px solid rgba(13,110,253,.12); }
.stat-card.soft-success { background: linear-gradient(135deg, rgba(25,135,84,.08), #fff); border: 1px solid rgba(25,135,84,.12); }
.stat-card.soft-warning { background: linear-gradient(135deg, rgba(255,193,7,.10), #fff); border: 1px solid rgba(255,193,7,.18); }
.stat-card.soft-info    { background: linear-gradient(135deg, rgba(23,162,184,.08), #fff); border: 1px solid rgba(23,162,184,.12); }
.stat-card.soft-primary .stat-icon { color: #0d6efd; opacity: .12; }
.stat-card.soft-success .stat-icon { color: #198754; opacity: .12; }
.stat-card.soft-warning .stat-icon { color: #ffc107; opacity: .18; }
.stat-card.soft-info .stat-icon    { color: #17a2b8; opacity: .12; }

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Draggable/Resizable dashboard widgets */
.draggable-row { position: relative; }
.draggable-widget { position: relative; overflow: visible; }
.draggable-widget.dragging { opacity: 0.6; }
.draggable-widget.resizing { cursor: ew-resize; }

/* Slim right-edge resize handle */
.draggable-widget > .resize-handle {
  position: absolute;
  top: 0;
  right: -2px; /* slightly outside to avoid covering content */
  width: 14px;
  height: 100%;
  cursor: ew-resize;
  background: linear-gradient(180deg, rgba(13,110,253,.10), rgba(13,110,253,.05));
  opacity: 0.35;
  z-index: 3;
  transition: background 120ms ease, opacity 120ms ease;
}
.draggable-widget > .resize-handle:hover { opacity: 0.7; }

/* Visible dots (grip) */
.draggable-widget > .resize-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 4px;
  width: 4px;
  height: 26px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: repeating-linear-gradient(
    180deg,
    rgba(13,110,253,.85) 0px,
    rgba(13,110,253,.85) 2px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.9;
}

/* Placeholder shown while dragging */
.draggable-placeholder {
  border: 2px dashed rgba(13,110,253,.35);
  border-radius: var(--border-radius);
  background: rgba(13,110,253,.06);
}

/* Activity Cards */
.activity-card {
  border-left: 4px solid var(--primary-color);
  transition: var(--transition);
  background: linear-gradient(180deg, #ffffff, #fafbfc);
  border: 1px solid rgba(0,0,0,0.06);
  min-height: 130px; /* credit-card-esque, but flexible */
  overflow: visible; /* ensure dropdowns/text aren't clipped */
}

.activity-card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.activity-card.priority-high { border-left-color: var(--danger-color); background: linear-gradient(180deg, #ffffff, var(--priority-high-bg)); }

.activity-card.priority-medium { border-left-color: var(--warning-color); background: linear-gradient(180deg, #ffffff, var(--priority-medium-bg)); }

.activity-card.priority-low { border-left-color: var(--info-color); background: linear-gradient(180deg, #ffffff, var(--priority-low-bg)); }

.activity-card.priority-urgent { border-left-color: #e83e8c; background: linear-gradient(180deg, #ffffff, var(--priority-urgent-bg)); }

/* Tweak activity card internals for a lighter, compact look */
.activity-card .card-body { padding: 0.75rem 0.75rem 0.5rem; }
.activity-card .card-footer { padding: 0.4rem 0.75rem; }
.activity-card .card-title { font-size: 0.95rem; font-weight: 600; }
.activity-card .card-text { font-size: 0.85rem; }
.activity-card .progress { height: 3px; }
.activity-card .badge { font-size: 0.7rem; }
.activity-card .dropdown .btn { padding: 0.15rem 0.4rem; }
.activity-card p.card-text { 
  display: -webkit-box; 
  -webkit-line-clamp: 2; 
  line-clamp: 2;
  -webkit-box-orient: vertical; 
  overflow: hidden; 
}

/* Perfect circular icon buttons used on activity cards */
.btn-icon-circle {
  width: 32px;
  height: 32px;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon-circle i { font-size: 0.9rem; line-height: 1; }

/* Activities List wrapper card with subtle contrast to tiles */
/* Themed darker background for Activities List wrapper */
.activities-list-card {
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(13,110,253,0.08), transparent 60%),
    radial-gradient(1000px 500px at 110% 110%, rgba(111,66,193,0.10), transparent 55%),
    #ffffff;
  border: 1px solid rgba(13,110,253,0.12);
}
.activities-list-card .card-header {
  background: linear-gradient(180deg, rgba(13,110,253,0.10), rgba(111,66,193,0.06));
  border-bottom: 1px solid rgba(13,110,253,0.20);
}
.activities-list-card .card-title { color: #1d2a4d; }
.activities-list-card .card-body {
  background:
    radial-gradient(900px 400px at 100% 0%, rgba(13,110,253,0.06), transparent 60%),
    radial-gradient(900px 400px at 0% 100%, rgba(111,66,193,0.06), transparent 60%),
    linear-gradient(180deg, #ffffff, #f2f6ff);
}

/* Suggestions view: reduce side padding and gutters so two cards feel justified */
.suggestions-view.p-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.suggestions-view .suggestions-row { --bs-gutter-x: .5rem; }

/* Status Badges */
.status-planned {
  background-color: var(--info-color);
}

.status-in_progress {
  background-color: var(--warning-color);
}

.status-completed {
  background-color: var(--success-color);
}

.status-cancelled {
  background-color: var(--secondary-color);
}

.status-delayed {
  background-color: var(--danger-color);
}

/* Priority Badges - scope to .badge to avoid coloring entire cards */
.badge.priority-low { background-color: var(--info-color); }
.badge.priority-medium { background-color: var(--warning-color); }
.badge.priority-high { background-color: var(--danger-color); }
.badge.priority-urgent { background-color: #e83e8c; }

/* Forms */
.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-floating label {
  color: var(--secondary-color);
}

/* Buttons */
.btn {
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-weight: 500;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(45deg, var(--primary-color), #0056b3);
  border: none;
}

.btn-success {
  background: linear-gradient(45deg, var(--success-color), #1e7e34);
  border: none;
}

.btn-danger {
  background: linear-gradient(45deg, var(--danger-color), #c82333);
  border: none;
}

/* Tables */
.table {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
}

.table th {
  background-color: var(--light-color);
  font-weight: 600;
  border: none;
}

.table td {
  vertical-align: middle;
  border-color: rgba(0, 0, 0, 0.05);
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

/* Modal */
.modal-content {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Modal sticky sub-section headers and refinements */
.modal .sticky-subheader {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin: 6px 0 8px;
}

.modal .modal-section-header {
  background: linear-gradient(135deg, rgba(13,110,253,.06), rgba(111,66,193,.05));
  border: 1px solid rgba(0,0,0,0.06);
  border-left: 3px solid #0d6efd;
  border-radius: 6px;
}

/* Reset labels inside modals to avoid floating-label interference */
.modal .form-label {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  padding: 0;
  background: transparent;
  margin-bottom: 0.25rem;
  pointer-events: auto;
}

.modal .form-control,
.modal .form-select {
  height: auto;
  padding: 0.375rem 0.75rem;
}

/* Optional: ensure inner body scrolls comfortably in large modals */
.modal-dialog-scrollable .modal-body {
  max-height: calc(100vh - 220px);
}

/* Small rounded preview image in forms */
.modal img#photoPreview {
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-color), #0056b3);
  color: white;
  border-bottom: none;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header .btn-close {
  filter: invert(1);
}

/* Toast */
.toast {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--box-shadow);
}

.toast-header {
  background: linear-gradient(135deg, var(--success-color), #1e7e34);
  color: white;
  border-bottom: none;
}

.toast-header .btn-close {
  filter: invert(1);
}

/* Sidebar for Admin */
.sidebar {
  min-height: calc(100vh - 56px);
  background: white;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-nav a {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--dark-color);
  text-decoration: none;
  transition: var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background-color: rgba(0, 123, 255, 0.1);
  color: var(--primary-color);
  padding-left: 2rem;
}

/* Charts Container */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* File Upload */
.file-upload-area {
  border: 2px dashed var(--secondary-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: var(--primary-color);
  background-color: rgba(0, 123, 255, 0.05);
}

.file-upload-area.dragover {
  border-color: var(--success-color);
  background-color: rgba(40, 167, 69, 0.1);
}

/* Comments Section */
.comment-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem 0;
}

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

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--info-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

/* Progress Bars */
.progress {
  border-radius: var(--border-radius);
  height: 8px;
}

.progress-bar {
  border-radius: var(--border-radius);
  background: linear-gradient(90deg, var(--success-color), #20c997);
}

/* Utilities */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--info-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Embossed footer text */
.embossed {
  font-weight: 700;
  color: #2e2e2e;
  letter-spacing: 0.3px;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 -1px 0 rgba(0, 0, 0, 0.15),
    1px 0 0 rgba(0, 0, 0, 0.08),
    -1px 0 0 rgba(255, 255, 255, 0.6),
    0 2px 6px rgba(0,0,0,0.08);
}

.shadow-sm {
  box-shadow: var(--box-shadow);
}

.border-radius {
  border-radius: var(--border-radius);
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

.slide-up {
  animation: slideUp 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .stat-number {
    font-size: 2rem;
  }

  .stat-icon {
    font-size: 2.5rem;
  }

  .main-content {
    padding: 1rem;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    width: 280px;
    z-index: 1000;
    transition: var(--transition);
  }

  .sidebar.show {
    left: 0;
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
  }

  .sidebar-overlay.show {
    display: block;
  }
}

@media (max-width: 576px) {
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .card-body {
    padding: 1.5rem;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem;
  }

  .navbar-brand {
    font-size: 1.1rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #ffffff;
    --border-color: #404040;
  }

  .dark-mode {
    background-color: var(--bg-color);
    color: var(--text-color);
  }

  .dark-mode .card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
  }

  .dark-mode .navbar {
    background-color: var(--card-bg) !important;
  }
}

/* Loading States */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading-skeleton 1.5s infinite;
}

@keyframes loading-skeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-color);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Suggestions Page UI */
.btn-chip {
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  color: #333;
  padding: 6px 12px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.btn-chip.small { padding: 4px 10px; font-size: 12px; }
.btn-chip:hover { background: #f8f9fa; }
.btn-chip.active {
  background: linear-gradient(135deg, rgba(13,110,253,.1), rgba(111,66,193,.08));
  border-color: rgba(13,110,253,.35);
  color: #0d6efd;
  box-shadow: 0 2px 8px rgba(13,110,253,0.15);
}
.chip-group { display: flex; align-items: center; gap: 6px; }
.chip-group .chip-label { font-size: 12px; color: #6c757d; margin-right: 4px; }

.sug-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0,1fr));
  gap: 12px;
}
@media (min-width: 576px) {
  .sug-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (min-width: 992px) {
  .sug-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

.sug-card {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.sug-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.sug-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.sug-card-body { padding: 12px; }
.sug-card-footer {
  padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(0,0,0,0.05);
}
.sug-title { font-weight: 600; margin-bottom: 6px; }
.sug-message {
  font-size: 0.9rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.empty-state { text-align: center; padding: 24px 8px; }
.empty-state i { font-size: 42px; display: block; margin-bottom: 8px; }

.suggestion-form-card .form-text,
.suggestion-list-card .form-text { color: #6c757d; }

.suggestion-form-card textarea { resize: vertical; }

/* Suggestions layout refinements */
.suggestions-row { --bs-gutter-x: .75rem; --bs-gutter-y: .5rem; align-items: stretch; max-width: 1200px; margin-left: auto; margin-right: auto; }
.suggestion-form-card, .suggestion-list-card {
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}
.suggestion-form-card .card-header,
.suggestion-list-card .card-header {
  background: linear-gradient(135deg, rgba(13,110,253,.06), rgba(111,66,193,.05));
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.suggestion-list-card .card-header .btn,
.suggestion-list-card .card-header select {
  background-color: #fff;
}

/* Chip buttons (filters and type selector) */
.btn-chip {
  --chip-bg: #f8f9fa;
  --chip-fg: #495057;
  --chip-border: rgba(0,0,0,.08);
  border: 1px solid var(--chip-border);
  color: var(--chip-fg);
  background: var(--chip-bg);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
}
.btn-chip.small { padding: 3px 10px; font-size: .8rem; }
.btn-chip.active, .btn-chip:hover {
  --chip-bg: #e7f1ff;
  --chip-fg: #0d6efd;
  --chip-border: rgba(13,110,253,.35);
  color: var(--chip-fg);
  background: var(--chip-bg);
  border-color: var(--chip-border);
}
.chip-group { display: flex; align-items: center; gap: 6px; }
.chip-group .chip-label { font-size: .8rem; color: #6c757d; margin-right: 2px; }

/* Suggestions grid (non-admin right card) */
.sug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.sug-card {
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
  transition: transform .12s ease, box-shadow .12s ease;
  display: flex; flex-direction: column; min-height: 160px;
}
.sug-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.08); }
.sug-card-header { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px dashed rgba(0,0,0,.06); }
.sug-card-body { padding: 12px; }
.sug-card-footer { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed rgba(0,0,0,.06); }
.sug-title { font-weight: 700; color: #344767; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-message { font-size: .9rem; line-height: 1.4; }

/* Activities Filters Toolbar */
.filters-card {
  border: 1px solid rgba(13,110,253,0.15);
  box-shadow: 0 6px 16px rgba(13,110,253,0.06);
}
.filters-card .card-body {
  background: linear-gradient(135deg, rgba(13,110,253,0.06), rgba(111,66,193,0.05));
  border-radius: 0.5rem;
}
.filters-toolbar {
  display: flex;
  flex-wrap: wrap; /* wraps on smaller screens */
  gap: 12px;
  align-items: end;
}
.filters-toolbar .filter-item {
  min-width: 180px;
  flex: 1 1 200px;
}
.filters-toolbar .filter-actions {
  margin-left: auto;
}
@media (min-width: 1200px) {
  .filters-toolbar { flex-wrap: nowrap; }
  .filters-toolbar .filter-item { flex: 1 1 0; }
}

/* Users toolbar slim pagination and search */
.users-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap; /* keep inline on wide screens */
}
.users-toolbar .users-search {
  min-width: 260px;
  max-width: 320px;
  flex: 0 1 320px;
}
.users-toolbar #usersPageSize { flex: 0 0 auto; }
@media (max-width: 992px) {
  .users-toolbar { flex-wrap: wrap; }
}
.users-search .input-group-text { background: #fff; }
.users-search .form-control { border-left: 0; }
.users-search .btn { border-left: 0; }

.pagination-slim {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 4px;
  white-space: nowrap; /* prevent line breaks inside */
}
.pagination-slim .btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f5f6f8;
  border: 1px solid rgba(0,0,0,0.08);
  color: #495057;
}
.pagination-slim .btn:hover { background: #e9ecef; }
.pagination-slim .btn:disabled { opacity: .5; }
.pagination-slim .small.text-muted { font-weight: 500; }

/* HODs Overview card enhancements */
.hods-card .card-header {
  background: linear-gradient(135deg, rgba(13,110,253,.06), rgba(111,66,193,.05));
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.hods-card .card-title { font-weight: 700; }

/* Team size pill which shows popover on hover */
.team-size-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #f1f5ff;
  border: 1px solid rgba(13,110,253,.25);
  font-weight: 600;
  color: #0d6efd;
  text-decoration: none;
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.team-size-pill:hover { background: #e6efff; box-shadow: 0 2px 8px rgba(13,110,253,.15); transform: translateY(-1px); }

/* Popover with members grid */
.popover.hod-team-popover { max-width: 320px; }
.hod-team-popover .popover-body { padding: 8px 10px; }
.hod-team-popover .member-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}
.hod-team-popover .member-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 10px;
  text-decoration: none;
  color: #333;
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.hod-team-popover .member-item:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.hod-team-popover .member-item .avatar-xs { box-shadow: 0 1px 3px rgba(13,110,253,.18); }
.hod-team-popover .member-item .name { max-width: 86px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Department Overview circle grid */
.department-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1400px) { .department-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .department-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px) { .department-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dept-circle {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* perfect circle within grid cell */
  margin: 0 auto;
  background: radial-gradient(circle at 30% 30%, rgba(13,110,253,.10), #fff 65%);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 50%;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(13,110,253,.08);
  transition: transform .15s ease, box-shadow .15s ease;
}
.dept-circle:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.dept-name {
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  color: #344767;
  margin-bottom: 2px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dept-total {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0d6efd;
  line-height: 1;
  margin-bottom: 8px;
}
.dept-counts {
  position: absolute;
  bottom: 8px;
  left: 0; right: 0;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: center;
}
.dept-counts .badge { font-weight: 600; }
.dept-counts .badge { font-size: 0.65rem; }

/* Tighten spacing between neighboring cards in charts row */
.row-eq-height.g-3 > [class*='col-'] { margin-bottom: 0 !important; }
