@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Playfair+Display:wght@600;700&display=swap');@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');/* Toast Notification Styles */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  min-width: 300px;
  max-width: 500px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
  animation: toastSlideIn 0.3s ease-out;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

.toast-success {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.toast-error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.toast-info {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.toast-content {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  color: white;
  position: relative;
}

.toast-icon {
  font-size: 20px;
  margin-right: 12px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  margin-right: 12px;
}

.toast-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .toast {
    top: 10px;
    right: 10px;
    left: 10px;
    min-width: auto;
    max-width: none;
  }
  
  .toast-content {
    padding: 14px 16px;
  }
  
  .toast-message {
    font-size: 13px;
    margin-right: 8px;
  }
  
  .toast-icon {
    font-size: 18px;
    margin-right: 10px;
  }
}

/* Toast progress bar (optional) */
.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 0 0 12px 12px;
  animation: toastProgress 4s linear;
}

@keyframes toastProgress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* Additional toast animations */
.toast.toast-hiding {
  animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%) translateY(-10px);
  }
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Nunito', sans-serif;
}

/* ── Layout ── */
.login-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ══════════════════════════════════════════
   LEFT PANEL — Showcase
══════════════════════════════════════════ */
.login-left {
  flex: 1.1;
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
}

.login-left::before {
  content: '';
  position: absolute;
  top: -120px;
  left: -80px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(232, 32, 218, 0.08);
  pointer-events: none;
}

.login-left::after {
  content: '';
  position: absolute;
  bottom: -100px;
  right: -60px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(232, 32, 218, 0.06);
  pointer-events: none;
}

/* Brand block */
.left-brand {
  text-align: center;
  margin-bottom: 36px;
  position: relative;
  z-index: 2;
}

.left-brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(232, 32, 218, 0.45);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  object-fit: cover;
  margin-bottom: 12px;
}

.left-brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.left-brand p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Slideshow */
.showcase-slideshow {
  position: relative;
  width: 100%;
  max-width: 460px;
  z-index: 2;
}

.showcase-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 0.9s ease-in-out;
  pointer-events: none;
}

.showcase-slide.active {
  opacity: 1;
  position: relative;
  pointer-events: auto;
}

.showcase-slide-inner {
  text-align: center;
  color: #fff;
}

.slide-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: rgba(232, 32, 218, 0.18);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 32, 218, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
  animation: floatIcon 4s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.showcase-slide-inner h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  color: #fff;
}

.showcase-slide-inner p {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 24px;
  line-height: 1.6;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.showcase-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  margin: 0 auto;
}

.showcase-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(232, 32, 218, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(232, 32, 218, 0.25);
  border-radius: 12px;
  padding: 11px 16px;
  text-align: left;
  transition: background 0.3s;
}

.showcase-feature:hover {
  background: rgba(232, 32, 218, 0.22);
}

.sf-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.sf-text strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.sf-text span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
}

/* Slideshow dots */
.showcase-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 28px;
}

.showcase-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(232, 32, 218, 0.35);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.showcase-dot.active {
  background: #E820DA;
  width: 24px;
  border-radius: 4px;
}

/* ══════════════════════════════════════════
   RIGHT PANEL — Login Form
══════════════════════════════════════════ */
.login-right {
  flex: 0.9;
  background: #f5f0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  overflow-y: auto;
}

.login-card {
  background: #fff;
  border: 1px solid rgba(0, 32, 96, 0.15);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 32, 96, 0.12);
  width: 100%;
  max-width: 400px;
  animation: slideUp 0.55s ease-out both;
 }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Card header */
.card-header {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  padding: 22px 20px 18px;
  text-align: center;
  border-radius: 20px 20px 0 0;
  color: #fff;
}

.pic-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  margin-bottom: 8px;
  object-fit: cover;
}

.card-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: #fff;
}

.card-header p {
  font-size: 0.8rem;
  opacity: 0.85;
  font-weight: 500;
  color: #fff;
}

/* Card body */
.card-body {
  padding: 20px 28px 14px;
}

.welcome-section h2 {
  font-size: 1.20rem;
  font-weight: 700;
  color: #002060;
  text-align: center;
  margin-bottom: 2px;
}

.welcome-section > p {
  color: #7a7a8a;
  text-align: center;
  font-size: 0.8rem;
  margin-bottom: 16px;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #002060;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 13px;
  color: #E820DA;
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  padding: 9px 42px 9px 42px;
  border: 1.5px solid rgba(0, 32, 96, 0.2);
  border-radius: 9px;
  font-size: 0.88rem;
  font-family: 'Nunito', sans-serif;
  background: #f8f5ff;
  color: #002060;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.form-input::placeholder {
  color: #a0a0b8;
}

.form-input:focus {
  outline: none;
  border-color: #E820DA;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(232, 32, 218, 0.12);
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #a0a0c0;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s;
  display: flex;
}

.password-toggle:hover {
  color: #002060;
}

/* Options row */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #6b7280;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #E820DA;
}

.forgot-link {
  background: none;
  border: none;
  color: #002060;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
  transition: color 0.2s;
  align-items: center;
  text-align: center;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.forgot-link:hover {
  color: #E820DA;
  text-decoration: underline;
}

/* Sign in button */
.sign-in-button {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: #fff;
  border: none;
  padding: 11px 16px;
  border-radius: 11px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  letter-spacing: 0.3px;
}

.sign-in-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 32, 96, 0.35);
}

.sign-in-button:active:not(:disabled) {
  transform: translateY(0);
}

.sign-in-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error / success messages */
.error-message {
  background: #fee8e8;
  color: #b91c1c;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 0.78rem;
  border-left: 3px solid #e53e3e;
  border-radius: 0;
}

.success-message {
  background: #d1fae5;
  color: #065f46;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 0.78rem;
  border-left: 3px solid #059669;
  border-radius: 0;
}

/* Card footer */
.card-footer {
  padding: 10px 20px 14px;
  border-top: 1px solid rgba(232, 32, 218, 0.12);
  background: linear-gradient(to right, rgba(0, 32, 96, 0.04), rgba(232, 32, 218, 0.04));
  border-radius: 0 0 20px 20px;
  text-align: center;
}

.card-footer > * {
  margin-left: auto;
  margin-right: auto;
}

.copyright p {
  color: #002060;
  font-size: 0.68rem;
  text-align: center;
}

/* ── 2FA ── */
.twofa-container {
  background: #f5f0ff;
  border: 1px solid rgba(0, 32, 96, 0.15);
  padding: 18px;
  border-radius: 12px;
  text-align: center;
}

.twofa-title {
  font-size: 1rem;
  font-weight: 800;
  color: #002060;
  margin-bottom: 6px;
}

.twofa-subtitle {
  font-size: 0.78rem;
  color: #5a5070;
  margin-bottom: 14px;
  line-height: 1.5;
}

.twofa-input {
  width: 100%;
  font-size: 1.4rem;
  letter-spacing: 10px;
  text-align: center;
  padding: 10px;
  border-radius: 9px;
  border: 1.5px solid rgba(0, 32, 96, 0.2);
  margin-bottom: 12px;
  font-family: 'Nunito', monospace;
  color: #002060;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.twofa-input:focus {
  border-color: #E820DA;
}

.twofa-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  margin-bottom: 10px;
}

.twofa-back {
  background: none;
  border: none;
  color: #002060;
  margin-top: 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: 'Nunito', sans-serif;
}

.twofa-back:hover {
  color: #E820DA;
  text-decoration: underline;
}

.twofa-success {
  text-align: center;
  padding: 16px;
}

.success-icon {
  font-size: 44px;
  margin-bottom: 8px;
}

/* ── Security warning ── */
.security-warning {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 12px;
  background: linear-gradient(135deg, #fff8e6, #fff3cd);
  border-radius: 12px;
  border: 1px solid #ffeaa7;
}

.security-warning h3 {
  color: #853e04;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.security-warning p {
  color: #856404;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 6px;
}

.warning-icon {
  width: 52px;
  height: 52px;
  background: #ffc107;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* ── Forgot / Reset forms ── */
.form-header {
  text-align: center;
  margin-bottom: 14px;
}

.form-header h3 {
  color: #002060;
  font-size: 1.1rem;
  margin-bottom: 4px;
  font-weight: 800;
}

.form-header p {
  color: #7a7a8a;
  font-size: 0.78rem;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.back-button {
  flex: 1;
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: #002060;
  border: none;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}

.back-button:hover {
  background: rgba(0, 32, 96, 0.14);
}

.submit-button {
  flex: 2;
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 32, 96, 0.3);
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Toast (bottom-right, fixed box, won't collapse) ── */
/* .toast-container {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  left: auto !important;
  top: auto !important;
  width: 320px !important;
  max-width: 90vw !important;
  min-width: 320px !important;
  box-sizing: border-box !important;
  z-index: 9999;
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: toastSlide 0.3s ease-out;
} */

@keyframes toastSlide {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast-success {
  background: #22c55e !important;
  color: #fff !important;
}

.toast-error {
  background: #ef4444 !important;
  color: #fff !important;
}

.toast-info {
  background: #002060 !important;
  color: #fff !important;
}

.toast-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex !important;
}

.toast-icon svg {
  width: 22px !important;
  height: 22px !important;
}

.toast-message {
  flex: 1 !important;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  color: inherit !important;
  display: block !important;
}

.toast-close-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: transparent !important;
  border: none;
  color: rgba(255, 255, 255, 0.85) !important;
  cursor: pointer;
  padding: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.toast-close-btn svg {
  width: 18px !important;
  height: 18px !important;
}

.toast-close-btn:hover {
  color: #fff !important;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .login-left { display: none; }
  .login-right { flex: 1; }
}

@media (max-width: 640px) {
  .toast-container {
    bottom: 12px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    min-width: 0 !important;
  }
}

@media (max-width: 480px) {
  .login-right { padding: 16px 12px; }
  .card-body { padding: 16px 18px 12px; }
  .welcome-section h2 { font-size: 1.1rem; }
}.caredotes-loader,
.caredotes-loader * {
  box-sizing: border-box;
}

.caredotes-loader {
  --ring-size: 82px;
  --ring-thickness: 8;
  --primary-color: #002060;
  --secondary-color: #002060;
  --animation-duration: 1.4s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 32px;
}

.caredotes-container {
  position: relative;
  width: var(--ring-size);
  height: var(--ring-size);
  display: flex;
  align-items: center;
  justify-content: center;
}

.healing-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: healing-spin var(--animation-duration) linear infinite;
}

@keyframes healing-spin {
  to { transform: rotate(360deg); }
}

.caredotes-logo-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.caredotes-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 6px 16px -4px rgba(139, 40, 160, 0.35);
}

.caredotes-sm { --ring-size: 56px; --ring-thickness: 6; min-height: 100px; }
.caredotes-sm .caredotes-logo { width: 38px; height: 38px; }

.caredotes-md { --ring-size: 82px; --ring-thickness: 8; min-height: 150px; }

.caredotes-lg { --ring-size: 102px; --ring-thickness: 7; min-height: 200px; }
.caredotes-lg .caredotes-logo { width: 74px; height: 74px; }

@media (prefers-reduced-motion: reduce) {
  .healing-ring-svg { animation: none; }
}

@media (prefers-color-scheme: dark) {
  .caredotes-logo { background: #1a1a1a; }
}
.caredotes-text {
  margin-top: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #002060;
  text-align: center;
}/* =====================================================================
   CARE RUNNER – HEADER
   Single stylesheet (replaces Header.css + Header2.css).
   Palette is unchanged: magenta #E820DA / navy #002060 split header,
   lime time/bell accents, pink active states.
   ===================================================================== */

:root {
  --hdr-magenta: #e820da;
  --hdr-magenta-dark: #d326c7;
  --hdr-navy: #002060;
  --hdr-pink: #e91e63;
  --hdr-pink-dark: #c2185b;
  --hdr-lime: #dbff58;
  --hdr-bell: #e1fa02;
  --hdr-text: #333;
  --hdr-border: #ddd;
  --hdr-radius: 8px;
  --hdr-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ---------- Header shell ---------- */
.header {
  background: linear-gradient(135deg, #e820da 50%, #002060 50%);
  color: #fff;
  box-shadow: var(--hdr-shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.header *,
.header *::before,
.header *::after {
  box-sizing: border-box;
}

.header button {
  font-family: inherit;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 18px;
  flex-wrap: nowrap;
  position: relative;
  min-height: 56px;
}

/* ---------- Logo ---------- */
.logo-section {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
}

.logo-icon {
  margin: 0;
  display: inline-flex;
}

.pic-logoz {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.logo-texts {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.logo-subtext {
  font-size: 10px;
  font-weight: 500;
  color: #ffe6f7;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

/* ---------- Navigation (desktop) ---------- */
.navigation {
  display: flex;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.55) rgba(0, 0, 0, 0.15);
}

.navigation::-webkit-scrollbar {
  height: 5px;
}

.navigation::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}

.navigation::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 3px;
}

.nav-items {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  margin: 0;
  padding: 2px 0;
  min-width: max-content;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 62px;
  padding: 3px 9px;
  border: 1px solid var(--hdr-magenta-dark);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.nav-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.nav-item:focus-visible,
.tab-button:focus-visible,
.header button:focus-visible {
  outline: 2px solid var(--hdr-lime);
  outline-offset: 2px;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.34);
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.7);
}

.nav-item.is-disabled,
.nav-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.cr-nav-icon {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.cr-nav-label {
  font-size: 11px;
  text-align: center;
}

.nav-logout-item,
.mobile-nav-logo,
.mobile-nav-close,
.menu-overlay {
  display: none;
}

/* ---------- User section ---------- */
.user-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

.time-display {
  font-size: 13px;
  font-weight: 800;
  color: var(--hdr-lime);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.user-info {
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  color: #e4e3d9;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: background 0.2s;
}

.user-info:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Round icon buttons: bell, mail, logout, burger */
.cr-notification-badge-container,
.cr-message-badge-container {
  position: relative;
  display: inline-block;
  margin: 0 2px;
  flex-shrink: 0;
}

.cr-notification-badge-button,
.cr-message-badge-button,
.logout-button--desktop,
.mobile-menu-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
  color: var(--hdr-bell);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.cr-notification-badge-button:hover,
.cr-message-badge-button:hover,
.logout-button--desktop:hover,
.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.cr-notification-badge-button:active,
.cr-message-badge-button:active,
.logout-button--desktop:active,
.mobile-menu-toggle:active {
  transform: scale(0.95);
}

.logout-button--desktop {
  background: #000;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.mobile-menu-toggle {
  display: none;
  color: #fff;
}

.cr-badge-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 2px solid #c923be;
  background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(255, 71, 87, 0.45);
  animation: cr-pulse-badge 2s infinite;
  z-index: 2;
}

@keyframes cr-pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.logout-button--text {
  padding: 6px 14px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.logout-button--text:hover {
  background: rgba(255, 255, 255, 0.32);
}

.blocked-message {
  flex: 1;
  text-align: center;
  color: #ff4444;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  padding: 6px 10px;
}

/* ---------- Notification dropdown ---------- */
.cr-notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 24px);
  max-height: 500px;
  background: #fff;
  color: var(--hdr-text);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  z-index: 1100;
  overflow: hidden;
  animation: cr-dropdown-slide-in 0.25s ease;
}

@keyframes cr-dropdown-slide-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.cr-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cr-dropdown-header h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cr-dropdown-count-badge {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 0.75rem;
}

.cr-view-all-button {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cr-view-all-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.cr-dropdown-body {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
}

.cr-no-notifications {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 20px;
  color: #a0aec0;
  text-align: center;
}

.cr-no-notifications p {
  margin: 0;
}

.cr-notification-item {
  position: relative;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cr-notification-item:hover {
  background: #edf2f7;
  transform: translateX(3px);
}

.cr-notification-item.cr-unread {
  background: linear-gradient(135deg, #ebf8ff 0%, #f0f4ff 100%);
  border-color: #667eea;
  border-left-width: 4px;
}

.cr-notification-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cr-notification-header-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cr-notification-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.cr-notification-type-badge.company { background: #faf5ff; border: 1px solid #d6bcfa; }
.cr-notification-type-badge.group { background: #f0fff4; border: 1px solid #9ae6b4; }
.cr-notification-type-badge.individual { background: #ebf8ff; border: 1px solid #90cdf4; }
.cr-notification-type-badge.amber { background: #fffbeb; border: 1px solid #fcd34d; color: #b45309; }

.cr-notification-time {
  font-size: 0.8rem;
  color: #a0aec0;
  font-weight: 500;
}

.cr-notification-content h5 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2d3748;
}

.cr-notification-content p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #4a5568;
}

.cr-notification-from {
  opacity: 0.7;
}

.cr-unread-dot {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #667eea;
}

/* ---------- Toast popup ---------- */
.cr-msg-popup {
  position: fixed;
  top: 72px;
  right: 18px;
  width: 340px;
  max-width: calc(100vw - 24px);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
  background: #fff;
  color: var(--hdr-text);
  border-radius: 16px;
  border-left: 4px solid #7c3aed;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
  z-index: 99999;
  animation: cr-msg-popup-in 0.38s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

.cr-msg-popup--amber { border-left-color: #f59e0b; background: #fffbeb; }
.cr-msg-popup--reminder { border-left-color: #667eea; }
.cr-msg-popup--audit { border-left-color: #8b5cf6; }

@keyframes cr-msg-popup-in {
  from { opacity: 0; transform: translateX(110%) scale(0.92); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.cr-msg-popup__close {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #666;
  cursor: pointer;
}

.cr-msg-popup__close:hover {
  background: rgba(0, 0, 0, 0.12);
}

.cr-msg-popup__avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
}

.cr-msg-popup__avatar-img,
.cr-msg-popup__avatar-initials {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

.cr-msg-popup__avatar-img {
  object-fit: cover;
  border: 2px solid #efefef;
}

.cr-msg-popup__avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.cr-msg-popup__online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #22c55e;
  border: 2px solid #fff;
  border-radius: 50%;
}

.cr-msg-popup__body {
  flex: 1;
  min-width: 0;
  padding-right: 20px;
}

.cr-msg-popup__header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.cr-msg-popup__app-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #7c3aed;
  text-transform: uppercase;
}

.cr-msg-popup__time {
  font-size: 10px;
  color: #a0aec0;
}

.cr-msg-popup__sender {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 700;
  color: #1a202c;
}

.cr-msg-popup__text {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #4a5568;
  overflow-wrap: anywhere;
}

.cr-msg-popup__reply-btn {
  padding: 5px 16px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.cr-msg-popup__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  animation: cr-msg-popup-timer 6s linear forwards;
}

@keyframes cr-msg-popup-timer {
  from { width: 100%; }
  to { width: 0%; }
}

/* ---------- Sub toolbars (tabs) ---------- */
.schedule-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 5px 20px;
  background: #fff;
  color: var(--hdr-text);
  border-top: 1px solid var(--hdr-border);
}

.schedule-controls--people { background: #f5f5f5; }
.schedule-controls--hr { background: #f0f8ff; }
.schedule-controls--finance { background: #fff8f0; }
.schedule-controls--website { background: #f0f9ff; }
.schedule-controls--settings { background: #f8f9fa; }

.hr-system-bg { background-color: #f0f8ff; }
.finance-system-bg { background-color: #fff8f0; }

.schedule-tabs {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 5px;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #b6bfcc transparent;
  -webkit-overflow-scrolling: touch;
}

.schedule-tabs::-webkit-scrollbar {
  height: 5px;
}

.schedule-tabs::-webkit-scrollbar-thumb {
  background: #b6bfcc;
  border-radius: 3px;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 8px 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--hdr-text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-icon {
  display: inline-flex;
  line-height: 0;
}

.tab-button:hover {
  background: #f0f0f0;
}

.tab-button.active {
  border-bottom-color: var(--hdr-pink);
  color: var(--hdr-pink);
  background: none;
}

/* Pill style tabs for the themed toolbars */
.schedule-controls--people .tab-button,
.schedule-controls--website .tab-button,
.schedule-controls--settings .tab-button {
  border: 1px solid;
  border-radius: 6px;
}

.schedule-controls--people .tab-button { background: #f0f8ff; border-color: #a8dadc; color: #333; }
.schedule-controls--people .tab-button.active { background: #852190; border-color: #69a721; color: #fff; }

.schedule-controls--website .tab-button { background: #e0f2fe; border-color: #bae6fd; color: #333; }
.schedule-controls--website .tab-button.active { background: #0ea5e9; border-color: #0284c7; color: #fff; }

.schedule-controls--settings .tab-button { background: #e2e8f0; border-color: #cbd5e0; color: #333; }
.schedule-controls--settings .tab-button.active { background: #4a5568; border-color: #2d3748; color: #fff; }

/* ---------- Care App toolbar ---------- */
.schedule-controls--care {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto auto;
  align-items: center;
  gap: 10px;
}

.summary-wrap {
  min-width: 0;
}

.summary_calls {
  display: flex;
  align-items: center;
  max-width: 100%;
  padding: 6px 10px;
  background-color: rgba(251, 253, 209, 0.7);
  border: 1px solid #e9ecef;
  border-radius: 6px;
  color: #2f4632;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary_calls span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.summary_calls em {
  font-style: normal;
  opacity: 0.85;
}

.summary-divider {
  display: inline-block;
  width: 1px;
  height: 14px;
  margin: 0 4px;
  background: #b8c4b0;
}

.date-selection {
  display: flex;
  gap: 8px;
}

.date-dropdown {
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f5f5f5;
  color: #4676ba;
  font-size: 13px;
  cursor: pointer;
}

.date-dropdown:focus {
  outline: none;
  border-color: var(--hdr-pink);
}

.search-section {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 160px;
  max-width: 220px;
  border-radius: 18px;
  background-color: #d8d7d8;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: #6b7280;
  pointer-events: none;
}

.rota-search-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 6px 10px 6px 30px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: none;
  font-size: 13px;
  outline: none;
}

.rota-search-input:focus {
  border-color: rgb(35, 157, 209);
  background-color: rgb(228, 228, 221);
}

.extra-controls {
  display: flex;
  gap: 6px;
}

.hdr-action-btn {
  padding: 6px 12px;
  border: 1px solid #7fb8fe;
  border-radius: 6px;
  background: #5776a3;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: background 0.2s, transform 0.15s;
}

.hdr-action-btn:hover {
  background: #01407b;
  transform: translateY(-1px);
}

.app-downloads {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Date strip ---------- */
.daily-rota-header {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 2px 5px;
  overflow-x: auto;
  background-color: #fff;
  color: var(--hdr-text);
  border-top: 1px solid var(--hdr-border);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.calendar-wrapper {
  position: relative;
}

.calendar-watermark {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  font-weight: 500;
  color: rgba(222, 28, 141, 0.54);
  z-index: 10;
  pointer-events: none;
}

.date-controls-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
}

.month-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px 4px;
  border: none;
  border-radius: 6px;
  background: #dededf;
  color: #333;
  cursor: pointer;
  transition: 0.2s;
}

.month-arrow:hover {
  background: #c8f97a;
}

.month-arrow.left { margin-right: 4px; }
.month-arrow.right { margin-left: 4px; }

.week-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: fit-content;
  padding: 1px;
  border-top: 2.5px solid rgba(193, 30, 229, 0.53);
  border-radius: 8px;
  background-color: #faffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.week-days {
  display: flex;
  flex-wrap: nowrap;
  gap: 5.5px;
  z-index: 1;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  min-width: 35px;
  max-width: 45px;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  scroll-snap-align: center;
}

.day:hover { background-color: #f0f0f0; }

.day.today {
  background-color: #f0f8ff;
  border-color: #4a90e2;
  font-weight: 700;
}

.day.today:hover { background-color: #dbe9ff; }

.day.active {
  background-color: var(--hdr-pink);
  border-color: var(--hdr-pink);
  color: #fff;
  font-weight: 700;
}

.day.active:hover { background-color: var(--hdr-pink-dark); }

.day.active .day-num { color: #fff; }

.day-name {
  font-size: 10px;
  text-transform: uppercase;
  opacity: 0.8;
}

.day-num {
  font-size: 13px;
  font-weight: 700;
  color: #3e5b73;
}

.day-num:hover { color: #0080ff; }

/* ---------- Dialogs ---------- */
.logout-dialog-overlay,
.refresh-prompt-overlay,
.logout-prompt-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 9999;
  color: var(--hdr-text);
}

.logout-dialog,
.refresh-prompt,
.logout-prompt {
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  background: #fff;
  animation: dialogSlideIn 0.3s ease-out;
}

.logout-dialog {
  border: 3px solid rgb(153, 24, 134);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.logout-dialog--narrow { max-width: 400px; }

.refresh-prompt,
.logout-prompt {
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

@keyframes dialogSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.logout-dialog-header {
  padding: 24px 24px 16px;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
}

.logout-dialog-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.logout-dialog-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #333;
}

.logout-dialog-content {
  padding: 20px 24px;
  text-align: center;
}

.logout-dialog-message {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.5;
  color: #555;
}

.logout-dialog-submessage {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: #888;
}

.logout-dialog-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 4px 18px 20px;
}

.logout-dialog-button {
  min-width: 100px;
  padding: 11px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.security-input {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.security-error {
  margin: 8px 0 0;
  font-size: 13px;
  text-align: center;
  color: #ef4444;
}

/* refresh + auto logout prompts */
.refresh-prompt-header,
.logout-prompt-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.refresh-prompt-title,
.logout-prompt-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.refresh-prompt-content,
.logout-prompt-content {
  padding: 16px 20px;
}

.refresh-prompt-message,
.logout-prompt-message {
  margin: 0 0 8px;
  font-size: 16px;
  color: #333;
}

.refresh-prompt-submessage,
.logout-prompt-submessage {
  margin: 0;
  font-size: 14px;
  color: #666;
}

.refresh-prompt-actions,
.logout-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #eee;
  background-color: #f9f9f9;
}

.refresh-prompt-button,
.logout-prompt-button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.logout-cancel-button,
.refresh-cancel-button {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.logout-cancel-button:hover,
.refresh-cancel-button:hover {
  background: #e8e8e8;
  color: #333;
}

.logout-confirm-button {
  background: linear-gradient(135deg, #e91e63, #c2185b);
  color: #fff;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.logout-confirm-button:hover {
  background: linear-gradient(135deg, #c2185b, #ad1457);
  box-shadow: 0 6px 16px rgba(233, 30, 99, 0.4);
}

.refresh-confirm-button {
  background-color: #3182ce;
  color: #fff;
}

.refresh-confirm-button:hover {
  background-color: #2b6cb0;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

/* Large laptops: tighten a little, nav scrolls if it must */
@media (max-width: 1280px) {
  .logo-subtext,
  .time-display {
    display: none;
  }

  .schedule-controls--care {
    grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  }

  .summary-wrap {
    grid-column: 1 / -1;
    order: 5;
  }
}

/* Tablets and below: slide-in drawer navigation */
@media (max-width: 1024px) {
  .header-top {
    padding: 4px 12px;
  }

  .nav-item {
    min-width: 56px;
    padding: 3px 7px;
  }

  .cr-nav-label {
    font-size: 10px;
  }
}

/* Slightly tighter nav buttons on mid-size screens */
@media (max-width: 1700px) {
  .nav-items {
    gap: 6px;
  }

  .nav-item {
    min-width: 56px;
    padding: 3px 6px;
  }

  .cr-nav-label {
    font-size: 10px;
  }
}

/* Drawer menu: the 15 nav buttons need ~1500px, so switch earlier than before */
@media (max-width: 1500px) {
  .mobile-menu-toggle {
    display: inline-flex;
  }

  .navigation {
    position: fixed;
    top: 0;
    left: -290px;
    z-index: 1003;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: linear-gradient(180deg, #d326c7 50%, #09080a 0%, #002060 50%);
    box-shadow: 4px 0 18px rgba(0, 0, 0, 0.4);
    transition: left 0.3s ease-in-out;
  }

  .navigation.mobile-open {
    left: 0;
  }

  .mobile-nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.15);
  }

  .mobile-nav-logo img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
  }

  .mobile-nav-logo-texts {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
  }

  .mobile-nav-logo .logo-text {
    font-size: 17px;
  }

  .mobile-nav-user {
    font-size: 12px;
    color: var(--hdr-lime);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
  }

  .nav-items {
    flex-direction: column;
    width: 100%;
    min-width: 0;
    gap: 0;
    padding: 8px 0 24px;
  }

  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    width: 100%;
    min-width: 0;
    padding: 13px 20px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid transparent;
    border-radius: 0;
    box-shadow: none;
    font-size: 15px;
  }

  .nav-item:hover:not(:disabled) {
    transform: none;
  }

  .nav-item.active {
    border-left-color: #fff;
    background: rgba(255, 255, 255, 0.25);
  }

  .cr-nav-label {
    font-size: 15px;
    text-align: left;
  }

  .nav-logout-item {
    display: flex;
    margin-top: 6px;
  }

  .menu-overlay.active {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: block;
    background: rgba(0, 0, 0, 0.6);
  }

  .logout-button--desktop {
    display: none;
  }

  .user-section {
    gap: 6px;
  }

  .search-section {
    max-width: none;
  }
}

/* Phones */
@media (max-width: 768px) {
  .pic-logoz {
    width: 34px;
    height: 34px;
  }

  .logo-text {
    font-size: 15px;
  }

  .cr-notification-badge-button,
  .cr-message-badge-button,
  .mobile-menu-toggle {
    width: 34px;
    height: 34px;
  }

  .cr-notification-badge-button svg,
  .cr-message-badge-button svg {
    width: 16px;
    height: 16px;
  }

  .user-info {
    padding: 2px 4px;
    font-size: 12px;
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* toolbars */
  .schedule-controls {
    padding: 5px 10px;
  }

  .schedule-controls--care {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .schedule-controls--care .schedule-tabs {
    grid-column: 1 / -1;
  }

  .summary-wrap {
    grid-column: 1 / -1;
    order: 2;
  }

  .summary_calls {
    overflow-x: auto;
    text-overflow: clip;
    scrollbar-width: none;
  }

  .summary_calls::-webkit-scrollbar { display: none; }

  .date-selection {
    order: 3;
  }

  .search-section {
    order: 4;
    min-width: 0;
    width: 100%;
  }

  .extra-controls {
    order: 5;
    grid-column: 1 / -1;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .extra-controls::-webkit-scrollbar { display: none; }

  .hdr-action-btn {
    flex: 1 0 auto;
    padding: 8px 12px;
  }

  .app-downloads {
    order: 6;
    grid-column: 1 / -1;
    justify-content: center;
  }

  .date-dropdown {
    flex: 1;
  }

  .tab-button {
    padding: 8px 10px;
  }

  /* date strip */
  .calendar-watermark {
    font-size: 16px;
  }

  .logout-dialog-actions {
    flex-direction: column;
  }

  .logout-dialog-button {
    width: 100%;
    min-width: 0;
  }

  .refresh-prompt-actions,
  .logout-prompt-actions {
    flex-direction: column-reverse;
  }

  .refresh-prompt-button,
  .logout-prompt-button {
    width: 100%;
    padding: 10px 16px;
  }

  .cr-msg-popup {
    top: 64px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }

  .cr-notification-dropdown {
    position: fixed;
    top: 60px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (max-width: 400px) {
  .logo-text {
    font-size: 14px;
  }

  .user-info {
    display: none;
  }

  .header-top {
    gap: 8px;
    padding: 4px 8px;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .cr-badge-count,
  .cr-msg-popup,
  .logout-dialog,
  .refresh-prompt,
  .logout-prompt,
  .cr-notification-dropdown {
    animation: none;
  }

  .navigation {
    transition: none;
  }
}/* End extract */
.w3-image {
    max-width: 100%;
    height: auto
}

.w3-table,
.w3-table-all {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    display: table
}

.w3-table-all {
    border: 1px solid #ccc
}

.w3-bordered tr,
.w3-table-all tr {
    border-bottom: 1px solid #ddd
}

.w3-striped tbody tr:nth-child(even) {
    background-color: #f1f1f1
}

.w3-table-all tr:nth-child(odd) {
    background-color: #fff
}

.w3-table-all tr:nth-child(even) {
    background-color: #f1f1f1
}

.w3-hoverable tbody tr:hover,
.w3-ul.w3-hoverable li:hover {
    background-color: #ccc
}

.w3-centered tr th,
.w3-centered tr td {
    text-align: center
}

.w3-table td,
.w3-table th,
.w3-table-all td,
.w3-table-all th {
    padding: 8px 8px;
    display: table-cell;
    text-align: left;
    vertical-align: top
}

.w3-table th:first-child,
.w3-table td:first-child,
.w3-table-all th:first-child,
.w3-table-all td:first-child {
    padding-left: 16px
}

.w3-btn,
.w3-button {
    border: none;
    display: inline-block;
    padding: 8px 16px;
    vertical-align: middle;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background-color: inherit;
    text-align: center;
    cursor: pointer;
    white-space: nowrap
}

.w3-btn:hover {
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)
}

.w3-btn,
.w3-button {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none
}

.w3-disabled,
.w3-btn:disabled,
.w3-button:disabled {
    cursor: not-allowed;
    opacity: 0.3
}

.w3-disabled *,
:disabled * {
    pointer-events: none
}

.w3-btn.w3-disabled:hover,
.w3-btn:disabled:hover {
    box-shadow: none
}

.w3-badge,
.w3-tag {
    background-color: #000;
    color: #fff;
    display: inline-block;
    padding-left: 8px;
    padding-right: 8px;
    text-align: center
}

.w3-badge {
    border-radius: 50%
}

.w3-ul {
    list-style-type: none;
    padding: 0;
    margin: 0
}

.w3-ul li {
    padding: 8px 16px;
    border-bottom: 1px solid #ddd
}

.w3-ul li:last-child {
    border-bottom: none
}

.w3-tooltip,
.w3-display-container {
    position: relative
}

.w3-tooltip .w3-text {
    display: none
}

.w3-tooltip:hover .w3-text {
    display: inline-block
}

.w3-ripple:active {
    opacity: 0.5
}

.w3-ripple {
    transition: opacity 0s
}

.w3-input {
    padding: 8px;
    display: block;
    border: none;
    border-bottom: 1px solid #ccc;
    width: 100%
}

.w3-select {
    padding: 9px 0;
    width: 100%;
    border: none;
    border-bottom: 1px solid #ccc
}

.w3-dropdown-click,
.w3-dropdown-hover {
    position: relative;
    display: inline-block;
    cursor: pointer
}

.w3-dropdown-hover:hover .w3-dropdown-content {
    display: block
}

.w3-dropdown-hover:first-child,
.w3-dropdown-click:hover {
    background-color: #ccc;
    color: #000
}

.w3-dropdown-hover:hover>.w3-button:first-child,
.w3-dropdown-click:hover>.w3-button:first-child {
    background-color: #ccc;
    color: #000
}

.w3-dropdown-content {
    cursor: auto;
    color: #000;
    background-color: #fff;
    position: absolute;
    min-width: 100%;
    max-height: 250px;
    overflow: auto;
    margin: 0;
    padding: 0;
    z-index: 10000
}

.w3-check,
.w3-radio {
    width: 24px;
    height: 24px;
    position: relative;
    top: 6px
}

.w3-sidebar {
    height: 100%;
    width: 200px;
    background-color: #fff;
    position: fixed !important;
    z-index: 1;
    overflow: auto
}

.w3-bar-block .w3-dropdown-hover,
.w3-bar-block .w3-dropdown-click {
    width: 100%
}

.w3-bar-block .w3-dropdown-hover .w3-dropdown-content,
.w3-bar-block .w3-dropdown-click .w3-dropdown-content {
    min-width: 100%
}

.w3-bar-block .w3-dropdown-hover .w3-button,
.w3-bar-block .w3-dropdown-click .w3-button {
    width: 100%;
    text-align: left;
    padding: 8px 16px
}

.w3-modal {
    z-index: 3;
    display: none;
    padding-top: 100px;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.4)
}

.w3-modal-content {
    margin: auto;
    background-color: #fff;
    position: relative;
    padding: 0;
    outline: 0;
    width: 600px
}

.w3-bar {
    width: 100%;
    overflow: hidden
}

.w3-center .w3-bar {
    display: inline-block;
    width: auto
}

.w3-bar .w3-bar-item {
    padding: 8px 16px;
    float: left;
    width: auto;
    border: none;
    display: block;
    outline: 0
}

.w3-bar .w3-dropdown-hover,
.w3-bar .w3-dropdown-click {
    position: static;
    float: left
}

.w3-bar .w3-button {
    white-space: normal
}

.w3-bar-block .w3-bar-item {
    width: 100%;
    display: block;
    padding: 8px 16px;
    text-align: left;
    border: none;
    white-space: normal;
    float: none;
    outline: 0
}

.w3-bar-block.w3-center .w3-bar-item {
    text-align: center
}

.w3-block {
    display: block;
    width: 100%
}

.w3-responsive {
    display: block;
    overflow-x: auto
}

.w3-container:after,
.w3-container:before,
.w3-panel:after,
.w3-panel:before,
.w3-row:after,
.w3-row:before,
.w3-row-padding:after,
.w3-row-padding:before,
.w3-cell-row:before,
.w3-cell-row:after,
.w3-clear:after,
.w3-clear:before,
.w3-bar:before,
.w3-bar:after {
    content: "";
    display: table;
    clear: both
}

.w3-col,
.w3-half,
.w3-third,
.w3-twothird,
.w3-threequarter,
.w3-quarter {
    float: left;
    width: 100%
}

.w3-col.s1 {
    width: 8.33333%
}

.w3-col.s2 {
    width: 16.66666%
}

.w3-col.s3 {
    width: 24.99999%
}

.w3-col.s4 {
    width: 33.33333%
}

.w3-col.s5 {
    width: 41.66666%
}

.w3-col.s6 {
    width: 49.99999%
}

.w3-col.s7 {
    width: 58.33333%
}

.w3-col.s8 {
    width: 66.66666%
}

.w3-col.s9 {
    width: 74.99999%
}

.w3-col.s10 {
    width: 83.33333%
}

.w3-col.s11 {
    width: 91.66666%
}

.w3-col.s12 {
    width: 99.99999%
}

@media (min-width:601px) {
    .w3-col.m1 {
        width: 8.33333%
    }

    .w3-col.m2 {
        width: 16.66666%
    }

    .w3-col.m3,
    .w3-quarter {
        width: 24.99999%
    }

    .w3-col.m4,
    .w3-third {
        width: 33.33333%
    }

    .w3-col.m5 {
        width: 41.66666%
    }

    .w3-col.m6,
    .w3-half {
        width: 49.99999%
    }

    .w3-col.m7 {
        width: 58.33333%
    }

    .w3-col.m8,
    .w3-twothird {
        width: 66.66666%
    }

    .w3-col.m9,
    .w3-threequarter {
        width: 74.99999%
    }

    .w3-col.m10 {
        width: 83.33333%
    }

    .w3-col.m11 {
        width: 91.66666%
    }

    .w3-col.m12 {
        width: 99.99999%
    }
}

@media (min-width:993px) {
    .w3-col.l1 {
        width: 8.33333%
    }

    .w3-col.l2 {
        width: 16.66666%
    }

    .w3-col.l3 {
        width: 24.99999%
    }

    .w3-col.l4 {
        width: 33.33333%
    }

    .w3-col.l5 {
        width: 41.66666%
    }

    .w3-col.l6 {
        width: 49.99999%
    }

    .w3-col.l7 {
        width: 58.33333%
    }

    .w3-col.l8 {
        width: 66.66666%
    }

    .w3-col.l9 {
        width: 74.99999%
    }

    .w3-col.l10 {
        width: 83.33333%
    }

    .w3-col.l11 {
        width: 91.66666%
    }

    .w3-col.l12 {
        width: 99.99999%
    }
}

.w3-rest {
    overflow: hidden
}

.w3-stretch {
    margin-left: -16px;
    margin-right: -16px
}

.w3-content,
.w3-auto {
    margin-left: auto;
    margin-right: auto
}

.w3-content {
    max-width: 980px
}

.w3-auto {
    max-width: 1140px
}

.w3-cell-row {
    display: table;
    width: 100%
}

.w3-cell {
    display: table-cell
}

.w3-cell-top {
    vertical-align: top
}

.w3-cell-middle {
    vertical-align: middle
}

.w3-cell-bottom {
    vertical-align: bottom
}

.w3-hide {
    display: none !important
}

.w3-show-block,
.w3-show {
    display: block !important
}

.w3-show-inline-block {
    display: inline-block !important
}

@media (max-width:1205px) {
    .w3-auto {
        max-width: 95%
    }
}

@media (max-width:600px) {
    .w3-modal-content {
        margin: 0 10px;
        width: auto !important
    }

    .w3-modal {
        padding-top: 30px
    }

    .w3-dropdown-hover.w3-mobile .w3-dropdown-content,
    .w3-dropdown-click.w3-mobile .w3-dropdown-content {
        position: relative
    }

    .w3-hide-small {
        display: none !important
    }

    .w3-mobile {
        display: block;
        width: 100% !important
    }

    .w3-bar-item.w3-mobile,
    .w3-dropdown-hover.w3-mobile,
    .w3-dropdown-click.w3-mobile {
        text-align: center
    }

    .w3-dropdown-hover.w3-mobile,
    .w3-dropdown-hover.w3-mobile .w3-btn,
    .w3-dropdown-hover.w3-mobile .w3-button,
    .w3-dropdown-click.w3-mobile,
    .w3-dropdown-click.w3-mobile .w3-btn,
    .w3-dropdown-click.w3-mobile .w3-button {
        width: 100%
    }
}

@media (max-width:768px) {
    .w3-modal-content {
        width: 500px
    }

    .w3-modal {
        padding-top: 50px
    }
}

@media (min-width:993px) {
    .w3-modal-content {
        width: 900px
    }

    .w3-hide-large {
        display: none !important
    }

    .w3-sidebar.w3-collapse {
        display: block !important
    }
}

@media (max-width:992px) and (min-width:601px) {
    .w3-hide-medium {
        display: none !important
    }
}

@media (max-width:992px) {
    .w3-sidebar.w3-collapse {
        display: none
    }

    .w3-main {
        margin-left: 0 !important;
        margin-right: 0 !important
    }

    .w3-auto {
        max-width: 100%
    }
}

.w3-top,
.w3-bottom {
    position: fixed;
    width: 100%;
    z-index: 1
}

.w3-top {
    top: 0
}

.w3-bottom {
    bottom: 0
}

.w3-overlay {
    position: fixed;
    display: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2
}

.w3-display-topleft {
    position: absolute;
    left: 0;
    top: 0
}

.w3-display-topright {
    position: absolute;
    right: 0;
    top: 0
}

.w3-display-bottomleft {
    position: absolute;
    left: 0;
    bottom: 0
}

.w3-display-bottomright {
    position: absolute;
    right: 0;
    bottom: 0
}

.w3-display-middle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%)
}

.w3-display-left {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(0%, -50%);
    -ms-transform: translate(-0%, -50%)
}

.w3-display-right {
    position: absolute;
    top: 50%;
    right: 0%;
    transform: translate(0%, -50%);
    -ms-transform: translate(0%, -50%)
}

.w3-display-topmiddle {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, 0%);
    -ms-transform: translate(-50%, 0%)
}

.w3-display-bottommiddle {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 0%);
    -ms-transform: translate(-50%, 0%)
}

.w3-display-container:hover .w3-display-hover {
    display: block
}

.w3-display-container:hover span.w3-display-hover {
    display: inline-block
}

.w3-display-hover {
    display: none
}

.w3-display-position {
    position: absolute
}

.w3-circle {
    border-radius: 50%
}

.w3-round-small {
    border-radius: 2px
}

.w3-round,
.w3-round-medium {
    border-radius: 4px
}

.w3-round-large {
    border-radius: 8px
}

.w3-round-xlarge {
    border-radius: 16px
}

.w3-round-xxlarge {
    border-radius: 32px
}

.w3-row-padding,
.w3-row-padding>.w3-half,
.w3-row-padding>.w3-third,
.w3-row-padding>.w3-twothird,
.w3-row-padding>.w3-threequarter,
.w3-row-padding>.w3-quarter,
.w3-row-padding>.w3-col {
    padding: 0 8px
}

.w3-container,
.w3-panel {
    padding: 0.01em 16px
}

.w3-panel {
    margin-top: 16px;
    margin-bottom: 16px
}

.w3-grid {
    display: grid
}

.w3-grid-padding {
    display: grid;
    gap: 16px
}

.w3-flex {
    display: flex
}

.w3-text-center {
    text-align: center
}

.w3-text-bold,
.w3-bold {
    font-weight: bold
}

.w3-text-italic,
.w3-italic {
    font-style: italic
}

.w3-code,
.w3-codespan {
    font-family: Consolas, "courier new";
    font-size: 16px
}

.w3-code {
    width: auto;
    background-color: #fff;
    padding: 8px 12px;
    border-left: 4px solid #4CAF50;
    word-wrap: break-word
}

.w3-codespan {
    color: crimson;
    background-color: #f1f1f1;
    padding-left: 4px;
    padding-right: 4px;
    font-size: 110%
}

.w3-card,
.w3-card-2 {
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)
}

.w3-card-4,
.w3-hover-shadow:hover {
    box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.2), 0 4px 20px 0 rgba(0, 0, 0, 0.19)
}

.w3-spin {
    animation: w3-spin 2s infinite linear
}

@keyframes w3-spin {
    0% {
        transform: rotate(0deg)
    }

    100% {
        transform: rotate(359deg)
    }
}

.w3-animate-fading {
    animation: fading 10s infinite
}

@keyframes fading {
    0% {
        opacity: 0
    }

    50% {
        opacity: 1
    }

    100% {
        opacity: 0
    }
}

.w3-animate-opacity {
    animation: opac 0.8s
}

@keyframes opac {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.w3-animate-top {
    position: relative;
    animation: animatetop 0.4s
}

@keyframes animatetop {
    from {
        top: -300px;
        opacity: 0
    }

    to {
        top: 0;
        opacity: 1
    }
}

.w3-animate-left {
    position: relative;
    animation: animateleft 0.4s
}

@keyframes animateleft {
    from {
        left: -300px;
        opacity: 0
    }

    to {
        left: 0;
        opacity: 1
    }
}

.w3-animate-right {
    position: relative;
    animation: animateright 0.4s
}

@keyframes animateright {
    from {
        right: -300px;
        opacity: 0
    }

    to {
        right: 0;
        opacity: 1
    }
}

.w3-animate-bottom {
    position: relative;
    animation: animatebottom 0.4s
}

@keyframes animatebottom {
    from {
        bottom: -300px;
        opacity: 0
    }

    to {
        bottom: 0;
        opacity: 1
    }
}

.w3-animate-zoom {
    animation: animatezoom 0.6s
}

@keyframes animatezoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

.w3-animate-input {
    transition: width 0.4s ease-in-out
}

.w3-animate-input:focus {
    width: 100% !important
}

.w3-opacity,
.w3-hover-opacity:hover {
    opacity: 0.60
}

.w3-opacity-off,
.w3-hover-opacity-off:hover {
    opacity: 1
}

.w3-opacity-max {
    opacity: 0.25
}

.w3-opacity-min {
    opacity: 0.75
}

.w3-greyscale-max,
.w3-grayscale-max,
.w3-hover-greyscale:hover,
.w3-hover-grayscale:hover {
    filter: grayscale(100%)
}

.w3-greyscale,
.w3-grayscale {
    filter: grayscale(75%)
}

.w3-greyscale-min,
.w3-grayscale-min {
    filter: grayscale(50%)
}

.w3-sepia {
    filter: sepia(75%)
}

.w3-sepia-max,
.w3-hover-sepia:hover {
    filter: sepia(100%)
}

.w3-sepia-min {
    filter: sepia(50%)
}

.w3-tiny {
    font-size: 10px !important
}

.w3-small {
    font-size: 12px !important
}

.w3-medium {
    font-size: 15px !important
}

.w3-large {
    font-size: 18px !important
}

.w3-xlarge {
    font-size: 24px !important
}

.w3-xxlarge {
    font-size: 36px !important
}

.w3-xxxlarge {
    font-size: 48px !important
}

.w3-jumbo {
    font-size: 64px !important
}

.w3-left-align {
    text-align: left !important
}

.w3-right-align {
    text-align: right !important
}

.w3-justify {
    text-align: justify !important
}

.w3-center {
    text-align: center !important
}

.w3-border-0 {
    border: 0 !important
}

.w3-border {
    border: 1px solid #ccc !important
}

.w3-border-top {
    border-top: 1px solid #ccc !important
}

.w3-border-bottom {
    border-bottom: 1px solid #ccc !important
}

.w3-border-left {
    border-left: 1px solid #ccc !important
}

.w3-border-right {
    border-right: 1px solid #ccc !important
}

.w3-topbar {
    border-top: 6px solid #ccc !important
}

.w3-bottombar {
    border-bottom: 6px solid #ccc !important
}

.w3-leftbar {
    border-left: 6px solid #ccc !important
}

.w3-rightbar {
    border-right: 6px solid #ccc !important
}

.w3-section,
.w3-code {
    margin-top: 16px !important;
    margin-bottom: 16px !important
}

.w3-margin {
    margin: 16px !important
}

.w3-margin-top {
    margin-top: 16px !important
}

.w3-margin-bottom {
    margin-bottom: 16px !important
}

.w3-margin-left {
    margin-left: 16px !important
}

.w3-margin-right {
    margin-right: 16px !important
}

.w3-padding-small {
    padding: 4px 8px !important
}

.w3-padding {
    padding: 8px 16px !important
}

.w3-padding-large {
    padding: 12px 24px !important
}

.w3-padding-16 {
    padding-top: 16px !important;
    padding-bottom: 16px !important
}

.w3-padding-24 {
    padding-top: 24px !important;
    padding-bottom: 24px !important
}

.w3-padding-32 {
    padding-top: 32px !important;
    padding-bottom: 32px !important
}

.w3-padding-48 {
    padding-top: 48px !important;
    padding-bottom: 48px !important
}

.w3-padding-64 {
    padding-top: 64px !important;
    padding-bottom: 64px !important
}

.w3-padding-top-64 {
    padding-top: 64px !important
}

.w3-padding-top-48 {
    padding-top: 48px !important
}

.w3-padding-top-32 {
    padding-top: 32px !important
}

.w3-padding-top-24 {
    padding-top: 24px !important
}

.w3-left {
    float: left !important
}

.w3-right {
    float: right !important
}

.w3-button:hover {
    color: #000 !important;
    background-color: #ccc !important
}

.w3-transparent,
.w3-hover-none:hover {
    background-color: transparent !important
}

.w3-hover-none:hover {
    box-shadow: none !important
}

.w3-rtl {
    direction: rtl
}

.w3-ltr {
    direction: ltr
}

/* Colors */
.w3-amber,
.w3-hover-amber:hover {
    color: #000 !important;
    background-color: #ffc107 !important
}

.w3-aqua,
.w3-hover-aqua:hover {
    color: #000 !important;
    background-color: #00ffff !important
}

.w3-blue,
.w3-hover-blue:hover {
    color: #fff !important;
    background-color: #2196F3 !important
}

.w3-light-blue,
.w3-hover-light-blue:hover {
    color: #000 !important;
    background-color: #87CEEB !important
}

.w3-brown,
.w3-hover-brown:hover {
    color: #fff !important;
    background-color: #795548 !important
}

.w3-cyan,
.w3-hover-cyan:hover {
    color: #000 !important;
    background-color: #00bcd4 !important
}

.w3-blue-grey,
.w3-hover-blue-grey:hover,
.w3-blue-gray,
.w3-hover-blue-gray:hover {
    color: #fff !important;
    background-color: #607d8b !important
}

.w3-green,
.w3-hover-green:hover {
    color: #fff !important;
    background-color: #4CAF50 !important
}

.w3-light-green,
.w3-hover-light-green:hover {
    color: #000 !important;
    background-color: #8bc34a !important
}

.w3-indigo,
.w3-hover-indigo:hover {
    color: #fff !important;
    background-color: #3f51b5 !important
}

.w3-khaki,
.w3-hover-khaki:hover {
    color: #000 !important;
    background-color: #f0e68c !important
}

.w3-lime,
.w3-hover-lime:hover {
    color: #000 !important;
    background-color: #cddc39 !important
}

.w3-orange,
.w3-hover-orange:hover {
    color: #000 !important;
    background-color: #ff9800 !important
}

.w3-deep-orange,
.w3-hover-deep-orange:hover {
    color: #fff !important;
    background-color: #ff5722 !important
}

.w3-pink,
.w3-hover-pink:hover {
    color: #fff !important;
    background-color: #e91e63 !important
}

.w3-purple,
.w3-hover-purple:hover {
    color: #fff !important;
    background-color: #9c27b0 !important
}

.w3-deep-purple,
.w3-hover-deep-purple:hover {
    color: #fff !important;
    background-color: #673ab7 !important
}

.w3-red,
.w3-hover-red:hover {
    color: #fff !important;
    background-color: #f44336 !important
}

.w3-sand,
.w3-hover-sand:hover {
    color: #000 !important;
    background-color: #fdf5e6 !important
}

.w3-teal,
.w3-hover-teal:hover {
    color: #fff !important;
    background-color: #009688 !important
}

.w3-yellow,
.w3-hover-yellow:hover {
    color: #000 !important;
    background-color: #ffeb3b !important
}

.w3-white,
.w3-hover-white:hover {
    color: #000 !important;
    background-color: #fff !important
}

.w3-black,
.w3-hover-black:hover {
    color: #fff !important;
    background-color: #000 !important
}

.w3-grey,
.w3-hover-grey:hover,
.w3-gray,
.w3-hover-gray:hover {
    color: #000 !important;
    background-color: #9e9e9e !important
}

.w3-light-grey,
.w3-hover-light-grey:hover,
.w3-light-gray,
.w3-hover-light-gray:hover {
    color: #000 !important;
    background-color: #f1f1f1 !important
}

.w3-dark-grey,
.w3-hover-dark-grey:hover,
.w3-dark-gray,
.w3-hover-dark-gray:hover {
    color: #fff !important;
    background-color: #616161 !important
}

.w3-asphalt,
.w3-hover-asphalt:hover {
    color: #fff !important;
    background-color: #343a40 !important
}

.w3-crimson,
.w3-hover-crimson:hover {
    color: #fff !important;
    background-color: #a20025 !important
}

.w3-cobalt,
w3-hover-cobalt:hover {
    color: #fff !important;
    background-color: #0050ef !important
}

.w3-emerald,
.w3-hover-emerald:hover {
    color: #fff !important;
    background-color: #008a00 !important
}

.w3-olive,
.w3-hover-olive:hover {
    color: #fff !important;
    background-color: #6d8764 !important
}

.w3-paper,
.w3-hover-paper:hover {
    color: #000 !important;
    background-color: #f8f9fa !important
}

.w3-sienna,
.w3-hover-sienna:hover {
    color: #fff !important;
    background-color: #a0522d !important
}

.w3-taupe,
.w3-hover-taupe:hover {
    color: #fff !important;
    background-color: #87794e !important
}

.w3-danger {
    color: #fff !important;
    background-color: #dd0000 !important
}

.w3-note {
    color: #000 !important;
    background-color: #fff599 !important
}

.w3-info {
    color: #fff !important;
    background-color: #0a6fc2 !important
}

.w3-warning {
    color: #000 !important;
    background-color: #ffb305 !important
}

.w3-success {
    color: #fff !important;
    background-color: #008a00 !important
}

.w3-pale-red,
.w3-hover-pale-red:hover {
    color: #000 !important;
    background-color: #ffdddd !important
}

.w3-pale-green,
.w3-hover-pale-green:hover {
    color: #000 !important;
    background-color: #ddffdd !important
}

.w3-pale-yellow,
.w3-hover-pale-yellow:hover {
    color: #000 !important;
    background-color: #ffffcc !important
}

.w3-pale-blue,
.w3-hover-pale-blue:hover {
    color: #000 !important;
    background-color: #ddffff !important
}

.w3-text-amber,
.w3-hover-text-amber:hover {
    color: #ffc107 !important
}

.w3-text-aqua,
.w3-hover-text-aqua:hover {
    color: #00ffff !important
}

.w3-text-blue,
.w3-hover-text-blue:hover {
    color: #2196F3 !important
}

.w3-text-light-blue,
.w3-hover-text-light-blue:hover {
    color: #87CEEB !important
}

.w3-text-brown,
.w3-hover-text-brown:hover {
    color: #795548 !important
}

.w3-text-cyan,
.w3-hover-text-cyan:hover {
    color: #00bcd4 !important
}

.w3-text-blue-grey,
.w3-hover-text-blue-grey:hover,
.w3-text-blue-gray,
.w3-hover-text-blue-gray:hover {
    color: #607d8b !important
}

.w3-text-green,
.w3-hover-text-green:hover {
    color: #4CAF50 !important
}

.w3-text-light-green,
.w3-hover-text-light-green:hover {
    color: #8bc34a !important
}

.w3-text-indigo,
.w3-hover-text-indigo:hover {
    color: #3f51b5 !important
}

.w3-text-khaki,
.w3-hover-text-khaki:hover {
    color: #b4aa50 !important
}

.w3-text-lime,
.w3-hover-text-lime:hover {
    color: #cddc39 !important
}

.w3-text-orange,
.w3-hover-text-orange:hover {
    color: #ff9800 !important
}

.w3-text-deep-orange,
.w3-hover-text-deep-orange:hover {
    color: #ff5722 !important
}

.w3-text-pink,
.w3-hover-text-pink:hover {
    color: #e91e63 !important
}

.w3-text-purple,
.w3-hover-text-purple:hover {
    color: #9c27b0 !important
}

.w3-text-deep-purple,
.w3-hover-text-deep-purple:hover {
    color: #673ab7 !important
}

.w3-text-red,
.w3-hover-text-red:hover {
    color: #f44336 !important
}

.w3-text-sand,
.w3-hover-text-sand:hover {
    color: #fdf5e6 !important
}

.w3-text-teal,
.w3-hover-text-teal:hover {
    color: #009688 !important
}

.w3-text-yellow,
.w3-hover-text-yellow:hover {
    color: #d2be0e !important
}

.w3-text-white,
.w3-hover-text-white:hover {
    color: #fff !important
}

.w3-text-black,
.w3-hover-text-black:hover {
    color: #000 !important
}

.w3-text-grey,
.w3-hover-text-grey:hover,
.w3-text-gray,
.w3-hover-text-gray:hover {
    color: #757575 !important
}

.w3-text-light-grey,
.w3-hover-text-light-grey:hover,
.w3-text-light-gray,
.w3-hover-text-light-gray:hover {
    color: #f1f1f1 !important
}

.w3-text-dark-grey,
.w3-hover-text-dark-grey:hover,
.w3-text-dark-gray,
.w3-hover-text-dark-gray:hover {
    color: #3a3a3a !important
}

.w3-border-amber,
.w3-hover-border-amber:hover {
    border-color: #ffc107 !important
}

.w3-border-aqua,
.w3-hover-border-aqua:hover {
    border-color: #00ffff !important
}

.w3-border-blue,
.w3-hover-border-blue:hover {
    border-color: #2196F3 !important
}

.w3-border-light-blue,
.w3-hover-border-light-blue:hover {
    border-color: #87CEEB !important
}

.w3-border-brown,
.w3-hover-border-brown:hover {
    border-color: #795548 !important
}

.w3-border-cyan,
.w3-hover-border-cyan:hover {
    border-color: #00bcd4 !important
}

.w3-border-blue-grey,
.w3-hover-border-blue-grey:hover,
.w3-border-blue-gray,
.w3-hover-border-blue-gray:hover {
    border-color: #607d8b !important
}

.w3-border-green,
.w3-hover-border-green:hover {
    border-color: #4CAF50 !important
}

.w3-border-light-green,
.w3-hover-border-light-green:hover {
    border-color: #8bc34a !important
}

.w3-border-indigo,
.w3-hover-border-indigo:hover {
    border-color: #3f51b5 !important
}

.w3-border-khaki,
.w3-hover-border-khaki:hover {
    border-color: #f0e68c !important
}

.w3-border-lime,
.w3-hover-border-lime:hover {
    border-color: #cddc39 !important
}

.w3-border-orange,
.w3-hover-border-orange:hover {
    border-color: #ff9800 !important
}

.w3-border-deep-orange,
.w3-hover-border-deep-orange:hover {
    border-color: #ff5722 !important
}

.w3-border-pink,
.w3-hover-border-pink:hover {
    border-color: #e91e63 !important
}

.w3-border-purple,
.w3-hover-border-purple:hover {
    border-color: #9c27b0 !important
}

.w3-border-deep-purple,
.w3-hover-border-deep-purple:hover {
    border-color: #673ab7 !important
}

.w3-border-red,
.w3-hover-border-red:hover {
    border-color: #f44336 !important
}

.w3-border-sand,
.w3-hover-border-sand:hover {
    border-color: #fdf5e6 !important
}

.w3-border-teal,
.w3-hover-border-teal:hover {
    border-color: #009688 !important
}

.w3-border-yellow,
.w3-hover-border-yellow:hover {
    border-color: #ffeb3b !important
}

.w3-border-white,
.w3-hover-border-white:hover {
    border-color: #fff !important
}

.w3-border-black,
.w3-hover-border-black:hover {
    border-color: #000 !important
}

.w3-border-grey,
.w3-hover-border-grey:hover,
.w3-border-gray,
.w3-hover-border-gray:hover {
    border-color: #9e9e9e !important
}

.w3-border-light-grey,
.w3-hover-border-light-grey:hover,
.w3-border-light-gray,
.w3-hover-border-light-gray:hover {
    border-color: #f1f1f1 !important
}

.w3-border-dark-grey,
.w3-hover-border-dark-grey:hover,
.w3-border-dark-gray,
.w3-hover-border-dark-gray:hover {
    border-color: #616161 !important
}

.w3-border-pale-red,
.w3-hover-border-pale-red:hover {
    border-color: #ffe7e7 !important
}

.w3-border-pale-green,
.w3-hover-border-pale-green:hover {
    border-color: #e7ffe7 !important
}

.w3-border-pale-yellow,
.w3-hover-border-pale-yellow:hover {
    border-color: #ffffcc !important
}

.w3-border-pale-blue,
.w3-hover-border-pale-blue:hover {
    border-color: #e7ffff !important
}.container,
.container-fluid,
.container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
  width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 576px) {

  .container-sm,
  .container {
    max-width: 540px;
  }
}

@media (min-width: 768px) {

  .container-md,
  .container-sm,
  .container {
    max-width: 720px;
  }
}

@media (min-width: 992px) {

  .container-lg,
  .container-md,
  .container-sm,
  .container {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {

  .container-xl,
  .container-lg,
  .container-md,
  .container-sm,
  .container {
    max-width: 1140px;
  }
}

@media (min-width: 1400px) {

  .container-xxl,
  .container-xl,
  .container-lg,
  .container-md,
  .container-sm,
  .container {
    max-width: 1320px;
  }
}

:root {
  --bs-breakpoint-xs: 0;
  --bs-breakpoint-sm: 576px;
  --bs-breakpoint-md: 768px;
  --bs-breakpoint-lg: 992px;
  --bs-breakpoint-xl: 1200px;
  --bs-breakpoint-xxl: 1400px;
}

.row {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--bs-gutter-y));
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}

.row>* {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}

.col {
  flex: 1 0 0;
}

.row-cols-auto>* {
  flex: 0 0 auto;
  width: auto;
}

.row-cols-1>* {
  flex: 0 0 auto;
  width: 100%;
}

.row-cols-2>* {
  flex: 0 0 auto;
  width: 50%;
}

.row-cols-3>* {
  flex: 0 0 auto;
  width: 33.33333333%;
}

.row-cols-4>* {
  flex: 0 0 auto;
  width: 25%;
}

.row-cols-5>* {
  flex: 0 0 auto;
  width: 20%;
}

.row-cols-6>* {
  flex: 0 0 auto;
  width: 16.66666667%;
}

.col-auto {
  flex: 0 0 auto;
  width: auto;
}

.col-1 {
  flex: 0 0 auto;
  width: 8.33333333%;
}

.col-2 {
  flex: 0 0 auto;
  width: 16.66666667%;
}

.col-3 {
  flex: 0 0 auto;
  width: 25%;
}

.col-4 {
  flex: 0 0 auto;
  width: 33.33333333%;
}

.col-5 {
  flex: 0 0 auto;
  width: 41.66666667%;
}

.col-6 {
  flex: 0 0 auto;
  width: 50%;
}

.col-7 {
  flex: 0 0 auto;
  width: 58.33333333%;
}

.col-8 {
  flex: 0 0 auto;
  width: 66.66666667%;
}

.col-9 {
  flex: 0 0 auto;
  width: 75%;
}

.col-10 {
  flex: 0 0 auto;
  width: 83.33333333%;
}

.col-11 {
  flex: 0 0 auto;
  width: 91.66666667%;
}

.col-12 {
  flex: 0 0 auto;
  width: 100%;
}

.offset-1 {
  margin-left: 8.33333333%;
}

.offset-2 {
  margin-left: 16.66666667%;
}

.offset-3 {
  margin-left: 25%;
}

.offset-4 {
  margin-left: 33.33333333%;
}

.offset-5 {
  margin-left: 41.66666667%;
}

.offset-6 {
  margin-left: 50%;
}

.offset-7 {
  margin-left: 58.33333333%;
}

.offset-8 {
  margin-left: 66.66666667%;
}

.offset-9 {
  margin-left: 75%;
}

.offset-10 {
  margin-left: 83.33333333%;
}

.offset-11 {
  margin-left: 91.66666667%;
}

.g-0,
.gx-0 {
  --bs-gutter-x: 0;
}

.g-0,
.gy-0 {
  --bs-gutter-y: 0;
}

.g-1,
.gx-1 {
  --bs-gutter-x: 0.25rem;
}

.g-1,
.gy-1 {
  --bs-gutter-y: 0.25rem;
}

.g-2,
.gx-2 {
  --bs-gutter-x: 0.5rem;
}

.g-2,
.gy-2 {
  --bs-gutter-y: 0.5rem;
}

.g-3,
.gx-3 {
  --bs-gutter-x: 1rem;
}

.g-3,
.gy-3 {
  --bs-gutter-y: 1rem;
}

.g-4,
.gx-4 {
  --bs-gutter-x: 1.5rem;
}

.g-4,
.gy-4 {
  --bs-gutter-y: 1.5rem;
}

.g-5,
.gx-5 {
  --bs-gutter-x: 3rem;
}

.g-5,
.gy-5 {
  --bs-gutter-y: 3rem;
}

@media (min-width: 576px) {
  .col-sm {
    flex: 1 0 0;
  }

  .row-cols-sm-auto>* {
    flex: 0 0 auto;
    width: auto;
  }

  .row-cols-sm-1>* {
    flex: 0 0 auto;
    width: 100%;
  }

  .row-cols-sm-2>* {
    flex: 0 0 auto;
    width: 50%;
  }

  .row-cols-sm-3>* {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .row-cols-sm-4>* {
    flex: 0 0 auto;
    width: 25%;
  }

  .row-cols-sm-5>* {
    flex: 0 0 auto;
    width: 20%;
  }

  .row-cols-sm-6>* {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .col-sm-auto {
    flex: 0 0 auto;
    width: auto;
  }

  .col-sm-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
  }

  .col-sm-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .col-sm-3 {
    flex: 0 0 auto;
    width: 25%;
  }

  .col-sm-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .col-sm-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
  }

  .col-sm-6 {
    flex: 0 0 auto;
    width: 50%;
  }

  .col-sm-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
  }

  .col-sm-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }

  .col-sm-9 {
    flex: 0 0 auto;
    width: 75%;
  }

  .col-sm-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }

  .col-sm-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
  }

  .col-sm-12 {
    flex: 0 0 auto;
    width: 100%;
  }

  .offset-sm-0 {
    margin-left: 0;
  }

  .offset-sm-1 {
    margin-left: 8.33333333%;
  }

  .offset-sm-2 {
    margin-left: 16.66666667%;
  }

  .offset-sm-3 {
    margin-left: 25%;
  }

  .offset-sm-4 {
    margin-left: 33.33333333%;
  }

  .offset-sm-5 {
    margin-left: 41.66666667%;
  }

  .offset-sm-6 {
    margin-left: 50%;
  }

  .offset-sm-7 {
    margin-left: 58.33333333%;
  }

  .offset-sm-8 {
    margin-left: 66.66666667%;
  }

  .offset-sm-9 {
    margin-left: 75%;
  }

  .offset-sm-10 {
    margin-left: 83.33333333%;
  }

  .offset-sm-11 {
    margin-left: 91.66666667%;
  }

  .g-sm-0,
  .gx-sm-0 {
    --bs-gutter-x: 0;
  }

  .g-sm-0,
  .gy-sm-0 {
    --bs-gutter-y: 0;
  }

  .g-sm-1,
  .gx-sm-1 {
    --bs-gutter-x: 0.25rem;
  }

  .g-sm-1,
  .gy-sm-1 {
    --bs-gutter-y: 0.25rem;
  }

  .g-sm-2,
  .gx-sm-2 {
    --bs-gutter-x: 0.5rem;
  }

  .g-sm-2,
  .gy-sm-2 {
    --bs-gutter-y: 0.5rem;
  }

  .g-sm-3,
  .gx-sm-3 {
    --bs-gutter-x: 1rem;
  }

  .g-sm-3,
  .gy-sm-3 {
    --bs-gutter-y: 1rem;
  }

  .g-sm-4,
  .gx-sm-4 {
    --bs-gutter-x: 1.5rem;
  }

  .g-sm-4,
  .gy-sm-4 {
    --bs-gutter-y: 1.5rem;
  }

  .g-sm-5,
  .gx-sm-5 {
    --bs-gutter-x: 3rem;
  }

  .g-sm-5,
  .gy-sm-5 {
    --bs-gutter-y: 3rem;
  }
}

@media (min-width: 768px) {
  .col-md {
    flex: 1 0 0;
  }

  .row-cols-md-auto>* {
    flex: 0 0 auto;
    width: auto;
  }

  .row-cols-md-1>* {
    flex: 0 0 auto;
    width: 100%;
  }

  .row-cols-md-2>* {
    flex: 0 0 auto;
    width: 50%;
  }

  .row-cols-md-3>* {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .row-cols-md-4>* {
    flex: 0 0 auto;
    width: 25%;
  }

  .row-cols-md-5>* {
    flex: 0 0 auto;
    width: 20%;
  }

  .row-cols-md-6>* {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .col-md-auto {
    flex: 0 0 auto;
    width: auto;
  }

  .col-md-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
  }

  .col-md-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .col-md-3 {
    flex: 0 0 auto;
    width: 25%;
  }

  .col-md-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .col-md-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
  }

  .col-md-6 {
    flex: 0 0 auto;
    width: 50%;
  }

  .col-md-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
  }

  .col-md-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }

  .col-md-9 {
    flex: 0 0 auto;
    width: 75%;
  }

  .col-md-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }

  .col-md-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
  }

  .col-md-12 {
    flex: 0 0 auto;
    width: 100%;
  }

  .offset-md-0 {
    margin-left: 0;
  }

  .offset-md-1 {
    margin-left: 8.33333333%;
  }

  .offset-md-2 {
    margin-left: 16.66666667%;
  }

  .offset-md-3 {
    margin-left: 25%;
  }

  .offset-md-4 {
    margin-left: 33.33333333%;
  }

  .offset-md-5 {
    margin-left: 41.66666667%;
  }

  .offset-md-6 {
    margin-left: 50%;
  }

  .offset-md-7 {
    margin-left: 58.33333333%;
  }

  .offset-md-8 {
    margin-left: 66.66666667%;
  }

  .offset-md-9 {
    margin-left: 75%;
  }

  .offset-md-10 {
    margin-left: 83.33333333%;
  }

  .offset-md-11 {
    margin-left: 91.66666667%;
  }

  .g-md-0,
  .gx-md-0 {
    --bs-gutter-x: 0;
  }

  .g-md-0,
  .gy-md-0 {
    --bs-gutter-y: 0;
  }

  .g-md-1,
  .gx-md-1 {
    --bs-gutter-x: 0.25rem;
  }

  .g-md-1,
  .gy-md-1 {
    --bs-gutter-y: 0.25rem;
  }

  .g-md-2,
  .gx-md-2 {
    --bs-gutter-x: 0.5rem;
  }

  .g-md-2,
  .gy-md-2 {
    --bs-gutter-y: 0.5rem;
  }

  .g-md-3,
  .gx-md-3 {
    --bs-gutter-x: 1rem;
  }

  .g-md-3,
  .gy-md-3 {
    --bs-gutter-y: 1rem;
  }

  .g-md-4,
  .gx-md-4 {
    --bs-gutter-x: 1.5rem;
  }

  .g-md-4,
  .gy-md-4 {
    --bs-gutter-y: 1.5rem;
  }

  .g-md-5,
  .gx-md-5 {
    --bs-gutter-x: 3rem;
  }

  .g-md-5,
  .gy-md-5 {
    --bs-gutter-y: 3rem;
  }
}

@media (min-width: 992px) {
  .col-lg {
    flex: 1 0 0;
  }

  .row-cols-lg-auto>* {
    flex: 0 0 auto;
    width: auto;
  }

  .row-cols-lg-1>* {
    flex: 0 0 auto;
    width: 100%;
  }

  .row-cols-lg-2>* {
    flex: 0 0 auto;
    width: 50%;
  }

  .row-cols-lg-3>* {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .row-cols-lg-4>* {
    flex: 0 0 auto;
    width: 25%;
  }

  .row-cols-lg-5>* {
    flex: 0 0 auto;
    width: 20%;
  }

  .row-cols-lg-6>* {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .col-lg-auto {
    flex: 0 0 auto;
    width: auto;
  }

  .col-lg-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
  }

  .col-lg-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .col-lg-3 {
    flex: 0 0 auto;
    width: 25%;
  }

  .col-lg-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .col-lg-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
  }

  .col-lg-6 {
    flex: 0 0 auto;
    width: 50%;
  }

  .col-lg-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
  }

  .col-lg-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }

  .col-lg-9 {
    flex: 0 0 auto;
    width: 75%;
  }

  .col-lg-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }

  .col-lg-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
  }

  .col-lg-12 {
    flex: 0 0 auto;
    width: 100%;
  }

  .offset-lg-0 {
    margin-left: 0;
  }

  .offset-lg-1 {
    margin-left: 8.33333333%;
  }

  .offset-lg-2 {
    margin-left: 16.66666667%;
  }

  .offset-lg-3 {
    margin-left: 25%;
  }

  .offset-lg-4 {
    margin-left: 33.33333333%;
  }

  .offset-lg-5 {
    margin-left: 41.66666667%;
  }

  .offset-lg-6 {
    margin-left: 50%;
  }

  .offset-lg-7 {
    margin-left: 58.33333333%;
  }

  .offset-lg-8 {
    margin-left: 66.66666667%;
  }

  .offset-lg-9 {
    margin-left: 75%;
  }

  .offset-lg-10 {
    margin-left: 83.33333333%;
  }

  .offset-lg-11 {
    margin-left: 91.66666667%;
  }

  .g-lg-0,
  .gx-lg-0 {
    --bs-gutter-x: 0;
  }

  .g-lg-0,
  .gy-lg-0 {
    --bs-gutter-y: 0;
  }

  .g-lg-1,
  .gx-lg-1 {
    --bs-gutter-x: 0.25rem;
  }

  .g-lg-1,
  .gy-lg-1 {
    --bs-gutter-y: 0.25rem;
  }

  .g-lg-2,
  .gx-lg-2 {
    --bs-gutter-x: 0.5rem;
  }

  .g-lg-2,
  .gy-lg-2 {
    --bs-gutter-y: 0.5rem;
  }

  .g-lg-3,
  .gx-lg-3 {
    --bs-gutter-x: 1rem;
  }

  .g-lg-3,
  .gy-lg-3 {
    --bs-gutter-y: 1rem;
  }

  .g-lg-4,
  .gx-lg-4 {
    --bs-gutter-x: 1.5rem;
  }

  .g-lg-4,
  .gy-lg-4 {
    --bs-gutter-y: 1.5rem;
  }

  .g-lg-5,
  .gx-lg-5 {
    --bs-gutter-x: 3rem;
  }

  .g-lg-5,
  .gy-lg-5 {
    --bs-gutter-y: 3rem;
  }
}

@media (min-width: 1200px) {
  .col-xl {
    flex: 1 0 0;
  }

  .row-cols-xl-auto>* {
    flex: 0 0 auto;
    width: auto;
  }

  .row-cols-xl-1>* {
    flex: 0 0 auto;
    width: 100%;
  }

  .row-cols-xl-2>* {
    flex: 0 0 auto;
    width: 50%;
  }

  .row-cols-xl-3>* {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .row-cols-xl-4>* {
    flex: 0 0 auto;
    width: 25%;
  }

  .row-cols-xl-5>* {
    flex: 0 0 auto;
    width: 20%;
  }

  .row-cols-xl-6>* {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .col-xl-auto {
    flex: 0 0 auto;
    width: auto;
  }

  .col-xl-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
  }

  .col-xl-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .col-xl-3 {
    flex: 0 0 auto;
    width: 25%;
  }

  .col-xl-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .col-xl-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
  }

  .col-xl-6 {
    flex: 0 0 auto;
    width: 50%;
  }

  .col-xl-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
  }

  .col-xl-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }

  .col-xl-9 {
    flex: 0 0 auto;
    width: 75%;
  }

  .col-xl-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }

  .col-xl-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
  }

  .col-xl-12 {
    flex: 0 0 auto;
    width: 100%;
  }

  .offset-xl-0 {
    margin-left: 0;
  }

  .offset-xl-1 {
    margin-left: 8.33333333%;
  }

  .offset-xl-2 {
    margin-left: 16.66666667%;
  }

  .offset-xl-3 {
    margin-left: 25%;
  }

  .offset-xl-4 {
    margin-left: 33.33333333%;
  }

  .offset-xl-5 {
    margin-left: 41.66666667%;
  }

  .offset-xl-6 {
    margin-left: 50%;
  }

  .offset-xl-7 {
    margin-left: 58.33333333%;
  }

  .offset-xl-8 {
    margin-left: 66.66666667%;
  }

  .offset-xl-9 {
    margin-left: 75%;
  }

  .offset-xl-10 {
    margin-left: 83.33333333%;
  }

  .offset-xl-11 {
    margin-left: 91.66666667%;
  }

  .g-xl-0,
  .gx-xl-0 {
    --bs-gutter-x: 0;
  }

  .g-xl-0,
  .gy-xl-0 {
    --bs-gutter-y: 0;
  }

  .g-xl-1,
  .gx-xl-1 {
    --bs-gutter-x: 0.25rem;
  }

  .g-xl-1,
  .gy-xl-1 {
    --bs-gutter-y: 0.25rem;
  }

  .g-xl-2,
  .gx-xl-2 {
    --bs-gutter-x: 0.5rem;
  }

  .g-xl-2,
  .gy-xl-2 {
    --bs-gutter-y: 0.5rem;
  }

  .g-xl-3,
  .gx-xl-3 {
    --bs-gutter-x: 1rem;
  }

  .g-xl-3,
  .gy-xl-3 {
    --bs-gutter-y: 1rem;
  }

  .g-xl-4,
  .gx-xl-4 {
    --bs-gutter-x: 1.5rem;
  }

  .g-xl-4,
  .gy-xl-4 {
    --bs-gutter-y: 1.5rem;
  }

  .g-xl-5,
  .gx-xl-5 {
    --bs-gutter-x: 3rem;
  }

  .g-xl-5,
  .gy-xl-5 {
    --bs-gutter-y: 3rem;
  }
}

@media (min-width: 1400px) {
  .col-xxl {
    flex: 1 0 0;
  }

  .row-cols-xxl-auto>* {
    flex: 0 0 auto;
    width: auto;
  }

  .row-cols-xxl-1>* {
    flex: 0 0 auto;
    width: 100%;
  }

  .row-cols-xxl-2>* {
    flex: 0 0 auto;
    width: 50%;
  }

  .row-cols-xxl-3>* {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .row-cols-xxl-4>* {
    flex: 0 0 auto;
    width: 25%;
  }

  .row-cols-xxl-5>* {
    flex: 0 0 auto;
    width: 20%;
  }

  .row-cols-xxl-6>* {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .col-xxl-auto {
    flex: 0 0 auto;
    width: auto;
  }

  .col-xxl-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
  }

  .col-xxl-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }

  .col-xxl-3 {
    flex: 0 0 auto;
    width: 25%;
  }

  .col-xxl-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }

  .col-xxl-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
  }

  .col-xxl-6 {
    flex: 0 0 auto;
    width: 50%;
  }

  .col-xxl-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
  }

  .col-xxl-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }

  .col-xxl-9 {
    flex: 0 0 auto;
    width: 75%;
  }

  .col-xxl-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }

  .col-xxl-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
  }

  .col-xxl-12 {
    flex: 0 0 auto;
    width: 100%;
  }

  .offset-xxl-0 {
    margin-left: 0;
  }

  .offset-xxl-1 {
    margin-left: 8.33333333%;
  }

  .offset-xxl-2 {
    margin-left: 16.66666667%;
  }

  .offset-xxl-3 {
    margin-left: 25%;
  }

  .offset-xxl-4 {
    margin-left: 33.33333333%;
  }

  .offset-xxl-5 {
    margin-left: 41.66666667%;
  }

  .offset-xxl-6 {
    margin-left: 50%;
  }

  .offset-xxl-7 {
    margin-left: 58.33333333%;
  }

  .offset-xxl-8 {
    margin-left: 66.66666667%;
  }

  .offset-xxl-9 {
    margin-left: 75%;
  }

  .offset-xxl-10 {
    margin-left: 83.33333333%;
  }

  .offset-xxl-11 {
    margin-left: 91.66666667%;
  }

  .g-xxl-0,
  .gx-xxl-0 {
    --bs-gutter-x: 0;
  }

  .g-xxl-0,
  .gy-xxl-0 {
    --bs-gutter-y: 0;
  }

  .g-xxl-1,
  .gx-xxl-1 {
    --bs-gutter-x: 0.25rem;
  }

  .g-xxl-1,
  .gy-xxl-1 {
    --bs-gutter-y: 0.25rem;
  }

  .g-xxl-2,
  .gx-xxl-2 {
    --bs-gutter-x: 0.5rem;
  }

  .g-xxl-2,
  .gy-xxl-2 {
    --bs-gutter-y: 0.5rem;
  }

  .g-xxl-3,
  .gx-xxl-3 {
    --bs-gutter-x: 1rem;
  }

  .g-xxl-3,
  .gy-xxl-3 {
    --bs-gutter-y: 1rem;
  }

  .g-xxl-4,
  .gx-xxl-4 {
    --bs-gutter-x: 1.5rem;
  }

  .g-xxl-4,
  .gy-xxl-4 {
    --bs-gutter-y: 1.5rem;
  }

  .g-xxl-5,
  .gx-xxl-5 {
    --bs-gutter-x: 3rem;
  }

  .g-xxl-5,
  .gy-xxl-5 {
    --bs-gutter-y: 3rem;
  }
}

.form-label {
  margin-bottom: 0.5rem;
}

.col-form-label {
  padding-top: calc(0.375rem + var(--bs-border-width));
  padding-bottom: calc(0.375rem + var(--bs-border-width));
  margin-bottom: 0;
  font-size: inherit;
  line-height: 1.5;
}

.col-form-label-lg {
  padding-top: calc(0.5rem + var(--bs-border-width));
  padding-bottom: calc(0.5rem + var(--bs-border-width));
  font-size: 1.25rem;
}

.col-form-label-sm {
  padding-top: calc(0.25rem + var(--bs-border-width));
  padding-bottom: calc(0.25rem + var(--bs-border-width));
  font-size: 0.875rem;
}

.form-text {
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: var(--bs-secondary-color);
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--bs-body-color);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--bs-body-bg);
  background-clip: padding-box;
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .form-control {
    transition: none;
  }
}

.form-control[type=file] {
  overflow: hidden;
}

.form-control[type=file]:not(:disabled):not([readonly]) {
  cursor: pointer;
}

.form-control:focus {
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-control::-webkit-date-and-time-value {
  min-width: 85px;
  height: 1.5em;
  margin: 0;
}

.form-control::-webkit-datetime-edit {
  display: block;
  padding: 0;
}

.form-control::placeholder {
  color: var(--bs-secondary-color);
  opacity: 1;
}

.form-control:disabled {
  background-color: var(--bs-secondary-bg);
  opacity: 1;
}

.form-control::-webkit-file-upload-button {
  padding: 0.375rem 0.75rem;
  margin: -0.375rem -0.75rem;
  -webkit-margin-end: 0.75rem;
  margin-inline-end: 0.75rem;
  color: var(--bs-body-color);
  background-color: var(--bs-tertiary-bg);
  pointer-events: none;
  border-color: inherit;
  border-style: solid;
  border-width: 0;
  border-inline-end-width: var(--bs-border-width);
  border-radius: 0;
  -webkit-transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control::file-selector-button {
  padding: 0.375rem 0.75rem;
  margin: -0.375rem -0.75rem;
  -webkit-margin-end: 0.75rem;
  margin-inline-end: 0.75rem;
  color: var(--bs-body-color);
  background-color: var(--bs-tertiary-bg);
  pointer-events: none;
  border-color: inherit;
  border-style: solid;
  border-width: 0;
  border-inline-end-width: var(--bs-border-width);
  border-radius: 0;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .form-control::-webkit-file-upload-button {
    -webkit-transition: none;
    transition: none;
  }

  .form-control::file-selector-button {
    transition: none;
  }
}

.form-control:hover:not(:disabled):not([readonly])::-webkit-file-upload-button {
  background-color: var(--bs-secondary-bg);
}

.form-control:hover:not(:disabled):not([readonly])::file-selector-button {
  background-color: var(--bs-secondary-bg);
}

.form-control-plaintext {
  display: block;
  width: 100%;
  padding: 0.375rem 0;
  margin-bottom: 0;
  line-height: 1.5;
  color: var(--bs-body-color);
  background-color: transparent;
  border: solid transparent;
  border-width: var(--bs-border-width) 0;
}

.form-control-plaintext:focus {
  outline: 0;
}

.form-control-plaintext.form-control-sm,
.form-control-plaintext.form-control-lg {
  padding-right: 0;
  padding-left: 0;
}

.form-control-sm {
  min-height: calc(1.5em + 0.5rem + calc(var(--bs-border-width) * 2));
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: var(--bs-border-radius-sm);
}

.form-control-sm::-webkit-file-upload-button {
  padding: 0.25rem 0.5rem;
  margin: -0.25rem -0.5rem;
  -webkit-margin-end: 0.5rem;
  margin-inline-end: 0.5rem;
}

.form-control-sm::file-selector-button {
  padding: 0.25rem 0.5rem;
  margin: -0.25rem -0.5rem;
  -webkit-margin-end: 0.5rem;
  margin-inline-end: 0.5rem;
}

.form-control-lg {
  min-height: calc(1.5em + 1rem + calc(var(--bs-border-width) * 2));
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  border-radius: var(--bs-border-radius-lg);
}

.form-control-lg::-webkit-file-upload-button {
  padding: 0.5rem 1rem;
  margin: -0.5rem -1rem;
  -webkit-margin-end: 1rem;
  margin-inline-end: 1rem;
}

.form-control-lg::file-selector-button {
  padding: 0.5rem 1rem;
  margin: -0.5rem -1rem;
  -webkit-margin-end: 1rem;
  margin-inline-end: 1rem;
}

textarea.form-control {
  min-height: calc(1.5em + 0.75rem + calc(var(--bs-border-width) * 2));
}

textarea.form-control-sm {
  min-height: calc(1.5em + 0.5rem + calc(var(--bs-border-width) * 2));
}

textarea.form-control-lg {
  min-height: calc(1.5em + 1rem + calc(var(--bs-border-width) * 2));
}

.form-control-color {
  width: 3rem;
  height: calc(1.5em + 0.75rem + calc(var(--bs-border-width) * 2));
  padding: 0.375rem;
}

.form-control-color:not(:disabled):not([readonly]) {
  cursor: pointer;
}

.form-control-color::-moz-color-swatch {
  border: 0 !important;
  border-radius: var(--bs-border-radius);
}

.form-control-color::-webkit-color-swatch {
  border: 0 !important;
  border-radius: var(--bs-border-radius);
}

.form-control-color.form-control-sm {
  height: calc(1.5em + 0.5rem + calc(var(--bs-border-width) * 2));
}

.form-control-color.form-control-lg {
  height: calc(1.5em + 1rem + calc(var(--bs-border-width) * 2));
}

.form-select {
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  display: block;
  width: 100%;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--bs-body-color);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--bs-body-bg);
  background-image: var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none);
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .form-select {
    transition: none;
  }
}

.form-select:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-select[multiple],
.form-select[size]:not([size="1"]) {
  padding-right: 0.75rem;
  background-image: none;
}

.form-select:disabled {
  background-color: var(--bs-secondary-bg);
}

.form-select:-moz-focusring {
  color: transparent;
  text-shadow: 0 0 0 var(--bs-body-color);
}

.form-select-sm {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  padding-left: 0.5rem;
  font-size: 0.875rem;
  border-radius: var(--bs-border-radius-sm);
}

.form-select-lg {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 1rem;
  font-size: 1.25rem;
  border-radius: var(--bs-border-radius-lg);
}

[data-bs-theme=dark] .form-select {
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.form-check {
  display: block;
  min-height: 1.5rem;
  padding-left: 1.5em;
  margin-bottom: 0.125rem;
}

.form-check .form-check-input {
  float: left;
  margin-left: -1.5em;
}

.form-check-reverse {
  padding-right: 1.5em;
  padding-left: 0;
  text-align: right;
}

.form-check-reverse .form-check-input {
  float: right;
  margin-right: -1.5em;
  margin-left: 0;
}

.form-check-input {
  --bs-form-check-bg: var(--bs-body-bg);
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  margin-top: 0.25em;
  vertical-align: top;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--bs-form-check-bg);
  background-image: var(--bs-form-check-bg-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: var(--bs-border-width) solid var(--bs-border-color);
  -webkit-print-color-adjust: exact;
  color-adjust: exact;
  print-color-adjust: exact;
}

.form-check-input[type=checkbox] {
  border-radius: 0.25em;
}

.form-check-input[type=radio] {
  border-radius: 50%;
}

.form-check-input:active {
  filter: brightness(90%);
}

.form-check-input:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.form-check-input:checked[type=checkbox] {
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.form-check-input:checked[type=radio] {
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-input[type=checkbox]:indeterminate {
  background-color: #0d6efd;
  border-color: #0d6efd;
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e");
}

.form-check-input:disabled {
  pointer-events: none;
  filter: none;
  opacity: 0.5;
}

.form-check-input[disabled]~.form-check-label,
.form-check-input:disabled~.form-check-label {
  cursor: default;
  opacity: 0.5;
}

.form-switch {
  padding-left: 2.5em;
}

.form-switch .form-check-input {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
  width: 2em;
  margin-left: -2.5em;
  background-image: var(--bs-form-switch-bg);
  background-position: left center;
  border-radius: 2em;
  transition: background-position 0.15s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .form-switch .form-check-input {
    transition: none;
  }
}

.form-switch .form-check-input:focus {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2386b7fe'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:checked {
  background-position: right center;
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-switch.form-check-reverse {
  padding-right: 2.5em;
  padding-left: 0;
}

.form-switch.form-check-reverse .form-check-input {
  margin-right: -2.5em;
  margin-left: 0;
}

.form-check-inline {
  display: inline-block;
  margin-right: 1rem;
}

.card {
  --bs-card-spacer-y: 1rem;
  --bs-card-spacer-x: 1rem;
  --bs-card-title-spacer-y: 0.5rem;
  --bs-card-title-color: ;
  --bs-card-subtitle-color: ;
  --bs-card-border-width: var(--bs-border-width);
  --bs-card-border-color: var(--bs-border-color-translucent);
  --bs-card-border-radius: var(--bs-border-radius);
  --bs-card-box-shadow: ;
  --bs-card-inner-border-radius: calc(var(--bs-border-radius) - (var(--bs-border-width)));
  --bs-card-cap-padding-y: 0.5rem;
  --bs-card-cap-padding-x: 1rem;
  --bs-card-cap-bg: rgba(var(--bs-body-color-rgb), 0.03);
  --bs-card-cap-color: ;
  --bs-card-height: ;
  --bs-card-color: ;
  --bs-card-bg: var(--bs-body-bg);
  --bs-card-img-overlay-padding: 1rem;
  --bs-card-group-margin: 0.75rem;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: var(--bs-card-height);
  color: var(--bs-body-color);
  word-wrap: break-word;
  background-color: var(--bs-card-bg);
  background-clip: border-box;
  border: var(--bs-card-border-width) solid var(--bs-card-border-color);
  border-radius: var(--bs-card-border-radius);
}

.card>hr {
  margin-right: 0;
  margin-left: 0;
}

.card>.list-group {
  border-top: inherit;
  border-bottom: inherit;
}

.card>.list-group:first-child {
  border-top-width: 0;
  border-top-left-radius: var(--bs-card-inner-border-radius);
  border-top-right-radius: var(--bs-card-inner-border-radius);
}

.card>.list-group:last-child {
  border-bottom-width: 0;
  border-bottom-right-radius: var(--bs-card-inner-border-radius);
  border-bottom-left-radius: var(--bs-card-inner-border-radius);
}

.card>.card-header+.list-group,
.card>.list-group+.card-footer {
  border-top: 0;
}

.card-body {
  flex: 1 1 auto;
  padding: var(--bs-card-spacer-y) var(--bs-card-spacer-x);
  color: var(--bs-card-color);
}

.card-title {
  margin-bottom: var(--bs-card-title-spacer-y);
  color: var(--bs-card-title-color);
}

.card-subtitle {
  margin-top: calc(-0.5 * var(--bs-card-title-spacer-y));
  margin-bottom: 0;
  color: var(--bs-card-subtitle-color);
}

.card-text:last-child {
  margin-bottom: 0;
}

.card-link+.card-link {
  margin-left: var(--bs-card-spacer-x);
}

.card-header {
  padding: var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);
  margin-bottom: 0;
  color: var(--bs-card-cap-color);
  background-color: var(--bs-card-cap-bg);
  border-bottom: var(--bs-card-border-width) solid var(--bs-card-border-color);
}

.card-header:first-child {
  border-radius: var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0;
}

.card-footer {
  padding: var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);
  color: var(--bs-card-cap-color);
  background-color: var(--bs-card-cap-bg);
  border-top: var(--bs-card-border-width) solid var(--bs-card-border-color);
}

.card-footer:last-child {
  border-radius: 0 0 var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius);
}

.card-header-tabs {
  margin-right: calc(-0.5 * var(--bs-card-cap-padding-x));
  margin-bottom: calc(-1 * var(--bs-card-cap-padding-y));
  margin-left: calc(-0.5 * var(--bs-card-cap-padding-x));
  border-bottom: 0;
}

.card-header-tabs .nav-link.active {
  background-color: var(--bs-card-bg);
  border-bottom-color: var(--bs-card-bg);
}

.card-header-pills {
  margin-right: calc(-0.5 * var(--bs-card-cap-padding-x));
  margin-left: calc(-0.5 * var(--bs-card-cap-padding-x));
}

.card-img-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  padding: var(--bs-card-img-overlay-padding);
  border-radius: var(--bs-card-inner-border-radius);
}

.card-img,
.card-img-top,
.card-img-bottom {
  width: 100%;
}

.card-img,
.card-img-top {
  border-top-left-radius: var(--bs-card-inner-border-radius);
  border-top-right-radius: var(--bs-card-inner-border-radius);
}

.card-img,
.card-img-bottom {
  border-bottom-right-radius: var(--bs-card-inner-border-radius);
  border-bottom-left-radius: var(--bs-card-inner-border-radius);
}

.card-group>.card {
  margin-bottom: var(--bs-card-group-margin);
}

@media (min-width: 576px) {
  .card-group {
    display: flex;
    flex-flow: row wrap;
  }

  .card-group>.card {
    flex: 1 0 0;
    margin-bottom: 0;
  }

  .card-group>.card+.card {
    margin-left: 0;
    border-left: 0;
  }

  .card-group>.card:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .card-group>.card:not(:last-child)>.card-img-top,
  .card-group>.card:not(:last-child)>.card-header {
    border-top-right-radius: 0;
  }

  .card-group>.card:not(:last-child)>.card-img-bottom,
  .card-group>.card:not(:last-child)>.card-footer {
    border-bottom-right-radius: 0;
  }

  .card-group>.card:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }

  .card-group>.card:not(:first-child)>.card-img-top,
  .card-group>.card:not(:first-child)>.card-header {
    border-top-left-radius: 0;
  }

  .card-group>.card:not(:first-child)>.card-img-bottom,
  .card-group>.card:not(:first-child)>.card-footer {
    border-bottom-left-radius: 0;
  }
}

.accordion {
  --bs-accordion-color: var(--bs-body-color);
  --bs-accordion-bg: var(--bs-body-bg);
  --bs-accordion-transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, border-radius 0.15s ease;
  --bs-accordion-border-color: var(--bs-border-color);
  --bs-accordion-border-width: var(--bs-border-width);
  --bs-accordion-border-radius: var(--bs-border-radius);
  --bs-accordion-inner-border-radius: calc(var(--bs-border-radius) - (var(--bs-border-width)));
  --bs-accordion-btn-padding-x: 1.25rem;
  --bs-accordion-btn-padding-y: 1rem;
  --bs-accordion-btn-color: var(--bs-body-color);
  --bs-accordion-btn-bg: var(--bs-accordion-bg);
  --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23212529' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  --bs-accordion-btn-icon-width: 1.25rem;
  --bs-accordion-btn-icon-transform: rotate(-180deg);
  --bs-accordion-btn-icon-transition: transform 0.2s ease-in-out;
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23052c65' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  --bs-accordion-btn-focus-box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  --bs-accordion-body-padding-x: 1.25rem;
  --bs-accordion-body-padding-y: 1rem;
  --bs-accordion-active-color: var(--bs-primary-text-emphasis);
  --bs-accordion-active-bg: var(--bs-primary-bg-subtle);
}

.accordion-button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--bs-accordion-btn-padding-y) var(--bs-accordion-btn-padding-x);
  font-size: 1rem;
  color: var(--bs-accordion-btn-color);
  text-align: left;
  background-color: var(--bs-accordion-btn-bg);
  border: 0;
  border-radius: 0;
  overflow-anchor: none;
  transition: var(--bs-accordion-transition);
}

@media (prefers-reduced-motion: reduce) {
  .accordion-button {
    transition: none;
  }
}

.accordion-button:not(.collapsed) {
  color: var(--bs-accordion-active-color);
  background-color: var(--bs-accordion-active-bg);
  box-shadow: inset 0 calc(-1 * var(--bs-accordion-border-width)) 0 var(--bs-accordion-border-color);
}

.accordion-button:not(.collapsed)::after {
  background-image: var(--bs-accordion-btn-active-icon);
  transform: var(--bs-accordion-btn-icon-transform);
}

.accordion-button::after {
  flex-shrink: 0;
  width: var(--bs-accordion-btn-icon-width);
  height: var(--bs-accordion-btn-icon-width);
  margin-left: auto;
  content: "";
  background-image: var(--bs-accordion-btn-icon);
  background-repeat: no-repeat;
  background-size: var(--bs-accordion-btn-icon-width);
  transition: var(--bs-accordion-btn-icon-transition);
}

@media (prefers-reduced-motion: reduce) {
  .accordion-button::after {
    transition: none;
  }
}

.accordion-button:hover {
  z-index: 2;
}

.accordion-button:focus {
  z-index: 3;
  outline: 0;
  box-shadow: var(--bs-accordion-btn-focus-box-shadow);
}

.accordion-header {
  margin-bottom: 0;
}

.accordion-item {
  color: var(--bs-accordion-color);
  background-color: var(--bs-accordion-bg);
  border: var(--bs-accordion-border-width) solid var(--bs-accordion-border-color);
}

.accordion-item:first-of-type {
  border-top-left-radius: var(--bs-accordion-border-radius);
  border-top-right-radius: var(--bs-accordion-border-radius);
}

.accordion-item:first-of-type>.accordion-header .accordion-button {
  border-top-left-radius: var(--bs-accordion-inner-border-radius);
  border-top-right-radius: var(--bs-accordion-inner-border-radius);
}

.accordion-item:not(:first-of-type) {
  border-top: 0;
}

.accordion-item:last-of-type {
  border-bottom-right-radius: var(--bs-accordion-border-radius);
  border-bottom-left-radius: var(--bs-accordion-border-radius);
}

.accordion-item:last-of-type>.accordion-header .accordion-button.collapsed {
  border-bottom-right-radius: var(--bs-accordion-inner-border-radius);
  border-bottom-left-radius: var(--bs-accordion-inner-border-radius);
}

.accordion-item:last-of-type>.accordion-collapse {
  border-bottom-right-radius: var(--bs-accordion-border-radius);
  border-bottom-left-radius: var(--bs-accordion-border-radius);
}

.accordion-body {
  padding: var(--bs-accordion-body-padding-y) var(--bs-accordion-body-padding-x);
}

.accordion-flush>.accordion-item {
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.accordion-flush>.accordion-item:first-child {
  border-top: 0;
}

.accordion-flush>.accordion-item:last-child {
  border-bottom: 0;
}

.accordion-flush>.accordion-item>.accordion-collapse,
.accordion-flush>.accordion-item>.accordion-header .accordion-button,
.accordion-flush>.accordion-item>.accordion-header .accordion-button.collapsed {
  border-radius: 0;
}

[data-bs-theme=dark] .accordion-button::after {
  --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236ea8fe'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3e%3c/svg%3e");
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236ea8fe'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3e%3c/svg%3e");
}

.breadcrumb {
  --bs-breadcrumb-padding-x: 0;
  --bs-breadcrumb-padding-y: 0;
  --bs-breadcrumb-margin-bottom: 1rem;
  --bs-breadcrumb-bg: ;
  --bs-breadcrumb-border-radius: ;
  --bs-breadcrumb-divider-color: var(--bs-secondary-color);
  --bs-breadcrumb-item-padding-x: 0.5rem;
  --bs-breadcrumb-item-active-color: var(--bs-secondary-color);
  display: flex;
  flex-wrap: wrap;
  padding: var(--bs-breadcrumb-padding-y) var(--bs-breadcrumb-padding-x);
  margin-bottom: var(--bs-breadcrumb-margin-bottom);
  font-size: var(--bs-breadcrumb-font-size);
  list-style: none;
  background-color: var(--bs-breadcrumb-bg);
  border-radius: var(--bs-breadcrumb-border-radius);
}

.breadcrumb-item+.breadcrumb-item {
  padding-left: var(--bs-breadcrumb-item-padding-x);
}

.breadcrumb-item+.breadcrumb-item::before {
  float: left;
  padding-right: var(--bs-breadcrumb-item-padding-x);
  color: var(--bs-breadcrumb-divider-color);
  content: var(--bs-breadcrumb-divider, "/")
    /* rtl: var(--bs-breadcrumb-divider, "/") */
  ;
}

.breadcrumb-item.active {
  color: var(--bs-breadcrumb-item-active-color);
}

.pagination {
  --bs-pagination-padding-x: 0.75rem;
  --bs-pagination-padding-y: 0.375rem;
  --bs-pagination-font-size: 1rem;
  --bs-pagination-color: var(--bs-link-color);
  --bs-pagination-bg: var(--bs-body-bg);
  --bs-pagination-border-width: var(--bs-border-width);
  --bs-pagination-border-color: var(--bs-border-color);
  --bs-pagination-border-radius: var(--bs-border-radius);
  --bs-pagination-hover-color: var(--bs-link-hover-color);
  --bs-pagination-hover-bg: var(--bs-tertiary-bg);
  --bs-pagination-hover-border-color: var(--bs-border-color);
  --bs-pagination-focus-color: var(--bs-link-hover-color);
  --bs-pagination-focus-bg: var(--bs-secondary-bg);
  --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  --bs-pagination-active-color: #fff;
  --bs-pagination-active-bg: #0d6efd;
  --bs-pagination-active-border-color: #0d6efd;
  --bs-pagination-disabled-color: var(--bs-secondary-color);
  --bs-pagination-disabled-bg: var(--bs-secondary-bg);
  --bs-pagination-disabled-border-color: var(--bs-border-color);
  display: flex;
  padding-left: 0;
  list-style: none;
}

.page-link {
  position: relative;
  display: block;
  padding: var(--bs-pagination-padding-y) var(--bs-pagination-padding-x);
  font-size: var(--bs-pagination-font-size);
  color: var(--bs-pagination-color);
  text-decoration: none;
  background-color: var(--bs-pagination-bg);
  border: var(--bs-pagination-border-width) solid var(--bs-pagination-border-color);
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .page-link {
    transition: none;
  }
}

.page-link:hover {
  z-index: 2;
  color: var(--bs-pagination-hover-color);
  background-color: var(--bs-pagination-hover-bg);
  border-color: var(--bs-pagination-hover-border-color);
}

.page-link:focus {
  z-index: 3;
  color: var(--bs-pagination-focus-color);
  background-color: var(--bs-pagination-focus-bg);
  outline: 0;
  box-shadow: var(--bs-pagination-focus-box-shadow);
}

.page-link.active,
.active>.page-link {
  z-index: 3;
  color: var(--bs-pagination-active-color);
  background-color: var(--bs-pagination-active-bg);
  border-color: var(--bs-pagination-active-border-color);
}

.page-link.disabled,
.disabled>.page-link {
  color: var(--bs-pagination-disabled-color);
  pointer-events: none;
  background-color: var(--bs-pagination-disabled-bg);
  border-color: var(--bs-pagination-disabled-border-color);
}

.page-item:not(:first-child) .page-link {
  margin-left: calc(-1 * var(--bs-border-width));
}

.page-item:first-child .page-link {
  border-top-left-radius: var(--bs-pagination-border-radius);
  border-bottom-left-radius: var(--bs-pagination-border-radius);
}

.page-item:last-child .page-link {
  border-top-right-radius: var(--bs-pagination-border-radius);
  border-bottom-right-radius: var(--bs-pagination-border-radius);
}

.pagination-lg {
  --bs-pagination-padding-x: 1.5rem;
  --bs-pagination-padding-y: 0.75rem;
  --bs-pagination-font-size: 1.25rem;
  --bs-pagination-border-radius: var(--bs-border-radius-lg);
}

.pagination-sm {
  --bs-pagination-padding-x: 0.5rem;
  --bs-pagination-padding-y: 0.25rem;
  --bs-pagination-font-size: 0.875rem;
  --bs-pagination-border-radius: var(--bs-border-radius-sm);
}

.badge {
  --bs-badge-padding-x: 0.65em;
  --bs-badge-padding-y: 0.35em;
  --bs-badge-font-size: 0.75em;
  --bs-badge-font-weight: 700;
  --bs-badge-color: #fff;
  --bs-badge-border-radius: var(--bs-border-radius);
  display: inline-block;
  padding: var(--bs-badge-padding-y) var(--bs-badge-padding-x);
  font-size: var(--bs-badge-font-size);
  font-weight: var(--bs-badge-font-weight);
  line-height: 1;
  color: var(--bs-badge-color);
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--bs-badge-border-radius);
}

.badge:empty {
  display: none;
}

.btn .badge {
  position: relative;
  top: -1px;
}

.alert {
  --bs-alert-bg: transparent;
  --bs-alert-padding-x: 1rem;
  --bs-alert-padding-y: 1rem;
  --bs-alert-margin-bottom: 1rem;
  --bs-alert-color: inherit;
  --bs-alert-border-color: transparent;
  --bs-alert-border: var(--bs-border-width) solid var(--bs-alert-border-color);
  --bs-alert-border-radius: var(--bs-border-radius);
  --bs-alert-link-color: inherit;
  position: relative;
  padding: var(--bs-alert-padding-y) var(--bs-alert-padding-x);
  margin-bottom: var(--bs-alert-margin-bottom);
  color: var(--bs-alert-color);
  background-color: var(--bs-alert-bg);
  border: var(--bs-alert-border);
  border-radius: var(--bs-alert-border-radius);
}

.alert-heading {
  color: inherit;
}

.alert-link {
  font-weight: 700;
  color: var(--bs-alert-link-color);
}

.alert-dismissible {
  padding-right: 3rem;
}

.alert-dismissible .btn-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  padding: 1.25rem 1rem;
}

.alert-primary {
  --bs-alert-color: var(--bs-primary-text-emphasis);
  --bs-alert-bg: var(--bs-primary-bg-subtle);
  --bs-alert-border-color: var(--bs-primary-border-subtle);
  --bs-alert-link-color: var(--bs-primary-text-emphasis);
}

.alert-secondary {
  --bs-alert-color: var(--bs-secondary-text-emphasis);
  --bs-alert-bg: var(--bs-secondary-bg-subtle);
  --bs-alert-border-color: var(--bs-secondary-border-subtle);
  --bs-alert-link-color: var(--bs-secondary-text-emphasis);
}

.alert-success {
  --bs-alert-color: var(--bs-success-text-emphasis);
  --bs-alert-bg: var(--bs-success-bg-subtle);
  --bs-alert-border-color: var(--bs-success-border-subtle);
  --bs-alert-link-color: var(--bs-success-text-emphasis);
}

.alert-info {
  --bs-alert-color: var(--bs-info-text-emphasis);
  --bs-alert-bg: var(--bs-info-bg-subtle);
  --bs-alert-border-color: var(--bs-info-border-subtle);
  --bs-alert-link-color: var(--bs-info-text-emphasis);
}

.alert-warning {
  --bs-alert-color: var(--bs-warning-text-emphasis);
  --bs-alert-bg: var(--bs-warning-bg-subtle);
  --bs-alert-border-color: var(--bs-warning-border-subtle);
  --bs-alert-link-color: var(--bs-warning-text-emphasis);
}

.alert-danger {
  --bs-alert-color: var(--bs-danger-text-emphasis);
  --bs-alert-bg: var(--bs-danger-bg-subtle);
  --bs-alert-border-color: var(--bs-danger-border-subtle);
  --bs-alert-link-color: var(--bs-danger-text-emphasis);
}

.alert-light {
  --bs-alert-color: var(--bs-light-text-emphasis);
  --bs-alert-bg: var(--bs-light-bg-subtle);
  --bs-alert-border-color: var(--bs-light-border-subtle);
  --bs-alert-link-color: var(--bs-light-text-emphasis);
}

.alert-dark {
  --bs-alert-color: var(--bs-dark-text-emphasis);
  --bs-alert-bg: var(--bs-dark-bg-subtle);
  --bs-alert-border-color: var(--bs-dark-border-subtle);
  --bs-alert-link-color: var(--bs-dark-text-emphasis);
}

@keyframes progress-bar-stripes {
  0% {
    background-position-x: var(--bs-progress-height);
  }
}

.progress,
.progress-stacked {
  --bs-progress-height: 1rem;
  --bs-progress-font-size: 0.75rem;
  --bs-progress-bg: var(--bs-secondary-bg);
  --bs-progress-border-radius: var(--bs-border-radius);
  --bs-progress-box-shadow: var(--bs-box-shadow-inset);
  --bs-progress-bar-color: #fff;
  --bs-progress-bar-bg: #0d6efd;
  --bs-progress-bar-transition: width 0.6s ease;
  display: flex;
  height: var(--bs-progress-height);
  overflow: hidden;
  font-size: var(--bs-progress-font-size);
  background-color: var(--bs-progress-bg);
  border-radius: var(--bs-progress-border-radius);
}

.progress-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: var(--bs-progress-bar-color);
  text-align: center;
  white-space: nowrap;
  background-color: var(--bs-progress-bar-bg);
  transition: var(--bs-progress-bar-transition);
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar {
    transition: none;
  }
}

.progress-bar-striped {
  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
  background-size: var(--bs-progress-height) var(--bs-progress-height);
}

.progress-stacked>.progress {
  overflow: visible;
}

.progress-stacked>.progress>.progress-bar {
  width: 100%;
}

.progress-bar-animated {
  animation: 1s linear infinite progress-bar-stripes;
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar-animated {
    animation: none;
  }
}

.list-group {
  --bs-list-group-color: var(--bs-body-color);
  --bs-list-group-bg: var(--bs-body-bg);
  --bs-list-group-border-color: var(--bs-border-color);
  --bs-list-group-border-width: var(--bs-border-width);
  --bs-list-group-border-radius: var(--bs-border-radius);
  --bs-list-group-item-padding-x: 1rem;
  --bs-list-group-item-padding-y: 0.5rem;
  --bs-list-group-action-color: var(--bs-secondary-color);
  --bs-list-group-action-hover-color: var(--bs-emphasis-color);
  --bs-list-group-action-hover-bg: var(--bs-tertiary-bg);
  --bs-list-group-action-active-color: var(--bs-body-color);
  --bs-list-group-action-active-bg: var(--bs-secondary-bg);
  --bs-list-group-disabled-color: var(--bs-secondary-color);
  --bs-list-group-disabled-bg: var(--bs-body-bg);
  --bs-list-group-active-color: #fff;
  --bs-list-group-active-bg: #0d6efd;
  --bs-list-group-active-border-color: #0d6efd;
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  border-radius: var(--bs-list-group-border-radius);
}

.list-group-numbered {
  list-style-type: none;
  counter-reset: section;
}

.list-group-numbered>.list-group-item::before {
  content: counters(section, ".") ". ";
  counter-increment: section;
}

.list-group-item {
  position: relative;
  display: block;
  padding: var(--bs-list-group-item-padding-y) var(--bs-list-group-item-padding-x);
  color: var(--bs-list-group-color);
  text-decoration: none;
  background-color: var(--bs-list-group-bg);
  border: var(--bs-list-group-border-width) solid var(--bs-list-group-border-color);
}

.list-group-item:first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.list-group-item:last-child {
  border-bottom-right-radius: inherit;
  border-bottom-left-radius: inherit;
}

.list-group-item.disabled,
.list-group-item:disabled {
  color: var(--bs-list-group-disabled-color);
  pointer-events: none;
  background-color: var(--bs-list-group-disabled-bg);
}

.list-group-item.active {
  z-index: 2;
  color: var(--bs-list-group-active-color);
  background-color: var(--bs-list-group-active-bg);
  border-color: var(--bs-list-group-active-border-color);
}

.list-group-item+.list-group-item {
  border-top-width: 0;
}

.list-group-item+.list-group-item.active {
  margin-top: calc(-1 * var(--bs-list-group-border-width));
  border-top-width: var(--bs-list-group-border-width);
}

.list-group-item-action {
  width: 100%;
  color: var(--bs-list-group-action-color);
  text-align: inherit;
}

.list-group-item-action:not(.active):hover,
.list-group-item-action:not(.active):focus {
  z-index: 1;
  color: var(--bs-list-group-action-hover-color);
  text-decoration: none;
  background-color: var(--bs-list-group-action-hover-bg);
}

.list-group-item-action:not(.active):active {
  color: var(--bs-list-group-action-active-color);
  background-color: var(--bs-list-group-action-active-bg);
}

.list-group-horizontal {
  flex-direction: row;
}

.list-group-horizontal>.list-group-item:first-child:not(:last-child) {
  border-bottom-left-radius: var(--bs-list-group-border-radius);
  border-top-right-radius: 0;
}

.list-group-horizontal>.list-group-item:last-child:not(:first-child) {
  border-top-right-radius: var(--bs-list-group-border-radius);
  border-bottom-left-radius: 0;
}

.list-group-horizontal>.list-group-item.active {
  margin-top: 0;
}

.list-group-horizontal>.list-group-item+.list-group-item {
  border-top-width: var(--bs-list-group-border-width);
  border-left-width: 0;
}

.list-group-horizontal>.list-group-item+.list-group-item.active {
  margin-left: calc(-1 * var(--bs-list-group-border-width));
  border-left-width: var(--bs-list-group-border-width);
}

@media (min-width: 576px) {
  .list-group-horizontal-sm {
    flex-direction: row;
  }

  .list-group-horizontal-sm>.list-group-item:first-child:not(:last-child) {
    border-bottom-left-radius: var(--bs-list-group-border-radius);
    border-top-right-radius: 0;
  }

  .list-group-horizontal-sm>.list-group-item:last-child:not(:first-child) {
    border-top-right-radius: var(--bs-list-group-border-radius);
    border-bottom-left-radius: 0;
  }

  .list-group-horizontal-sm>.list-group-item.active {
    margin-top: 0;
  }

  .list-group-horizontal-sm>.list-group-item+.list-group-item {
    border-top-width: var(--bs-list-group-border-width);
    border-left-width: 0;
  }

  .list-group-horizontal-sm>.list-group-item+.list-group-item.active {
    margin-left: calc(-1 * var(--bs-list-group-border-width));
    border-left-width: var(--bs-list-group-border-width);
  }
}

@media (min-width: 768px) {
  .list-group-horizontal-md {
    flex-direction: row;
  }

  .list-group-horizontal-md>.list-group-item:first-child:not(:last-child) {
    border-bottom-left-radius: var(--bs-list-group-border-radius);
    border-top-right-radius: 0;
  }

  .list-group-horizontal-md>.list-group-item:last-child:not(:first-child) {
    border-top-right-radius: var(--bs-list-group-border-radius);
    border-bottom-left-radius: 0;
  }

  .list-group-horizontal-md>.list-group-item.active {
    margin-top: 0;
  }

  .list-group-horizontal-md>.list-group-item+.list-group-item {
    border-top-width: var(--bs-list-group-border-width);
    border-left-width: 0;
  }

  .list-group-horizontal-md>.list-group-item+.list-group-item.active {
    margin-left: calc(-1 * var(--bs-list-group-border-width));
    border-left-width: var(--bs-list-group-border-width);
  }
}

@media (min-width: 992px) {
  .list-group-horizontal-lg {
    flex-direction: row;
  }

  .list-group-horizontal-lg>.list-group-item:first-child:not(:last-child) {
    border-bottom-left-radius: var(--bs-list-group-border-radius);
    border-top-right-radius: 0;
  }

  .list-group-horizontal-lg>.list-group-item:last-child:not(:first-child) {
    border-top-right-radius: var(--bs-list-group-border-radius);
    border-bottom-left-radius: 0;
  }

  .list-group-horizontal-lg>.list-group-item.active {
    margin-top: 0;
  }

  .list-group-horizontal-lg>.list-group-item+.list-group-item {
    border-top-width: var(--bs-list-group-border-width);
    border-left-width: 0;
  }

  .list-group-horizontal-lg>.list-group-item+.list-group-item.active {
    margin-left: calc(-1 * var(--bs-list-group-border-width));
    border-left-width: var(--bs-list-group-border-width);
  }
}

@media (min-width: 1200px) {
  .list-group-horizontal-xl {
    flex-direction: row;
  }

  .list-group-horizontal-xl>.list-group-item:first-child:not(:last-child) {
    border-bottom-left-radius: var(--bs-list-group-border-radius);
    border-top-right-radius: 0;
  }

  .list-group-horizontal-xl>.list-group-item:last-child:not(:first-child) {
    border-top-right-radius: var(--bs-list-group-border-radius);
    border-bottom-left-radius: 0;
  }

  .list-group-horizontal-xl>.list-group-item.active {
    margin-top: 0;
  }

  .list-group-horizontal-xl>.list-group-item+.list-group-item {
    border-top-width: var(--bs-list-group-border-width);
    border-left-width: 0;
  }

  .list-group-horizontal-xl>.list-group-item+.list-group-item.active {
    margin-left: calc(-1 * var(--bs-list-group-border-width));
    border-left-width: var(--bs-list-group-border-width);
  }
}

@media (min-width: 1400px) {
  .list-group-horizontal-xxl {
    flex-direction: row;
  }

  .list-group-horizontal-xxl>.list-group-item:first-child:not(:last-child) {
    border-bottom-left-radius: var(--bs-list-group-border-radius);
    border-top-right-radius: 0;
  }

  .list-group-horizontal-xxl>.list-group-item:last-child:not(:first-child) {
    border-top-right-radius: var(--bs-list-group-border-radius);
    border-bottom-left-radius: 0;
  }

  .list-group-horizontal-xxl>.list-group-item.active {
    margin-top: 0;
  }

  .list-group-horizontal-xxl>.list-group-item+.list-group-item {
    border-top-width: var(--bs-list-group-border-width);
    border-left-width: 0;
  }

  .list-group-horizontal-xxl>.list-group-item+.list-group-item.active {
    margin-left: calc(-1 * var(--bs-list-group-border-width));
    border-left-width: var(--bs-list-group-border-width);
  }
}

.list-group-flush {
  border-radius: 0;
}

.list-group-flush>.list-group-item {
  border-width: 0 0 var(--bs-list-group-border-width);
}

.list-group-flush>.list-group-item:last-child {
  border-bottom-width: 0;
}

.list-group-item-primary {
  --bs-list-group-color: var(--bs-primary-text-emphasis);
  --bs-list-group-bg: var(--bs-primary-bg-subtle);
  --bs-list-group-border-color: var(--bs-primary-border-subtle);
  --bs-list-group-action-hover-color: var(--bs-emphasis-color);
  --bs-list-group-action-hover-bg: var(--bs-primary-border-subtle);
  --bs-list-group-action-active-color: var(--bs-emphasis-color);
  --bs-list-group-action-active-bg: var(--bs-primary-border-subtle);
  --bs-list-group-active-color: var(--bs-primary-bg-subtle);
  --bs-list-group-active-bg: var(--bs-primary-text-emphasis);
  --bs-list-group-active-border-color: var(--bs-primary-text-emphasis);
}

.list-group-item-secondary {
  --bs-list-group-color: var(--bs-secondary-text-emphasis);
  --bs-list-group-bg: var(--bs-secondary-bg-subtle);
  --bs-list-group-border-color: var(--bs-secondary-border-subtle);
  --bs-list-group-action-hover-color: var(--bs-emphasis-color);
  --bs-list-group-action-hover-bg: var(--bs-secondary-border-subtle);
  --bs-list-group-action-active-color: var(--bs-emphasis-color);
  --bs-list-group-action-active-bg: var(--bs-secondary-border-subtle);
  --bs-list-group-active-color: var(--bs-secondary-bg-subtle);
  --bs-list-group-active-bg: var(--bs-secondary-text-emphasis);
  --bs-list-group-active-border-color: var(--bs-secondary-text-emphasis);
}

.list-group-item-success {
  --bs-list-group-color: var(--bs-success-text-emphasis);
  --bs-list-group-bg: var(--bs-success-bg-subtle);
  --bs-list-group-border-color: var(--bs-success-border-subtle);
  --bs-list-group-action-hover-color: var(--bs-emphasis-color);
  --bs-list-group-action-hover-bg: var(--bs-success-border-subtle);
  --bs-list-group-action-active-color: var(--bs-emphasis-color);
  --bs-list-group-action-active-bg: var(--bs-success-border-subtle);
  --bs-list-group-active-color: var(--bs-success-bg-subtle);
  --bs-list-group-active-bg: var(--bs-success-text-emphasis);
  --bs-list-group-active-border-color: var(--bs-success-text-emphasis);
}

.list-group-item-info {
  --bs-list-group-color: var(--bs-info-text-emphasis);
  --bs-list-group-bg: var(--bs-info-bg-subtle);
  --bs-list-group-border-color: var(--bs-info-border-subtle);
  --bs-list-group-action-hover-color: var(--bs-emphasis-color);
  --bs-list-group-action-hover-bg: var(--bs-info-border-subtle);
  --bs-list-group-action-active-color: var(--bs-emphasis-color);
  --bs-list-group-action-active-bg: var(--bs-info-border-subtle);
  --bs-list-group-active-color: var(--bs-info-bg-subtle);
  --bs-list-group-active-bg: var(--bs-info-text-emphasis);
  --bs-list-group-active-border-color: var(--bs-info-text-emphasis);
}

.list-group-item-warning {
  --bs-list-group-color: var(--bs-warning-text-emphasis);
  --bs-list-group-bg: var(--bs-warning-bg-subtle);
  --bs-list-group-border-color: var(--bs-warning-border-subtle);
  --bs-list-group-action-hover-color: var(--bs-emphasis-color);
  --bs-list-group-action-hover-bg: var(--bs-warning-border-subtle);
  --bs-list-group-action-active-color: var(--bs-emphasis-color);
  --bs-list-group-action-active-bg: var(--bs-warning-border-subtle);
  --bs-list-group-active-color: var(--bs-warning-bg-subtle);
  --bs-list-group-active-bg: var(--bs-warning-text-emphasis);
  --bs-list-group-active-border-color: var(--bs-warning-text-emphasis);
}

.list-group-item-danger {
  --bs-list-group-color: var(--bs-danger-text-emphasis);
  --bs-list-group-bg: var(--bs-danger-bg-subtle);
  --bs-list-group-border-color: var(--bs-danger-border-subtle);
  --bs-list-group-action-hover-color: var(--bs-emphasis-color);
  --bs-list-group-action-hover-bg: var(--bs-danger-border-subtle);
  --bs-list-group-action-active-color: var(--bs-emphasis-color);
  --bs-list-group-action-active-bg: var(--bs-danger-border-subtle);
  --bs-list-group-active-color: var(--bs-danger-bg-subtle);
  --bs-list-group-active-bg: var(--bs-danger-text-emphasis);
  --bs-list-group-active-border-color: var(--bs-danger-text-emphasis);
}

.list-group-item-light {
  --bs-list-group-color: var(--bs-light-text-emphasis);
  --bs-list-group-bg: var(--bs-light-bg-subtle);
  --bs-list-group-border-color: var(--bs-light-border-subtle);
  --bs-list-group-action-hover-color: var(--bs-emphasis-color);
  --bs-list-group-action-hover-bg: var(--bs-light-border-subtle);
  --bs-list-group-action-active-color: var(--bs-emphasis-color);
  --bs-list-group-action-active-bg: var(--bs-light-border-subtle);
  --bs-list-group-active-color: var(--bs-light-bg-subtle);
  --bs-list-group-active-bg: var(--bs-light-text-emphasis);
  --bs-list-group-active-border-color: var(--bs-light-text-emphasis);
}

.list-group-item-dark {
  --bs-list-group-color: var(--bs-dark-text-emphasis);
  --bs-list-group-bg: var(--bs-dark-bg-subtle);
  --bs-list-group-border-color: var(--bs-dark-border-subtle);
  --bs-list-group-action-hover-color: var(--bs-emphasis-color);
  --bs-list-group-action-hover-bg: var(--bs-dark-border-subtle);
  --bs-list-group-action-active-color: var(--bs-emphasis-color);
  --bs-list-group-action-active-bg: var(--bs-dark-border-subtle);
  --bs-list-group-active-color: var(--bs-dark-bg-subtle);
  --bs-list-group-active-bg: var(--bs-dark-text-emphasis);
  --bs-list-group-active-border-color: var(--bs-dark-text-emphasis);
}

.btn-close {
  --bs-btn-close-color: #000;
  --bs-btn-close-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414'/%3e%3c/svg%3e");
  --bs-btn-close-opacity: 0.5;
  --bs-btn-close-hover-opacity: 0.75;
  --bs-btn-close-focus-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  --bs-btn-close-focus-opacity: 1;
  --bs-btn-close-disabled-opacity: 0.25;
  box-sizing: content-box;
  width: 1em;
  height: 1em;
  padding: 0.25em 0.25em;
  color: var(--bs-btn-close-color);
  background: transparent var(--bs-btn-close-bg) center/1em auto no-repeat;
  filter: var(--bs-btn-close-filter);
  border: 0;
  border-radius: 0.375rem;
  opacity: var(--bs-btn-close-opacity);
}

.btn-close:hover {
  color: var(--bs-btn-close-color);
  text-decoration: none;
  opacity: var(--bs-btn-close-hover-opacity);
}

.btn-close:focus {
  outline: 0;
  box-shadow: var(--bs-btn-close-focus-shadow);
  opacity: var(--bs-btn-close-focus-opacity);
}

.btn-close:disabled,
.btn-close.disabled {
  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  opacity: var(--bs-btn-close-disabled-opacity);
}

.btn-close-white {
  --bs-btn-close-filter: invert(1) grayscale(100%) brightness(200%);
}

:root,
[data-bs-theme=light] {
  --bs-btn-close-filter: ;
}

[data-bs-theme=dark] {
  --bs-btn-close-filter: invert(1) grayscale(100%) brightness(200%);
}

.toast {
  --bs-toast-zindex: 1090;
  --bs-toast-padding-x: 0.75rem;
  --bs-toast-padding-y: 0.5rem;
  --bs-toast-spacing: 1.5rem;
  --bs-toast-max-width: 350px;
  --bs-toast-font-size: 0.875rem;
  --bs-toast-color: ;
  --bs-toast-bg: rgba(var(--bs-body-bg-rgb), 0.85);
  --bs-toast-border-width: var(--bs-border-width);
  --bs-toast-border-color: var(--bs-border-color-translucent);
  --bs-toast-border-radius: var(--bs-border-radius);
  --bs-toast-box-shadow: var(--bs-box-shadow);
  --bs-toast-header-color: var(--bs-secondary-color);
  --bs-toast-header-bg: rgba(var(--bs-body-bg-rgb), 0.85);
  --bs-toast-header-border-color: var(--bs-border-color-translucent);
  width: var(--bs-toast-max-width);
  max-width: 100%;
  font-size: var(--bs-toast-font-size);
  color: var(--bs-toast-color);
  pointer-events: auto;
  background-color: var(--bs-toast-bg);
  background-clip: padding-box;
  border: var(--bs-toast-border-width) solid var(--bs-toast-border-color);
  box-shadow: var(--bs-toast-box-shadow);
  border-radius: var(--bs-toast-border-radius);
}

.toast.showing {
  opacity: 0;
}

.toast:not(.show) {
  display: none;
}

.toast-container {
  --bs-toast-zindex: 1090;
  position: absolute;
  z-index: var(--bs-toast-zindex);
  width: -webkit-max-content;
  width: -moz-max-content;
  width: max-content;
  max-width: 100%;
  pointer-events: none;
}

.toast-container> :not(:last-child) {
  margin-bottom: var(--bs-toast-spacing);
}

.toast-header {
  display: flex;
  align-items: center;
  padding: var(--bs-toast-padding-y) var(--bs-toast-padding-x);
  color: var(--bs-toast-header-color);
  background-color: var(--bs-toast-header-bg);
  background-clip: padding-box;
  border-bottom: var(--bs-toast-border-width) solid var(--bs-toast-header-border-color);
  border-top-left-radius: calc(var(--bs-toast-border-radius) - var(--bs-toast-border-width));
  border-top-right-radius: calc(var(--bs-toast-border-radius) - var(--bs-toast-border-width));
}

.toast-header .btn-close {
  margin-right: calc(-0.5 * var(--bs-toast-padding-x));
  margin-left: var(--bs-toast-padding-x);
}

.toast-body {
  padding: var(--bs-toast-padding-x);
  word-wrap: break-word;
}

.modal {
  --bs-modal-zindex: 1055;
  --bs-modal-width: 500px;
  --bs-modal-padding: 1rem;
  --bs-modal-margin: 0.5rem;
  --bs-modal-color: var(--bs-body-color);
  --bs-modal-bg: var(--bs-body-bg);
  --bs-modal-border-color: var(--bs-border-color-translucent);
  --bs-modal-border-width: var(--bs-border-width);
  --bs-modal-border-radius: var(--bs-border-radius-lg);
  --bs-modal-box-shadow: var(--bs-box-shadow-sm);
  --bs-modal-inner-border-radius: calc(var(--bs-border-radius-lg) - (var(--bs-border-width)));
  --bs-modal-header-padding-x: 1rem;
  --bs-modal-header-padding-y: 1rem;
  --bs-modal-header-padding: 1rem 1rem;
  --bs-modal-header-border-color: var(--bs-border-color);
  --bs-modal-header-border-width: var(--bs-border-width);
  --bs-modal-title-line-height: 1.5;
  --bs-modal-footer-gap: 0.5rem;
  --bs-modal-footer-bg: ;
  --bs-modal-footer-border-color: var(--bs-border-color);
  --bs-modal-footer-border-width: var(--bs-border-width);
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--bs-modal-zindex);
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: var(--bs-modal-margin);
  pointer-events: none;
}

.modal.fade .modal-dialog {
  transform: translate(0, -50px);
  transition: transform 0.3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .modal.fade .modal-dialog {
    transition: none;
  }
}

.modal.show .modal-dialog {
  transform: none;
}

.modal.modal-static .modal-dialog {
  transform: scale(1.02);
}

.modal-dialog-scrollable {
  height: calc(100% - var(--bs-modal-margin) * 2);
}

.modal-dialog-scrollable .modal-content {
  max-height: 100%;
  overflow: hidden;
}

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

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - var(--bs-modal-margin) * 2);
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  color: var(--bs-modal-color);
  pointer-events: auto;
  background-color: var(--bs-modal-bg);
  background-clip: padding-box;
  border: var(--bs-modal-border-width) solid var(--bs-modal-border-color);
  border-radius: var(--bs-modal-border-radius);
  outline: 0;
}

.modal-backdrop {
  --bs-backdrop-zindex: 1050;
  --bs-backdrop-bg: #000;
  --bs-backdrop-opacity: 0.5;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--bs-backdrop-zindex);
  width: 100vw;
  height: 100vh;
  background-color: var(--bs-backdrop-bg);
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.show {
  opacity: var(--bs-backdrop-opacity);
}

.modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  padding: var(--bs-modal-header-padding);
  border-bottom: var(--bs-modal-header-border-width) solid var(--bs-modal-header-border-color);
  border-top-left-radius: var(--bs-modal-inner-border-radius);
  border-top-right-radius: var(--bs-modal-inner-border-radius);
}

.modal-header .btn-close {
  padding: calc(var(--bs-modal-header-padding-y) * 0.5) calc(var(--bs-modal-header-padding-x) * 0.5);
  margin-top: calc(-0.5 * var(--bs-modal-header-padding-y));
  margin-right: calc(-0.5 * var(--bs-modal-header-padding-x));
  margin-bottom: calc(-0.5 * var(--bs-modal-header-padding-y));
  margin-left: auto;
}

.modal-title {
  margin-bottom: 0;
  line-height: var(--bs-modal-title-line-height);
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: var(--bs-modal-padding);
}

.modal-footer {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: calc(var(--bs-modal-padding) - var(--bs-modal-footer-gap) * 0.5);
  background-color: var(--bs-modal-footer-bg);
  border-top: var(--bs-modal-footer-border-width) solid var(--bs-modal-footer-border-color);
  border-bottom-right-radius: var(--bs-modal-inner-border-radius);
  border-bottom-left-radius: var(--bs-modal-inner-border-radius);
}

.modal-footer>* {
  margin: calc(var(--bs-modal-footer-gap) * 0.5);
}

@media (min-width: 576px) {
  .modal {
    --bs-modal-margin: 1.75rem;
    --bs-modal-box-shadow: var(--bs-box-shadow);
  }

  .modal-dialog {
    max-width: var(--bs-modal-width);
    margin-right: auto;
    margin-left: auto;
  }

  .modal-sm {
    --bs-modal-width: 300px;
  }
}

@media (min-width: 992px) {

  .modal-lg,
  .modal-xl {
    --bs-modal-width: 800px;
  }
}

@media (min-width: 1200px) {
  .modal-xl {
    --bs-modal-width: 1140px;
  }
}

.modal-fullscreen {
  width: 100vw;
  max-width: none;
  height: 100%;
  margin: 0;
}

.modal-fullscreen .modal-content {
  height: 100%;
  border: 0;
  border-radius: 0;
}

.modal-fullscreen .modal-header,
.modal-fullscreen .modal-footer {
  border-radius: 0;
}

.modal-fullscreen .modal-body {
  overflow-y: auto;
}

@media (max-width: 575.98px) {
  .modal-fullscreen-sm-down {
    width: 100vw;
    max-width: none;
    height: 100%;
    margin: 0;
  }

  .modal-fullscreen-sm-down .modal-content {
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .modal-fullscreen-sm-down .modal-header,
  .modal-fullscreen-sm-down .modal-footer {
    border-radius: 0;
  }

  .modal-fullscreen-sm-down .modal-body {
    overflow-y: auto;
  }
}

@media (max-width: 767.98px) {
  .modal-fullscreen-md-down {
    width: 100vw;
    max-width: none;
    height: 100%;
    margin: 0;
  }

  .modal-fullscreen-md-down .modal-content {
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .modal-fullscreen-md-down .modal-header,
  .modal-fullscreen-md-down .modal-footer {
    border-radius: 0;
  }

  .modal-fullscreen-md-down .modal-body {
    overflow-y: auto;
  }
}

@media (max-width: 991.98px) {
  .modal-fullscreen-lg-down {
    width: 100vw;
    max-width: none;
    height: 100%;
    margin: 0;
  }

  .modal-fullscreen-lg-down .modal-content {
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .modal-fullscreen-lg-down .modal-header,
  .modal-fullscreen-lg-down .modal-footer {
    border-radius: 0;
  }

  .modal-fullscreen-lg-down .modal-body {
    overflow-y: auto;
  }
}

@media (max-width: 1199.98px) {
  .modal-fullscreen-xl-down {
    width: 100vw;
    max-width: none;
    height: 100%;
    margin: 0;
  }

  .modal-fullscreen-xl-down .modal-content {
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .modal-fullscreen-xl-down .modal-header,
  .modal-fullscreen-xl-down .modal-footer {
    border-radius: 0;
  }

  .modal-fullscreen-xl-down .modal-body {
    overflow-y: auto;
  }
}

@media (max-width: 1399.98px) {
  .modal-fullscreen-xxl-down {
    width: 100vw;
    max-width: none;
    height: 100%;
    margin: 0;
  }

  .modal-fullscreen-xxl-down .modal-content {
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .modal-fullscreen-xxl-down .modal-header,
  .modal-fullscreen-xxl-down .modal-footer {
    border-radius: 0;
  }

  .modal-fullscreen-xxl-down .modal-body {
    overflow-y: auto;
  }
}

.tooltip {
  --bs-tooltip-zindex: 1080;
  --bs-tooltip-max-width: 200px;
  --bs-tooltip-padding-x: 0.5rem;
  --bs-tooltip-padding-y: 0.25rem;
  --bs-tooltip-margin: ;
  --bs-tooltip-font-size: 0.875rem;
  --bs-tooltip-color: var(--bs-body-bg);
  --bs-tooltip-bg: var(--bs-emphasis-color);
  --bs-tooltip-border-radius: var(--bs-border-radius);
  --bs-tooltip-opacity: 0.9;
  --bs-tooltip-arrow-width: 0.8rem;
  --bs-tooltip-arrow-height: 0.4rem;
  z-index: var(--bs-tooltip-zindex);
  display: block;
  margin: var(--bs-tooltip-margin);
  font-family: var(--bs-font-sans-serif);
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  text-align: start;
  text-decoration: none;
  text-shadow: none;
  text-transform: none;
  letter-spacing: normal;
  word-break: normal;
  white-space: normal;
  word-spacing: normal;
  line-break: auto;
  font-size: var(--bs-tooltip-font-size);
  word-wrap: break-word;
  opacity: 0;
}

.tooltip.show {
  opacity: var(--bs-tooltip-opacity);
}

.tooltip .tooltip-arrow {
  display: block;
  width: var(--bs-tooltip-arrow-width);
  height: var(--bs-tooltip-arrow-height);
}

.tooltip .tooltip-arrow::before {
  position: absolute;
  content: "";
  border-color: transparent;
  border-style: solid;
}

.bs-tooltip-top .tooltip-arrow,
.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow {
  bottom: calc(-1 * var(--bs-tooltip-arrow-height));
}

.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before {
  top: -1px;
  border-width: var(--bs-tooltip-arrow-height) calc(var(--bs-tooltip-arrow-width) * 0.5) 0;
  border-top-color: var(--bs-tooltip-bg);
}

/* rtl:begin:ignore */
.bs-tooltip-end .tooltip-arrow,
.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow {
  left: calc(-1 * var(--bs-tooltip-arrow-height));
  width: var(--bs-tooltip-arrow-height);
  height: var(--bs-tooltip-arrow-width);
}

.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow::before {
  right: -1px;
  border-width: calc(var(--bs-tooltip-arrow-width) * 0.5) var(--bs-tooltip-arrow-height) calc(var(--bs-tooltip-arrow-width) * 0.5) 0;
  border-right-color: var(--bs-tooltip-bg);
}

/* rtl:end:ignore */
.bs-tooltip-bottom .tooltip-arrow,
.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow {
  top: calc(-1 * var(--bs-tooltip-arrow-height));
}

.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before {
  bottom: -1px;
  border-width: 0 calc(var(--bs-tooltip-arrow-width) * 0.5) var(--bs-tooltip-arrow-height);
  border-bottom-color: var(--bs-tooltip-bg);
}

/* rtl:begin:ignore */
.bs-tooltip-start .tooltip-arrow,
.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow {
  right: calc(-1 * var(--bs-tooltip-arrow-height));
  width: var(--bs-tooltip-arrow-height);
  height: var(--bs-tooltip-arrow-width);
}

.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow::before {
  left: -1px;
  border-width: calc(var(--bs-tooltip-arrow-width) * 0.5) 0 calc(var(--bs-tooltip-arrow-width) * 0.5) var(--bs-tooltip-arrow-height);
  border-left-color: var(--bs-tooltip-bg);
}

/* rtl:end:ignore */
.tooltip-inner {
  max-width: var(--bs-tooltip-max-width);
  padding: var(--bs-tooltip-padding-y) var(--bs-tooltip-padding-x);
  color: var(--bs-tooltip-color);
  text-align: center;
  background-color: var(--bs-tooltip-bg);
  border-radius: var(--bs-tooltip-border-radius);
}

.popover {
  --bs-popover-zindex: 1070;
  --bs-popover-max-width: 276px;
  --bs-popover-font-size: 0.875rem;
  --bs-popover-bg: var(--bs-body-bg);
  --bs-popover-border-width: var(--bs-border-width);
  --bs-popover-border-color: var(--bs-border-color-translucent);
  --bs-popover-border-radius: var(--bs-border-radius-lg);
  --bs-popover-inner-border-radius: calc(var(--bs-border-radius-lg) - var(--bs-border-width));
  --bs-popover-box-shadow: var(--bs-box-shadow);
  --bs-popover-header-padding-x: 1rem;
  --bs-popover-header-padding-y: 0.5rem;
  --bs-popover-header-font-size: 1rem;
  --bs-popover-header-color: inherit;
  --bs-popover-header-bg: var(--bs-secondary-bg);
  --bs-popover-body-padding-x: 1rem;
  --bs-popover-body-padding-y: 1rem;
  --bs-popover-body-color: var(--bs-body-color);
  --bs-popover-arrow-width: 1rem;
  --bs-popover-arrow-height: 0.5rem;
  --bs-popover-arrow-border: var(--bs-popover-border-color);
  z-index: var(--bs-popover-zindex);
  display: block;
  max-width: var(--bs-popover-max-width);
  font-family: var(--bs-font-sans-serif);
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  text-align: start;
  text-decoration: none;
  text-shadow: none;
  text-transform: none;
  letter-spacing: normal;
  word-break: normal;
  white-space: normal;
  word-spacing: normal;
  line-break: auto;
  font-size: var(--bs-popover-font-size);
  word-wrap: break-word;
  background-color: var(--bs-popover-bg);
  background-clip: padding-box;
  border: var(--bs-popover-border-width) solid var(--bs-popover-border-color);
  border-radius: var(--bs-popover-border-radius);
}

.popover .popover-arrow {
  display: block;
  width: var(--bs-popover-arrow-width);
  height: var(--bs-popover-arrow-height);
}

.popover .popover-arrow::before,
.popover .popover-arrow::after {
  position: absolute;
  display: block;
  content: "";
  border-color: transparent;
  border-style: solid;
  border-width: 0;
}

.bs-popover-top>.popover-arrow,
.bs-popover-auto[data-popper-placement^=top]>.popover-arrow {
  bottom: calc(-1 * (var(--bs-popover-arrow-height)) - var(--bs-popover-border-width));
}

.bs-popover-top>.popover-arrow::before,
.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::before,
.bs-popover-top>.popover-arrow::after,
.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::after {
  border-width: var(--bs-popover-arrow-height) calc(var(--bs-popover-arrow-width) * 0.5) 0;
}

.bs-popover-top>.popover-arrow::before,
.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::before {
  bottom: 0;
  border-top-color: var(--bs-popover-arrow-border);
}

.bs-popover-top>.popover-arrow::after,
.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::after {
  bottom: var(--bs-popover-border-width);
  border-top-color: var(--bs-popover-bg);
}

/* rtl:begin:ignore */
.bs-popover-end>.popover-arrow,
.bs-popover-auto[data-popper-placement^=right]>.popover-arrow {
  left: calc(-1 * (var(--bs-popover-arrow-height)) - var(--bs-popover-border-width));
  width: var(--bs-popover-arrow-height);
  height: var(--bs-popover-arrow-width);
}

.bs-popover-end>.popover-arrow::before,
.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::before,
.bs-popover-end>.popover-arrow::after,
.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::after {
  border-width: calc(var(--bs-popover-arrow-width) * 0.5) var(--bs-popover-arrow-height) calc(var(--bs-popover-arrow-width) * 0.5) 0;
}

.bs-popover-end>.popover-arrow::before,
.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::before {
  left: 0;
  border-right-color: var(--bs-popover-arrow-border);
}

.bs-popover-end>.popover-arrow::after,
.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::after {
  left: var(--bs-popover-border-width);
  border-right-color: var(--bs-popover-bg);
}

/* rtl:end:ignore */
.bs-popover-bottom>.popover-arrow,
.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow {
  top: calc(-1 * (var(--bs-popover-arrow-height)) - var(--bs-popover-border-width));
}

.bs-popover-bottom>.popover-arrow::before,
.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::before,
.bs-popover-bottom>.popover-arrow::after,
.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::after {
  border-width: 0 calc(var(--bs-popover-arrow-width) * 0.5) var(--bs-popover-arrow-height);
}

.bs-popover-bottom>.popover-arrow::before,
.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::before {
  top: 0;
  border-bottom-color: var(--bs-popover-arrow-border);
}

.bs-popover-bottom>.popover-arrow::after,
.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::after {
  top: var(--bs-popover-border-width);
  border-bottom-color: var(--bs-popover-bg);
}

.bs-popover-bottom .popover-header::before,
.bs-popover-auto[data-popper-placement^=bottom] .popover-header::before {
  position: absolute;
  top: 0;
  left: 50%;
  display: block;
  width: var(--bs-popover-arrow-width);
  margin-left: calc(-0.5 * var(--bs-popover-arrow-width));
  content: "";
  border-bottom: var(--bs-popover-border-width) solid var(--bs-popover-header-bg);
}

/* rtl:begin:ignore */
.bs-popover-start>.popover-arrow,
.bs-popover-auto[data-popper-placement^=left]>.popover-arrow {
  right: calc(-1 * (var(--bs-popover-arrow-height)) - var(--bs-popover-border-width));
  width: var(--bs-popover-arrow-height);
  height: var(--bs-popover-arrow-width);
}

.bs-popover-start>.popover-arrow::before,
.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::before,
.bs-popover-start>.popover-arrow::after,
.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::after {
  border-width: calc(var(--bs-popover-arrow-width) * 0.5) 0 calc(var(--bs-popover-arrow-width) * 0.5) var(--bs-popover-arrow-height);
}

.bs-popover-start>.popover-arrow::before,
.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::before {
  right: 0;
  border-left-color: var(--bs-popover-arrow-border);
}

.bs-popover-start>.popover-arrow::after,
.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::after {
  right: var(--bs-popover-border-width);
  border-left-color: var(--bs-popover-bg);
}

/* rtl:end:ignore */
.popover-header {
  padding: var(--bs-popover-header-padding-y) var(--bs-popover-header-padding-x);
  margin-bottom: 0;
  font-size: var(--bs-popover-header-font-size);
  color: var(--bs-popover-header-color);
  background-color: var(--bs-popover-header-bg);
  border-bottom: var(--bs-popover-border-width) solid var(--bs-popover-border-color);
  border-top-left-radius: var(--bs-popover-inner-border-radius);
  border-top-right-radius: var(--bs-popover-inner-border-radius);
}

.popover-header:empty {
  display: none;
}

.popover-body {
  padding: var(--bs-popover-body-padding-y) var(--bs-popover-body-padding-x);
  color: var(--bs-popover-body-color);
}

.carousel {
  position: relative;
}

.carousel.pointer-event {
  touch-action: pan-y;
}

.carousel-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.carousel-inner::after {
  display: block;
  clear: both;
  content: "";
}

.carousel-item {
  position: relative;
  display: none;
  float: left;
  width: 100%;
  margin-right: -100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: transform 0.6s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-item {
    transition: none;
  }
}

.carousel-item.active,
.carousel-item-next,
.carousel-item-prev {
  display: block;
}

.carousel-item-next:not(.carousel-item-start),
.active.carousel-item-end {
  transform: translateX(100%);
}

.carousel-item-prev:not(.carousel-item-end),
.active.carousel-item-start {
  transform: translateX(-100%);
}

.carousel-fade .carousel-item {
  opacity: 0;
  transition-property: opacity;
  transform: none;
}

.carousel-fade .carousel-item.active,
.carousel-fade .carousel-item-next.carousel-item-start,
.carousel-fade .carousel-item-prev.carousel-item-end {
  z-index: 1;
  opacity: 1;
}

.carousel-fade .active.carousel-item-start,
.carousel-fade .active.carousel-item-end {
  z-index: 0;
  opacity: 0;
  transition: opacity 0s 0.6s;
}

@media (prefers-reduced-motion: reduce) {

  .carousel-fade .active.carousel-item-start,
  .carousel-fade .active.carousel-item-end {
    transition: none;
  }
}

.carousel-control-prev,
.carousel-control-next {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 15%;
  padding: 0;
  color: #fff;
  text-align: center;
  background: none;
  filter: var(--bs-carousel-control-icon-filter);
  border: 0;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {

  .carousel-control-prev,
  .carousel-control-next {
    transition: none;
  }
}

.carousel-control-prev:hover,
.carousel-control-prev:focus,
.carousel-control-next:hover,
.carousel-control-next:focus {
  color: #fff;
  text-decoration: none;
  outline: 0;
  opacity: 0.9;
}

.carousel-control-prev {
  left: 0;
}

.carousel-control-next {
  right: 0;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  background-repeat: no-repeat;
  background-position: 50%;
  background-size: 100% 100%;
}

.carousel-control-prev-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0'/%3e%3c/svg%3e")
    /*rtl:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708'/%3e%3c/svg%3e")*/
  ;
}

.carousel-control-next-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708'/%3e%3c/svg%3e")
    /*rtl:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0'/%3e%3c/svg%3e")*/
  ;
}

.carousel-indicators {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: 0;
  margin-right: 15%;
  margin-bottom: 1rem;
  margin-left: 15%;
}

.carousel-indicators [data-bs-target] {
  box-sizing: content-box;
  flex: 0 1 auto;
  width: 30px;
  height: 3px;
  padding: 0;
  margin-right: 3px;
  margin-left: 3px;
  text-indent: -999px;
  cursor: pointer;
  background-color: var(--bs-carousel-indicator-active-bg);
  background-clip: padding-box;
  border: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  opacity: 0.5;
  transition: opacity 0.6s ease;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-indicators [data-bs-target] {
    transition: none;
  }
}

.carousel-indicators .active {
  opacity: 1;
}

.carousel-caption {
  position: absolute;
  right: 15%;
  bottom: 1.25rem;
  left: 15%;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  color: var(--bs-carousel-caption-color);
  text-align: center;
}

.carousel-dark {
  --bs-carousel-indicator-active-bg: #000;
  --bs-carousel-caption-color: #000;
  --bs-carousel-control-icon-filter: invert(1) grayscale(100);
}

:root,
[data-bs-theme=light] {
  --bs-carousel-indicator-active-bg: #fff;
  --bs-carousel-caption-color: #fff;
  --bs-carousel-control-icon-filter: ;
}

[data-bs-theme=dark] {
  --bs-carousel-indicator-active-bg: #000;
  --bs-carousel-caption-color: #000;
  --bs-carousel-control-icon-filter: invert(1) grayscale(100);
}

.spinner-grow,
.spinner-border {
  display: inline-block;
  flex-shrink: 0;
  width: var(--bs-spinner-width);
  height: var(--bs-spinner-height);
  vertical-align: var(--bs-spinner-vertical-align);
  border-radius: 50%;
  animation: var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name);
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg)
      /* rtl:ignore */
    ;
  }
}

.spinner-border {
  --bs-spinner-width: 2rem;
  --bs-spinner-height: 2rem;
  --bs-spinner-vertical-align: -0.125em;
  --bs-spinner-border-width: 0.25em;
  --bs-spinner-animation-speed: 0.75s;
  --bs-spinner-animation-name: spinner-border;
  border: var(--bs-spinner-border-width) solid currentcolor;
  border-right-color: transparent;
}

.spinner-border-sm {
  --bs-spinner-width: 1rem;
  --bs-spinner-height: 1rem;
  --bs-spinner-border-width: 0.2em;
}

@keyframes spinner-grow {
  0% {
    transform: scale(0);
  }

  50% {
    opacity: 1;
    transform: none;
  }
}

.spinner-grow {
  --bs-spinner-width: 2rem;
  --bs-spinner-height: 2rem;
  --bs-spinner-vertical-align: -0.125em;
  --bs-spinner-animation-speed: 0.75s;
  --bs-spinner-animation-name: spinner-grow;
  background-color: currentcolor;
  opacity: 0;
}

.spinner-grow-sm {
  --bs-spinner-width: 1rem;
  --bs-spinner-height: 1rem;
}

@media (prefers-reduced-motion: reduce) {

  .spinner-border,
  .spinner-grow {
    --bs-spinner-animation-speed: 1.5s;
  }
}/* Overlay with blur */
.profile-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    z-index: 1000;
}

/* Modal container */
.profile-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Close button */
.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

/* Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

/* Photo */
.profile-photo-section {
    text-align: center;
}

.profile-photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.user-details-section h2 {
    margin: 0;
    font-size: 1.3rem;
}

.user-details-section p {
    margin: 0.25rem 0 0;
    color: #555;
}

/* Form */
.profile-form h3 {
    margin: 1rem 0 0.5rem;
    color: #333;
    font-size: 1.1rem;
}


/* Form actions */
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Error text */
.error-message {
    color: #d9534f;
    margin: -0.5rem 0 0.75rem;
    font-size: 0.85rem;
}

/* Scrollbar */
.profile-modal-content::-webkit-scrollbar {
    width: 8px;
}

.profile-modal-content::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.profile-modal-content::-webkit-scrollbar-thumb {
    background: #852190;
    border-radius: 4px;
}

.profile-modal-content::-webkit-scrollbar-thumb:hover {
    background: #6f166f;
}

/* Responsive */
@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }
}.report-management {
    padding: 20px;
    background: #f5f5f5;
    min-height: 100vh;
}

.report-filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.border-left {
    border-left: 5px solid #002060;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.font-bold {
    font-weight: bold;
}

.filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex: 1;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.filter-select,
.filter-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #4a90e2;
}

.btn-run-report {
    padding: 8px 24px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-run-report:hover {
    background: #357abd;
}

.btn-run-report:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.export-buttons {
    display: flex;
    gap: 10px;
    justify-content: right;
    margin-bottom: 10px;
}

.btn-view-all,
.btn-pdf,
.btn-excel,
.btn-print {
    padding: 10px 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-view-all {
    background: #6c757d;
    color: white;
}

.btn-view-all:hover {
    background: #5a6268;
}

.btn-pdf {
    background: #dc3545;
    color: white;
}

.btn-pdf:hover {
    background: #c82333;
}

.btn-excel {
    background: #28a745;
    color: white;
}

.btn-excel:hover {
    background: #218838;
}

.btn-print {
    background: #6f42c1;
    color: white;
}

.btn-print:hover {
    background: #5a32a3;
}

.search-bar {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.search-input:focus {
    outline: none;
    border-color: #4a90e2;
}

.report-table-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.report-table thead {
    background: #002060;
    color: white;
}

.report-table th,
.report-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
}

.report-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.report-table tbody tr:hover {
    background: #e2e3de;
}

.loading,
.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

@media print {

    .report-filters,
    .export-buttons,
    .search-bar {
        display: none;
    }

    .report-table-container {
        box-shadow: none;
    }
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .export-buttons {
        flex-wrap: wrap;
    }
}
/* Medication Report Styles */
.medication-card {
    @apply bg-white border border-gray-200 rounded-lg shadow-sm overflow-hidden;
}

.medication-header {
    @apply bg-purple-800 text-white p-4;
}

.medication-grid {
    @apply grid grid-cols-1 lg:grid-cols-3 gap-6;
}

.medication-column {
    @apply space-y-2;
}

.medication-item {
    @apply text-sm p-2 rounded border;
}

.medication-item-administered {
    @apply bg-green-50 border-green-100;
}

.medication-item-not-administered {
    @apply bg-yellow-50 border-yellow-200;
}

@media (max-width: 1024px) {
    .medication-grid {
        @apply grid-cols-1;
    }
}

@media (max-width: 640px) {
    .medication-header {
        @apply text-sm;
    }
    
    .medication-item {
        @apply text-xs;
    }
}
/* ... Keep all your existing CSS ...
reportz-medication-header reportz-medication-header-global
reportz-batch-signoff-container
*/

/* Medication Report Styles - with reportz- prefix */
.reportz-medication-reports-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reportz-medication-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.reportz-medication-header {
    background: #002060;
    color: white;
    padding: 5px;
}

/* FIX: this header used to render once per visit card (repeating the purple
reportz-medication-info reportz-medication-info-clickable
   banner for every medication row). It now renders once for the whole report,
   sitting above the list of cards, so it needs its own top/bottom radius and
   spacing instead of relying on the card's overflow:hidden to round its corners. */
.reportz-medication-header-global {
    border-radius: 8px 8px 0 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}

/* Keeps the single header visually joined to the first card below it,
   instead of leaving the default 20px gap from reportz-medication-reports-container. */
.reportz-medication-reports-container {
    margin-top: 0;
}

.reportz-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
}

.reportz-medication-header h3 {
    margin:5px;
    font-size: 20px;
    font-weight: bold;
}

.reportz-medication-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.reportz-header-address {
    text-align: right;
    font-size: 13px;
}

.reportz-medication-info {
    background: #f9fafb;
    padding: 5px;
    border-bottom: 1px solid #e5e7eb;
}

/* Accordion header - the whole info bar is now clickable to expand/collapse */
.reportz-medication-info-clickable {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    transition: background 0.15s;
}

.reportz-medication-info-clickable:hover {
    background: #f3f4f6;
}

.reportz-medication-info-clickable .reportz-info-grid {
    flex: 1;
}

.reportz-card-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.reportz-status-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.reportz-status-ok {
    background: #dcfce7;
    color: #166534;
}

.reportz-status-warning {
    background: #fef3c7;
    color: #92400e;
}

.reportz-status-alert {
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 700;
}

.reportz-card-chevron {
    font-size: 14px;
    color: #6b7280;
    transition: transform 0.2s;
    display: inline-block;
}

.reportz-card-chevron-open {
    transform: rotate(180deg);
}

/* Card gets a bold red border/tint when it has a not-administered medication
   with no reason logged yet - visible even while collapsed */
.reportz-medication-card.reportz-card-alert {
    border: 2px solid #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15);
}

.reportz-medication-card.reportz-card-alert .reportz-medication-info {
    background: #fef2f2;
}

.reportz-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.reportz-info-item {
    display: flex;
    flex-direction: row;
    gap: 3px;
}

.reportz-info-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.reportz-info-value {
    font-size: 14px;
    color: #111827;
    font-weight: 600;
}

.reportz-day-name {
    margin-left: 8px;
    color: #9ca3af;
    font-weight: normal;
}

.reportz-medication-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 5px;
}

/* When collapsed, only the column titles render (no list underneath) -
   trims the padding so the row stays compact instead of leaving a gap
   below empty titles. */
.reportz-column-title {
    margin-bottom: 0;
}

@media (max-width: 1024px) {
    .reportz-medication-grid {
        grid-template-columns: 1fr;
    }
}

.reportz-medication-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reportz-column-title {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    padding-bottom: 8px;
    border-bottom: 2px solid;
    margin: 0;
}

.reportz-administered-title {
    color: #166534;
    border-color: #bbf7d0;
}

.reportz-not-administered-title {
    color: #b45309;
    border-color: #fde68a;
}

.reportz-notes-title {
    color: #1e40af;
    border-color: #bfdbfe;
}

.reportz-medication-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reportz-medication-item {
    padding: 12px;
    border-radius: 6px;
    border: 1px solid;
    font-size: 14px;
}

.reportz-medication-item.reportz-administered {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.reportz-medication-item.reportz-not-administered {
    background: #fefce8;
    border-color: #fde68a;
}

.reportz-med-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.reportz-med-info {
    flex: 1;
}

.reportz-med-name {
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.reportz-med-detail {
    font-size: 13px;
    color: #6b7280;
    margin: 2px 0;
}

.reportz-btn-comment {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.reportz-btn-comment:hover {
    background: #1d4ed8;
}

.reportz-med-comments-preview {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #fde68a;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reportz-comments-count {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 6px 0;
}

.reportz-comment-preview {
    font-size: 12px;
    color: #6b7280;
    margin: 4px 0;
}

/* Saved reasons shown inline under a not-administered medication (audit view) */
.reportz-inline-saved-reason {
    background: white;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 8px 10px;
}

.reportz-inline-saved-reason-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.reportz-inline-saved-reason-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.reportz-btn-edit-inline,
.reportz-btn-delete-inline {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.reportz-btn-edit-inline {
    color: #2563eb;
    border-color: #bfdbfe;
}

.reportz-btn-edit-inline:hover {
    background: #eff6ff;
}

.reportz-btn-delete-inline {
    color: #dc2626;
    border-color: #fecaca;
}

.reportz-btn-delete-inline:hover {
    background: #fef2f2;
}

.reportz-inline-saved-reason .reportz-comment-note {
    font-size: 13px;
    color: #374151;
}

/* Inline reason/comment form - opens directly under the medication row */
.reportz-inline-comment-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #fde68a;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reportz-inline-form-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.reportz-form-input-inline,
.reportz-form-select-inline,
.reportz-form-textarea-inline {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: white;
}

.reportz-form-input-inline {
    flex: 1;
    min-width: 140px;
}

.reportz-form-select-inline {
    min-width: 150px;
}

.reportz-form-textarea-inline {
    width: 100%;
    resize: vertical;
    min-height: 50px;
}

.reportz-form-input-inline:focus,
.reportz-form-select-inline:focus,
.reportz-form-textarea-inline:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.reportz-inline-form-actions {
    display: flex;
    gap: 8px;
}

.reportz-btn-save-inline,
.reportz-btn-cancel-inline {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.reportz-btn-save-inline {
    background: #2563eb;
    color: white;
}

.reportz-btn-save-inline:hover {
    background: #1d4ed8;
}

.reportz-btn-save-inline:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

.reportz-btn-cancel-inline {
    background: #e5e7eb;
    color: #374151;
}

.reportz-btn-cancel-inline:hover {
    background: #d1d5db;
}

.reportz-notes-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reportz-note-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reportz-note-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    margin: 0;
}

.reportz-note-text {
    font-size: 14px;
    color: #111827;
    margin: 0;
    white-space: pre-wrap;
}

.reportz-no-data {
    color: #9ca3af;
    font-style: italic;
    font-size: 14px;
}

/* Modal Styles */
.reportz-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.reportz-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.reportz-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.reportz-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #111827;
}

.reportz-existing-comments {
    padding: 15px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    max-height: 200px;
    overflow-y: auto;
}

.reportz-existing-comments h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #374151;
    font-weight: 600;
}

.reportz-comment-item {
    padding: 10px;
    background: white;
    border-radius: 4px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
}

.reportz-comment-item:last-child {
    margin-bottom: 0;
}

.reportz-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.reportz-comment-author {
    font-weight: 600;
    font-size: 13px;
    color: #111827;
}

.reportz-comment-date {
    font-size: 12px;
    color: #9ca3af;
}

.reportz-comment-reason {
    margin-bottom: 6px;
}

.reportz-reason-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.reportz-comment-note {
    margin: 0;
    font-size: 13px;
    color: #4b5563;
    white-space: pre-wrap;
}

.reportz-form-group {
    padding: 15px 20px;
}

.reportz-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.reportz-form-input,
.reportz-form-select,
.reportz-form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.reportz-form-input:focus,
.reportz-form-select:focus,
.reportz-form-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.reportz-form-textarea {
    resize: vertical;
    min-height: 80px;
}

.reportz-modal-actions {
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

.reportz-btn-save,
.reportz-btn-cancel {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.reportz-btn-save {
    background: #2563eb;
    color: white;
}

.reportz-btn-save:hover {
    background: #1d4ed8;
}

.reportz-btn-cancel {
    background: #e5e7eb;
    color: #374151;
}

.reportz-btn-cancel:hover {
    background: #d1d5db;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .reportz-header-content {
        flex-direction: column;
    }
    
    .reportz-header-address {
        text-align: left;
    }
    
    .reportz-med-header {
        flex-direction: column;
    }
    
    .reportz-btn-comment {
        align-self: flex-start;
    }
}
/* ... Keep all your existing CSS ... */

/* Toast Notification Styles */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 400px;
    max-width: 600px;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: slideInRight 0.4s ease-out;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toast-icon {
    font-size: 24px;
    line-height: 1;
}

.toast-message {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
}

.toast-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* MOD Feedback Banner Styles */
.reportz-mod-feedback-banner {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.reportz-mod-feedback-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: bold;
    color: #856404;
}

.reportz-mod-feedback-text {
    margin: 0 0 10px 0;
    white-space: pre-wrap;
    line-height: 1.6;
    color: #856404;
    font-size: 15px;
}

.reportz-mod-feedback-author {
    margin: 0;
    font-size: 14px;
    font-style: italic;
    color: #856404;
}

/* Locked and Signed Off Badges */
.reportz-locked-badge {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 4px;
}

.reportz-signed-off-badge {
    font-size: 0.8em;
    color: #28a745;
    font-weight: bold;
}

/* Sign-off Container Styles */
.reportz-batch-signoff-container {
    margin-top: 20px;
    padding: 20px;
    border: 2px solid #002060;
    border-radius: 8px;
    background-color: #f0fff4;
}

.reportz-signoff-title {
    margin-top: 0;
    color: #002060;
    font-size: 18px;
    font-weight: bold;
}

.reportz-signoff-loading {
    color: #666;
    font-style: italic;
}

.reportz-signoff-confirmed {
    color: #155724;
}

.reportz-signoff-status {
    margin: 0;
    font-size: 1.1em;
}

.reportz-signoff-date {
    margin: 5px 0 0 0;
    font-size: 0.9em;
    color: #002060;
}

.reportz-signoff-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reportz-signoff-warning {
    color: #002060;
    font-size: 0.95em;
    margin: 0;
    font-weight: bold;
}

.reportz-feedback-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reportz-feedback-label {
    display: block;
    font-weight: bold;
    color: #002060;
    font-size: 14px;
}

.reportz-feedback-textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #002060;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.reportz-feedback-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.reportz-feedback-hint {
    font-size: 0.85em;
    color: #666;
    margin: 0;
}

.reportz-confirm-btn {
    background-color: #002060;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    width: 100%;
    transition: background-color 0.2s;
}

.reportz-confirm-btn:hover:not(:disabled) {
    background-color: #001a4d;
}

.reportz-confirm-btn-disabled {
    background-color: #ccc !important;
    cursor: not-allowed !important;
}

@media (max-width: 640px) {
    .toast-notification {
        min-width: calc(100% - 40px);
        left: 20px;
        right: 20px;
    }
}/* ═══════════════════════════════════════════════════════════
   Rota break indicator
   A quiet, warm "gap" between two calls. It sits behind the
   call blocks visually: soft colours, thin border, small type.
   Three tiers by length: short (<30m), medium, long (90m+).
═══════════════════════════════════════════════════════════ */

.rota-break {
  --rb-ink: #8a5a0b;
  --rb-icon: #b7791f;
  --rb-border: #efd59b;
  --rb-bg: linear-gradient(180deg, #fffaec 0%, #fff2d2 100%);

  position: absolute;
  top: 28px;
  height: 28px;
  z-index: 6;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 6px;
  border: 1px solid var(--rb-border);
  border-radius: 8px;
  background: var(--rb-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(138, 90, 11, 0.12);
  color: var(--rb-ink);
  cursor: default;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;

  /* lets the label adapt to how wide this particular break is */
  container-type: inline-size;
  container-name: rbreak;
}

.rota-break:hover {
  border-color: #e3b95c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 3px 8px rgba(138, 90, 11, 0.22);
}

.rota-break-inner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}

.rota-break-icon { flex-shrink: 0; color: var(--rb-icon); }

.rota-break-label {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 10.5px;
  line-height: 1;
  white-space: nowrap;
}
.rota-break-word { font-weight: 600; opacity: 0.85; }
.rota-break-duration { font-weight: 800; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }

/* ── Tiers ── */
.rota-break.is-short {
  --rb-bg: #fffbf1;
  --rb-border: #f0dfb4;
  border-style: dashed;
  box-shadow: none;
}

.rota-break.is-long {
  --rb-bg:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.35) 0 6px,
      rgba(255, 255, 255, 0) 6px 12px
    ),
    linear-gradient(180deg, #fff3d1 0%, #fde8ab 100%);
  --rb-border: #e6bd62;
  --rb-ink: #7a4d07;
}

/* ── Responsive label (based on the width of each break) ── */
@container rbreak (max-width: 92px) {
  .rota-break-word { display: none; }          /* "Break 1h" -> "1h" */
}
@container rbreak (max-width: 54px) {
  .rota-break-label { display: none; }         /* icon only */
}
@container rbreak (max-width: 24px) {
  .rota-break-icon { display: none; }          /* too small for anything: just a tinted marker */
}

@media (prefers-reduced-motion: reduce) {
  .rota-break { transition: none; }
}/* ═══════════════════════════════════════════════════════════
   Rota staff cell (left column of each carer row)
   Layout:  [avatar]  Name  [Day off / Annual leave / Break]
                      16 calls · 10h 45m          [call][email]
   The name always gets the full width of the text column.
═══════════════════════════════════════════════════════════ */

/* Three-class selector so it wins over the old .staff-name-cell rules */
.staff-grid-row .staff-name-cell.rota-staff-cell {
  --rs-ink: #1d2330;
  --rs-muted: #667085;
  --rs-faint: #98a2b3;
  --rs-line: #e4e7ec;
  --rs-accent: #9d1f63;

  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  min-height: 62px;
  padding: 6px 8px 6px 12px;
  box-sizing: border-box;
  overflow: hidden;
}

.staff-grid-row .staff-name-cell.rota-staff-cell.is-special { background: #f7f8fc; }

/* status strip on the left edge */
.rota-staff-cell.is-dayoff::before,
.rota-staff-cell.is-holiday::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}
.rota-staff-cell.is-dayoff::before { background: #e5484d; }
.rota-staff-cell.is-holiday::before { background: #f59e0b; }

/* ── Avatar ── */
.rota-staff-avatar-wrap { position: relative; flex-shrink: 0; width: 36px; height: 36px; }

.rota-staff-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--rs-line, #e4e7ec);
}
.rota-staff-avatar.is-photo { object-fit: cover; background: #eaecf0; }
.rota-staff-avatar.is-initials { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; }
.rota-staff-avatar.is-special {
  background: #e8eaf6;
  color: #3f4a8a;
  border-radius: 10px;
  box-shadow: none;
}

/* ── Name + stats ── */
.rota-staff-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Name + status chip: they wrap onto two lines instead of squeezing the name */
.rota-staff-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  min-width: 0;
}

.rota-staff-name {
  display: block;
  max-width: 100%;
  max-height: 2.4em;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.2;
  color: var(--rs-ink, #1d2330);
  text-align: left;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.rota-staff-name.is-long { font-size: 0.74rem; }
.rota-staff-name:hover { color: var(--rs-accent, #9d1f63); text-decoration: underline; text-underline-offset: 3px; }
.rota-staff-name:focus-visible { outline: 2px solid var(--rs-accent, #9d1f63); outline-offset: 2px; border-radius: 4px; }

.rota-staff-chip {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.rota-staff-chip.is-dayoff { background: #fdecec; color: #b42318; border: 1px solid #f4b6b0; }
.rota-staff-chip.is-holiday { background: #fff4e0; color: #a15c07; border: 1px solid #f3d08f; }

.rota-staff-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

.rota-staff-stats {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 0.68rem;
  color: var(--rs-muted, #667085);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rota-staff-stat strong { color: #344054; font-weight: 600; }
.rota-staff-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--rs-faint, #98a2b3); flex-shrink: 0; }

/* ── Actions (small, sit on the stats line) ── */
.rota-staff-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.staff-grid-row:hover .rota-staff-actions,
.rota-staff-actions:focus-within { opacity: 1; }

.rota-staff-action {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--rs-muted, #667085);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.rota-staff-action.is-call:hover:not(:disabled) { background: #e7f6ee; color: #157347; }
.rota-staff-action.is-mail:hover:not(:disabled) { background: #e8f1ff; color: #1d4ed8; }
.rota-staff-action:focus-visible { outline: 2px solid var(--rs-accent, #9d1f63); outline-offset: 1px; }
.rota-staff-action:disabled { opacity: 0.35; cursor: not-allowed; }

/* Touch screens: no hover, bigger tap targets */
@media (hover: none) {
  .rota-staff-actions { opacity: 1; }
  .rota-staff-action { width: 28px; height: 28px; }
}

@media (max-width: 767px) {
  .staff-grid-row .staff-name-cell.rota-staff-cell { gap: 7px; padding: 6px 6px 6px 10px; }
  .rota-staff-avatar-wrap, .rota-staff-avatar { width: 32px; height: 32px; }
  .rota-staff-name { font-size: 0.8rem; }
  .rota-staff-name.is-long { font-size: 0.72rem; }
  .rota-staff-stats { font-size: 0.68rem; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .rota-staff-actions, .rota-staff-action { transition: none; }
}

/* ── Overtime States ── */
.rota-staff-cell.is-overtime {
    background: linear-gradient(90deg, rgba(255, 152, 0, 0.08) 0%, rgba(255, 152, 0, 0.02) 100%);
    border-left: 3px solid #910778;
}

.rota-staff-chip.is-overtime {
    background: #fff4e0;
    color: #910778;
    border: 1px solid #f3d08f;
    font-weight: 700;
}

.rota-dayoff-bar.is-overtime {
    background: rgba(185, 3, 161, 0.85); /* Magenta/Purple for Overtime */
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.rota-dayoff-bar.is-dayoff {
    background: rgba(13, 148, 136, 0.85); /* Teal for Day Off */
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.rota-dayoff-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  z-index: 1;              /* stays beneath call & training blocks */
  pointer-events: none;
  overflow: hidden;
  /* left & width now come from inline styles (segments) */
}

/* ═══════════════════════════════════════════════════════════
   ⚡ NEW UPDATES: Break Chip & Layout Safety Guards
═══════════════════════════════════════════════════════════ */

/* ── Break chip (now on the name line – can wrap, never overlaps) ── */
.rota-staff-chip.is-break {
    background: #fff7e6;
    color: #92400e;
    border: 1px solid #f3d08f;
}
.rota-staff-chip.is-break.is-ok {
    background: #e7f6ee;
    color: #157347;
    border: 1px solid #b7e2c9;
}

/* ── Safety guards: the stats line can NEVER collide with the buttons ── */
.rota-staff-bottom { gap: 6px; }
.rota-staff-stats { min-width: 0; overflow: hidden; }
.rota-staff-stat { flex-shrink: 0; }
.rota-staff-actions { margin-left: auto; flex-shrink: 0; }/* required styles */

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
	position: absolute;
	left: 0;
	top: 0;
	}
.leaflet-container {
	overflow: hidden;
	}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
	-webkit-user-select: none;
	   -moz-user-select: none;
	        user-select: none;
	  -webkit-user-drag: none;
	}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
	background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
	image-rendering: -webkit-optimize-contrast;
	}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
	width: 1600px;
	height: 1600px;
	-webkit-transform-origin: 0 0;
	}
.leaflet-marker-icon,
.leaflet-marker-shadow {
	display: block;
	}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg {
	max-width: none !important;
	max-height: none !important;
	}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
	max-width: none !important;
	max-height: none !important;
	width: auto;
	padding: 0;
	}

.leaflet-container img.leaflet-tile {
	/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
	mix-blend-mode: plus-lighter;
}

.leaflet-container.leaflet-touch-zoom {
	-ms-touch-action: pan-x pan-y;
	touch-action: pan-x pan-y;
	}
.leaflet-container.leaflet-touch-drag {
	-ms-touch-action: pinch-zoom;
	/* Fallback for FF which doesn't support pinch-zoom */
	touch-action: none;
	touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
	-ms-touch-action: none;
	touch-action: none;
}
.leaflet-container {
	-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
	-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
	filter: inherit;
	visibility: hidden;
	}
.leaflet-tile-loaded {
	visibility: inherit;
	}
.leaflet-zoom-box {
	width: 0;
	height: 0;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	z-index: 800;
	}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
	-moz-user-select: none;
	}

.leaflet-pane         { z-index: 400; }

.leaflet-tile-pane    { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane  { z-index: 500; }
.leaflet-marker-pane  { z-index: 600; }
.leaflet-tooltip-pane   { z-index: 650; }
.leaflet-popup-pane   { z-index: 700; }

.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg    { z-index: 200; }

.leaflet-vml-shape {
	width: 1px;
	height: 1px;
	}
.lvml {
	behavior: url(#default#VML);
	display: inline-block;
	position: absolute;
	}


/* control positioning */

.leaflet-control {
	position: relative;
	z-index: 800;
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}
.leaflet-top,
.leaflet-bottom {
	position: absolute;
	z-index: 1000;
	pointer-events: none;
	}
.leaflet-top {
	top: 0;
	}
.leaflet-right {
	right: 0;
	}
.leaflet-bottom {
	bottom: 0;
	}
.leaflet-left {
	left: 0;
	}
.leaflet-control {
	float: left;
	clear: both;
	}
.leaflet-right .leaflet-control {
	float: right;
	}
.leaflet-top .leaflet-control {
	margin-top: 10px;
	}
.leaflet-bottom .leaflet-control {
	margin-bottom: 10px;
	}
.leaflet-left .leaflet-control {
	margin-left: 10px;
	}
.leaflet-right .leaflet-control {
	margin-right: 10px;
	}


/* zoom and fade animations */

.leaflet-fade-anim .leaflet-popup {
	opacity: 0;
	-webkit-transition: opacity 0.2s linear;
	   -moz-transition: opacity 0.2s linear;
	        transition: opacity 0.2s linear;
	}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
	opacity: 1;
	}
.leaflet-zoom-animated {
	-webkit-transform-origin: 0 0;
	    -ms-transform-origin: 0 0;
	        transform-origin: 0 0;
	}
svg.leaflet-zoom-animated {
	will-change: transform;
}

.leaflet-zoom-anim .leaflet-zoom-animated {
	-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
	   -moz-transition:    -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
	        transition:         transform 0.25s cubic-bezier(0,0,0.25,1);
	}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
	-webkit-transition: none;
	   -moz-transition: none;
	        transition: none;
	}

.leaflet-zoom-anim .leaflet-zoom-hide {
	visibility: hidden;
	}


/* cursors */

.leaflet-interactive {
	cursor: pointer;
	}
.leaflet-grab {
	cursor: -webkit-grab;
	cursor:    -moz-grab;
	cursor:         grab;
	}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
	cursor: crosshair;
	}
.leaflet-popup-pane,
.leaflet-control {
	cursor: auto;
	}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
	cursor: move;
	cursor: -webkit-grabbing;
	cursor:    -moz-grabbing;
	cursor:         grabbing;
	}

/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
	pointer-events: none;
	}

.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}

/* visual tweaks */

.leaflet-container {
	background: #ddd;
	outline-offset: 1px;
	}
.leaflet-container a {
	color: #0078A8;
	}
.leaflet-zoom-box {
	border: 2px dotted #38f;
	background: rgba(255,255,255,0.5);
	}


/* general typography */
.leaflet-container {
	font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-size: 0.75rem;
	line-height: 1.5;
	}


/* general toolbar styles */

.leaflet-bar {
	box-shadow: 0 1px 5px rgba(0,0,0,0.65);
	border-radius: 4px;
	}
.leaflet-bar a {
	background-color: #fff;
	border-bottom: 1px solid #ccc;
	width: 26px;
	height: 26px;
	line-height: 26px;
	display: block;
	text-align: center;
	text-decoration: none;
	color: black;
	}
.leaflet-bar a,
.leaflet-control-layers-toggle {
	background-position: 50% 50%;
	background-repeat: no-repeat;
	display: block;
	}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
	background-color: #f4f4f4;
	}
.leaflet-bar a:first-child {
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
	}
.leaflet-bar a:last-child {
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
	border-bottom: none;
	}
.leaflet-bar a.leaflet-disabled {
	cursor: default;
	background-color: #f4f4f4;
	color: #bbb;
	}

.leaflet-touch .leaflet-bar a {
	width: 30px;
	height: 30px;
	line-height: 30px;
	}
.leaflet-touch .leaflet-bar a:first-child {
	border-top-left-radius: 2px;
	border-top-right-radius: 2px;
	}
.leaflet-touch .leaflet-bar a:last-child {
	border-bottom-left-radius: 2px;
	border-bottom-right-radius: 2px;
	}

/* zoom control */

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
	font: bold 18px 'Lucida Console', Monaco, monospace;
	text-indent: 1px;
	}

.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out  {
	font-size: 22px;
	}


/* layers control */

.leaflet-control-layers {
	box-shadow: 0 1px 5px rgba(0,0,0,0.4);
	background: #fff;
	border-radius: 5px;
	}
.leaflet-control-layers-toggle {
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);
	width: 36px;
	height: 36px;
	}
.leaflet-retina .leaflet-control-layers-toggle {
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);
	background-size: 26px 26px;
	}
.leaflet-touch .leaflet-control-layers-toggle {
	width: 44px;
	height: 44px;
	}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
	display: none;
	}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
	display: block;
	position: relative;
	}
.leaflet-control-layers-expanded {
	padding: 6px 10px 6px 6px;
	color: #333;
	background: #fff;
	}
.leaflet-control-layers-scrollbar {
	overflow-y: scroll;
	overflow-x: hidden;
	padding-right: 5px;
	}
.leaflet-control-layers-selector {
	margin-top: 2px;
	position: relative;
	top: 1px;
	}
.leaflet-control-layers label {
	display: block;
	font-size: 13px;
	font-size: 1.08333em;
	}
.leaflet-control-layers-separator {
	height: 0;
	border-top: 1px solid #ddd;
	margin: 5px -10px 5px -6px;
	}

/* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=);
	}


/* attribution and scale controls */

.leaflet-container .leaflet-control-attribution {
	background: #fff;
	background: rgba(255, 255, 255, 0.8);
	margin: 0;
	}
.leaflet-control-attribution,
.leaflet-control-scale-line {
	padding: 0 5px;
	color: #333;
	line-height: 1.4;
	}
.leaflet-control-attribution a {
	text-decoration: none;
	}
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
	text-decoration: underline;
	}
.leaflet-attribution-flag {
	display: inline !important;
	vertical-align: baseline !important;
	width: 1em;
	height: 0.6669em;
	}
.leaflet-left .leaflet-control-scale {
	margin-left: 5px;
	}
.leaflet-bottom .leaflet-control-scale {
	margin-bottom: 5px;
	}
.leaflet-control-scale-line {
	border: 2px solid #777;
	border-top: none;
	line-height: 1.1;
	padding: 2px 5px 1px;
	white-space: nowrap;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	background: rgba(255, 255, 255, 0.8);
	text-shadow: 1px 1px #fff;
	}
.leaflet-control-scale-line:not(:first-child) {
	border-top: 2px solid #777;
	border-bottom: none;
	margin-top: -2px;
	}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
	border-bottom: 2px solid #777;
	}

.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	box-shadow: none;
	}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	border: 2px solid rgba(0,0,0,0.2);
	background-clip: padding-box;
	}


/* popup */

.leaflet-popup {
	position: absolute;
	text-align: center;
	margin-bottom: 20px;
	}
.leaflet-popup-content-wrapper {
	padding: 1px;
	text-align: left;
	border-radius: 12px;
	}
.leaflet-popup-content {
	margin: 13px 24px 13px 20px;
	line-height: 1.3;
	font-size: 13px;
	font-size: 1.08333em;
	min-height: 1px;
	}
.leaflet-popup-content p {
	margin: 17px 0;
	margin: 1.3em 0;
	}
.leaflet-popup-tip-container {
	width: 40px;
	height: 20px;
	position: absolute;
	left: 50%;
	margin-top: -1px;
	margin-left: -20px;
	overflow: hidden;
	pointer-events: none;
	}
.leaflet-popup-tip {
	width: 17px;
	height: 17px;
	padding: 1px;

	margin: -10px auto 0;
	pointer-events: auto;

	-webkit-transform: rotate(45deg);
	   -moz-transform: rotate(45deg);
	    -ms-transform: rotate(45deg);
	        transform: rotate(45deg);
	}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
	background: white;
	color: #333;
	box-shadow: 0 3px 14px rgba(0,0,0,0.4);
	}
.leaflet-container a.leaflet-popup-close-button {
	position: absolute;
	top: 0;
	right: 0;
	border: none;
	text-align: center;
	width: 24px;
	height: 24px;
	font: 16px/24px Tahoma, Verdana, sans-serif;
	color: #757575;
	text-decoration: none;
	background: transparent;
	}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
	color: #585858;
	}
.leaflet-popup-scrolled {
	overflow: auto;
	}

.leaflet-oldie .leaflet-popup-content-wrapper {
	-ms-zoom: 1;
	}
.leaflet-oldie .leaflet-popup-tip {
	width: 24px;
	margin: 0 auto;

	-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
	filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
	}

.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
	border: 1px solid #999;
	}


/* div icon */

.leaflet-div-icon {
	background: #fff;
	border: 1px solid #666;
	}


/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
	position: absolute;
	padding: 6px;
	background-color: #fff;
	border: 1px solid #fff;
	border-radius: 3px;
	color: #222;
	white-space: nowrap;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	pointer-events: none;
	box-shadow: 0 1px 3px rgba(0,0,0,0.4);
	}
.leaflet-tooltip.leaflet-interactive {
	cursor: pointer;
	pointer-events: auto;
	}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	position: absolute;
	pointer-events: none;
	border: 6px solid transparent;
	background: transparent;
	content: "";
	}

/* Directions */

.leaflet-tooltip-bottom {
	margin-top: 6px;
}
.leaflet-tooltip-top {
	margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
	left: 50%;
	margin-left: -6px;
	}
.leaflet-tooltip-top:before {
	bottom: 0;
	margin-bottom: -12px;
	border-top-color: #fff;
	}
.leaflet-tooltip-bottom:before {
	top: 0;
	margin-top: -12px;
	margin-left: -6px;
	border-bottom-color: #fff;
	}
.leaflet-tooltip-left {
	margin-left: -6px;
}
.leaflet-tooltip-right {
	margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	top: 50%;
	margin-top: -6px;
	}
.leaflet-tooltip-left:before {
	right: 0;
	margin-right: -12px;
	border-left-color: #fff;
	}
.leaflet-tooltip-right:before {
	left: 0;
	margin-left: -12px;
	border-right-color: #fff;
	}

/* Printing */

@media print {
	/* Prevent printers from removing background-images of controls. */
	.leaflet-control {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
		}
	}
/* LocationDetailsModal.css – two-column, fits the screen, fully self-contained (ldm-*) */

.ldm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* keep the desktop status bar visible underneath */
  bottom: var(--statusbar-height, 0px);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ldm-overlay *, .ldm-overlay *::before, .ldm-overlay *::after { box-sizing: border-box; }

.ldm-modal {
  --ldm-accent: #10b981;
  --ink: #1b2430;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f6f8fc;

  display: flex;
  flex-direction: column;
  width: min(1040px, 100%);
  max-height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.4);
  animation: ldmPop .15s ease-out;
}

@keyframes ldmPop {
  from { transform: scale(.97); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ---------- Header ---------- */
.ldm-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(160deg, #002060 0%, #0a3190 100%);
  color: #fff;
  border-bottom: 3px solid var(--ldm-accent);
}

.ldm-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ldm-accent);
  color: #fff;
  flex: 0 0 auto;
}

.ldm-head-text { flex: 1 1 auto; min-width: 0; }
.ldm-head-text h3 { margin: 0; font-size: 15.5px; font-weight: 700; color: #fff; }
.ldm-head-text p { margin: 2px 0 0; font-size: 12px; color: #c9d6f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ldm-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  cursor: pointer;
  flex: 0 0 auto;
}
.ldm-close:hover { background: rgba(255, 255, 255, .28); }

/* ---------- Body (two columns) ---------- */
.ldm-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  /* scrolling still works if a screen is very short, but no visible scroll bar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ldm-body::-webkit-scrollbar { display: none; width: 0; height: 0; }

.ldm-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* ---------- Map ---------- */
.ldm-map-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  isolation: isolate;
}

.ldm-map { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }

.ldm-legend {
  position: absolute;
  left: 10px;
  bottom: 22px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  pointer-events: none;
}

.ldm-legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: #334155; }
.ldm-legend-item i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); }

.ldm-overlay .custom-map-pin-wrapper { background: none; border: none; }

.ldm-overlay .ldm-distance-tooltip.leaflet-tooltip {
  background: #1e293b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.ldm-overlay .ldm-distance-tooltip.leaflet-tooltip::before { display: none; }

.ldm-nomap {
  flex: 1 1 auto;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: var(--bg);
  border: 1px dashed #cfd8e8;
  border-radius: 12px;
}
.ldm-nomap strong { color: var(--ink); font-size: 14px; }

.ldm-map-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-height: 22px; }

.ldm-coords { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.ldm-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #475467;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.ldm-copy:hover { background: var(--bg); }

.ldm-note { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.ldm-note-warn { color: #b45309; }

/* ---------- Status banner ---------- */
.ldm-banner {
  --tone: #64748b;
  --soft: #f1f5f9;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent);
  border-left: 4px solid var(--tone);
  border-radius: 10px;
  background: var(--soft);
}
.ldm-banner.is-verified { --tone: #16a34a; --soft: #f0fdf4; }
.ldm-banner.is-near     { --tone: #d97706; --soft: #fffbeb; }
.ldm-banner.is-far      { --tone: #dc2626; --soft: #fef2f2; }
.ldm-banner-icon { color: var(--tone); display: inline-flex; margin-top: 1px; }
.ldm-banner h4 { margin: 0 0 2px; font-size: 14px; font-weight: 700; color: var(--tone); }
.ldm-banner p { margin: 0; font-size: 12.5px; line-height: 1.5; color: #475467; }

/* ---------- Cards ---------- */
.ldm-card { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ldm-card-title { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }

.ldm-carers { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ldm-carers li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; background: var(--bg); }
.ldm-carers li.is-current { background: color-mix(in srgb, var(--ldm-accent) 10%, #fff); border: 1px solid color-mix(in srgb, var(--ldm-accent) 35%, transparent); }
.ldm-carer-name { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ldm-assigned { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.ldm-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ldm-accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.ldm-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  color: #fff;
  font-weight: 700;
}
.ldm-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Distance ---------- */
.ldm-distance {
  --tone: #16a34a;
  --soft: #f0fdf4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent);
  border-radius: 10px;
  background: var(--soft);
  color: var(--tone);
  font-size: 12.5px;
  line-height: 1.45;
}
.ldm-distance.tone-warn { --tone: #d97706; --soft: #fffbeb; }
.ldm-distance.tone-bad  { --tone: #dc2626; --soft: #fef2f2; }
.ldm-distance svg { flex: 0 0 auto; margin-top: 1px; }
.ldm-distance strong { font-weight: 800; }
.ldm-distance span { display: block; font-size: 12px; opacity: .9; }

/* ---------- Address + fields ---------- */
.ldm-address { margin: 0 0 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 13px; line-height: 1.5; }
.ldm-address-client { margin: 0; background: #eff6ff; border-color: #bfdbfe; }
.ldm-muted { margin: 0; font-size: 12.5px; color: var(--muted); }

.ldm-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ldm-field { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); min-width: 0; }
.ldm-field-label { font-size: 11px; font-weight: 600; color: var(--muted); }
.ldm-field-value { font-size: 13.5px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }

/* ---------- Skeletons ---------- */
.ldm-skel {
  border-radius: 8px;
  background: linear-gradient(90deg, #eef2f8 25%, #f7f9fc 50%, #eef2f8 75%);
  background-size: 200% 100%;
  animation: ldmShimmer 1.2s ease-in-out infinite;
}
.ldm-skel-banner { height: 64px; border-radius: 10px; }
.ldm-skel-line { height: 14px; margin-bottom: 8px; }
.ldm-skel-line.short { width: 60%; }
@keyframes ldmShimmer { to { background-position: -200% 0; } }

/* ---------- Footer ---------- */
.ldm-foot { display: flex; justify-content: flex-end; padding: 10px 16px; background: var(--bg); border-top: 1px solid var(--line); }

.ldm-btn {
  min-height: 34px;
  padding: 6px 22px;
  border: none;
  border-radius: 8px;
  background: var(--ldm-accent);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}
.ldm-btn:hover { filter: brightness(.93); transform: translateY(-1px); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .ldm-overlay { padding: 6px; align-items: flex-end; }
  .ldm-modal { width: 100%; border-radius: 14px 14px 8px 8px; }
  .ldm-body { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
  .ldm-map-wrap { flex: 0 0 auto; min-height: 260px; height: 260px; }
}

@media (max-width: 480px) {
  .ldm-fields { grid-template-columns: minmax(0, 1fr); }
  .ldm-head-text h3 { font-size: 14.5px; }
  .ldm-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ldm-modal, .ldm-skel { animation: none !important; }
}/* CallDetailsTab.css - Professional Compact Design, always fits the screen */

.call-details-tab.cdet-root {
    --cd-navy: #002060;
    --cd-ink: #1b2430;
    --cd-muted: #6b7686;
    --cd-line: #e4e8f1;
    --cd-surface: #fff;
    --cd-tint: #eef2fb;
    --cd-blue: #1650c7;
    --cd-green: #15803d;
    --cd-green-soft: #e6f5ec;
    --cd-amber: #b7790a;
    --cd-amber-soft: #fdf3dc;
    --cd-red: #c0392b;
    --cd-red-soft: #fdecea;
    --cd-indigo: #4f46e5;

    position: relative;
    width: 100%;
    max-width: 100%;
    /* height / max-height are set by useFitToScreen so the panel ends exactly at the screen bottom */
    max-height: 100dvh;
    min-height: 0;
    margin: 0;
    padding: 6px 8px 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    color: var(--cd-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;

    /* Hide scroll bars everywhere (scrolling still works by wheel/touch if a screen is tiny) */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.call-details-tab.cdet-root::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.call-details-tab.cdet-root > * {
    flex: 0 0 auto;
    min-width: 0;
}

.cdet-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 20px;
}

/* Toast */
.cdet-toast {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 12000;
    max-width: min(380px, calc(100vw - 20px));
    padding: 10px 14px;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16,24,40,.2);
    animation: cdetSlideIn .2s ease-out;
}

.cdet-toast.success { background: #10b981; }
.cdet-toast.error { background: #ef4444; }

@keyframes cdetSlideIn {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Hero Header - Compact */
.cdet-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #fff;
    background: radial-gradient(120% 140% at 100% 0%, rgba(232,32,218,.3) 0%, rgba(232,32,218,0) 55%), linear-gradient(160deg, #002060 0%, #0a3190 100%);
    box-shadow: 0 3px 10px rgba(0,32,96,.2);
}

.cdet-hero-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
}

.cdet-hero-time {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 17px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cdet-hero-duration {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.15);
    font-size: 11px;
    font-weight: 600;
}

.cdet-hero-client {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cdet-hero-client-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.cdet-hero-client-name {
    font-weight: 700;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.cdet-hero-client-postcode {
    font-size: 11.5px;
    color: #d5e0fb;
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 500;
}

.cdet-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}

.cdet-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.cdet-badge-red { background: #ef4444; }
.cdet-badge-green { background: #16a34a; }
.cdet-badge-amber { background: #f59e0b; color: #3b2a00; }

/* Alert */
.cdet-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--cd-amber-soft);
    border: 1px solid #f1d58a;
    border-left: 4px solid #f59e0b;
    color: #5c4100;
    font-size: 12.5px;
}

.cdet-alert svg { flex: 0 0 auto; margin-top: 1px; color: #d98b06; }
.cdet-alert div { display: flex; flex-direction: column; gap: 1px; }

/* Cards - Compact */
.cdet-card {
    background: var(--cd-surface);
    border: 1px solid var(--cd-line);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
    overflow: visible;
    flex-shrink: 0;
    min-width: 0;
}

.cdet-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    background: var(--cd-tint);
    border-bottom: 1px solid var(--cd-line);
    border-radius: 10px 10px 0 0;
}

.cdet-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--cd-navy);
}

.cdet-card-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #fff;
    color: var(--cd-navy);
    box-shadow: 0 1px 2px rgba(16,24,40,.08);
}

.cdet-card-body {
    padding: 10px;
}

/* Lower row: Carer Status + Options (side by side on wide screens) */
.cdet-lower {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

/* Form Grid */
.cdet-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px 12px;
}

.cdet-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cdet-label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--cd-muted);
}

.cdet-inline-flag {
    margin-left: auto;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--cd-red-soft);
    color: var(--cd-red);
    font-size: 10px;
    font-weight: 600;
}

.cdet-input {
    width: 100%;
    min-height: 34px;
    padding: 6px 10px;
    box-sizing: border-box;
    border: 1px solid #d4dbea;
    border-radius: 6px;
    background: #fff;
    color: var(--cd-ink);
    font-family: inherit;
    font-size: 13px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.cdet-input:focus {
    outline: none;
    border-color: #3b6cf0;
    box-shadow: 0 0 0 2px rgba(59,108,240,.15);
}

.cdet-input:disabled,
.cdet-input[readonly] {
    background: #f4f6fb;
    color: #536074;
    cursor: not-allowed;
}

.cdet-input[readonly] { cursor: default; }

/* Notes box scales with screen height instead of a fixed 150px */
.cdet-textarea {
    height: clamp(64px, 14vh, 150px);
    min-height: 64px;
    resize: none;
    line-height: 1.4;
}

/* Textareas inside modals keep a comfortable fixed size */
.cdet-modal .cdet-textarea {
    height: 90px;
    resize: vertical;
}

.cdet-inline {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.cdet-inline .cdet-input { flex: 1 1 auto; min-width: 0; }
.cdet-hint { font-size: 11px; color: var(--cd-muted); }

/* Buttons - Compact */
.cdet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 32px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease;
}

.cdet-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(16,24,40,.15);
}

.cdet-btn:disabled { opacity: .5; cursor: not-allowed; }

.cdet-btn-sm {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 5px;
}

.cdet-btn-primary { background: #1650c7; color: #fff; }
.cdet-btn-primary:hover:not(:disabled) { background: #1243a8; }

.cdet-btn-success { background: #10b981; color: #fff; }
.cdet-btn-success:hover:not(:disabled) { background: #0b9669; }

.cdet-btn-indigo { background: var(--cd-indigo); color: #fff; }
.cdet-btn-indigo:hover:not(:disabled) { background: #3f38c9; }

.cdet-btn-dark { background: #475467; color: #fff; }
.cdet-btn-dark:hover:not(:disabled) { background: #36404f; }

.cdet-btn-danger { background: #dc2626; color: #fff; }
.cdet-btn-danger:hover:not(:disabled) { background: #b91c1c; }

.cdet-btn-ghost { background: #eef1f7; color: #344054; }
.cdet-btn-ghost:hover:not(:disabled) { background: #e1e6f0; }

.cdet-spin { animation: cdetSpin .8s linear infinite; }

@keyframes cdetSpin {
    to { transform: rotate(360deg); }
}

/* Carer Cards - Compact */
.cdet-carers {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.cdet-carer {
    --accent: #cbd3e4;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--cd-line);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    background: #fff;
    flex-shrink: 0;
}

.cdet-carer.is-in { --accent: #3b82f6; background: #f5f9ff; }
.cdet-carer.is-out { --accent: #10b981; background: #f3fbf7; }

.cdet-carer-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cdet-carer-id {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 100px;
}

.cdet-carer-id strong { font-size: 13.5px; line-height: 1.2; }
.cdet-carer-id span { font-size: 11px; color: var(--cd-muted); font-weight: 500; }

.cdet-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    background: #eef0f5;
    color: #55607a;
}

.cdet-status.is-in { background: #dbeafe; color: #1d4ed8; }
.cdet-status.is-out { background: #d1fae5; color: #047857; }

.cdet-times {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,.7);
    border: 1px dashed var(--cd-line);
}

.cdet-time-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cdet-time-label {
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--cd-tint);
    color: var(--cd-navy);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.cdet-time-value {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cdet-pin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 5px;
    background: #eaf0fd;
    color: #1650c7;
    cursor: pointer;
}

.cdet-pin:hover { background: #d6e3fb; }

.cdet-carer-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cdet-empty {
    margin: 0;
    padding: 12px;
    text-align: center;
    font-style: italic;
    color: var(--cd-muted);
    background: #f7f9fc;
    border: 1px dashed #d6ddea;
    border-radius: 6px;
    font-size: 12.5px;
}

/* Toggles - Compact (no extra bottom margin hacks) */
.cdet-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
    margin: 0;
    margin-bottom: 30px;
}

.cdet-option {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cdet-toggle {
    --on: #1650c7;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    font-weight: 500;
    color: #344054;
    position: relative;
}

.cdet-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cdet-toggle-red { --on: #dc2626; }
.cdet-toggle-amber { --on: #f59e0b; }

.cdet-toggle-track {
    position: relative;
    flex: 0 0 auto;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #cfd6e4;
    transition: background-color .2s ease;
}

.cdet-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16,24,40,.25);
    transition: transform .2s ease;
}

.cdet-toggle.is-on .cdet-toggle-track { background: var(--on); }
.cdet-toggle.is-on .cdet-toggle-thumb { transform: translateX(16px); }
.cdet-toggle.is-on .cdet-toggle-label { color: var(--on); font-weight: 700; }

.cdet-toggle input:focus-visible + .cdet-toggle-track {
    box-shadow: 0 0 0 2px rgba(59,108,240,.25);
}

.cdet-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Actions Bar */
.cdet-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f4f6fb;
    border: 1px solid var(--cd-line);
    margin: 0;
}

/* Avatar */
.cdet-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #dfe7f7, #f6d9f3);
    color: var(--cd-navy);
    font-weight: 700;
    letter-spacing: .01em;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #d5dcec;
    user-select: none;
}

.cdet-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Modals - Compact */
.cdet-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(15,23,42,.5);
    backdrop-filter: blur(2px);
}

.cdet-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    max-height: calc(100dvh - 24px);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15,23,42,.35);
    animation: cdetPop .15s ease-out;
}

@keyframes cdetPop {
    from { transform: scale(.97); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.cdet-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(160deg, #002060 0%, #0a3190 100%);
    color: #fff;
}

.cdet-modal-head h3 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
}

.cdet-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    color: #fff;
    cursor: pointer;
}

.cdet-modal-close:hover { background: rgba(255,255,255,.25); }

.cdet-modal-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    overflow-y: auto;
    min-height: 0;
}

.cdet-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 10px 14px;
    background: #f6f8fc;
    border-top: 1px solid var(--cd-line);
}

.cdet-modal-hint {
    margin: 0;
    font-size: 12px;
    color: var(--cd-muted);
}

/* Search in Modal */
.cdet-search-container { margin-bottom: 10px; }

.cdet-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cdet-search-icon {
    position: absolute;
    left: 10px;
    color: var(--cd-muted);
    pointer-events: none;
}

.cdet-search-input {
    width: 100%;
    padding: 8px 36px 8px 36px;
    border: 1px solid var(--cd-line);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    box-sizing: border-box;
}

.cdet-search-input:focus {
    outline: none;
    border-color: #3b6cf0;
    box-shadow: 0 0 0 2px rgba(59,108,240,.15);
}

.cdet-search-clear {
    position: absolute;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--cd-muted);
    cursor: pointer;
    border-radius: 4px;
}

.cdet-search-clear:hover {
    background: var(--cd-tint);
    color: var(--cd-navy);
}

.cdet-search-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--cd-muted);
}

.cdet-no-results {
    text-align: center;
    padding: 20px;
    color: var(--cd-muted);
    font-style: italic;
    font-size: 13px;
}

.cdet-carer-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: min(300px, 40dvh);
    overflow-y: auto;
    padding-right: 2px;
}

.cdet-pick {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--cd-line);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.cdet-pick:hover { background: #f6f8fc; }
.cdet-pick.is-selected { background: #eaf0fd; border-color: #1650c7; }

.cdet-pick input {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
}

.cdet-pick-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cdet-pick-text strong { font-size: 12.5px; line-height: 1.2; }
.cdet-pick-text small { font-size: 11px; color: var(--cd-muted); }

/* ---------- Wider screens ---------- */
@media (min-width: 640px) {
    .cdet-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cdet-field-wide { grid-column: 1 / -1; }
    .cdet-carers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
    .cdet-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cdet-field-wide { grid-column: span 3; }

    /* Carer Status | Options side by side to save vertical space */
    .cdet-lower { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
    .cdet-lower .cdet-carers { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1500px) {
    .cdet-lower .cdet-carers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================
   MOBILE
   ============================================ */

@media (max-width: 768px) {
    .call-details-tab.cdet-root {
        padding: 6px 6px 8px;
        gap: 6px;
    }

    .cdet-carers { grid-template-columns: 1fr; }

    .cdet-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .cdet-badges { justify-content: flex-start; }
}

@media (max-width: 640px) {
    .call-details-tab.cdet-root {
        padding: 4px 6px 6px;
        gap: 6px;
        font-size: 12.5px;
    }

    .cdet-hero { padding: 8px 10px; gap: 8px; }
    .cdet-hero-main { width: 100%; }
    .cdet-hero-time { font-size: 15px; gap: 5px; }
    .cdet-hero-client { gap: 8px; }
    .cdet-hero-client-name { font-size: 13px; max-width: 150px; }
    .cdet-hero-client-postcode { font-size: 11px; }
    .cdet-badges { width: 100%; justify-content: flex-start; }
    .cdet-badge { font-size: 10px; padding: 2px 6px; }

    .cdet-card { border-radius: 8px; }
    .cdet-card-head { padding: 6px 10px; }
    .cdet-card-body { padding: 8px; }

    .cdet-form-grid { grid-template-columns: 1fr; gap: 6px 8px; }
    .cdet-field-wide { grid-column: 1 / -1; }

    .cdet-input { font-size: 14px; min-height: 38px; padding: 7px 10px; }
    .cdet-textarea { height: clamp(56px, 12vh, 110px); min-height: 56px; }

    .cdet-inline { flex-wrap: wrap; }
    .cdet-inline .cdet-btn { flex: 1 1 100%; }

    .cdet-carer { padding: 8px; gap: 6px; }
    .cdet-carer-top { gap: 6px; }
    .cdet-carer-id { flex: 1 1 auto; min-width: 0; }
    .cdet-carer-id strong { font-size: 12.5px; }
    .cdet-status { font-size: 10.5px; padding: 2px 6px; }
    .cdet-times { gap: 5px 12px; padding: 5px 6px; }
    .cdet-time-value { font-size: 12px; }
    .cdet-carer-actions { width: 100%; }
    .cdet-carer-actions .cdet-btn { flex: 1 1 calc(50% - 3px); min-width: 0; }

    .cdet-options { flex-direction: column; align-items: stretch; gap: 8px; }

    .cdet-option {
        justify-content: space-between;
        padding: 6px 0;
        border-bottom: 1px solid var(--cd-line);
        width: 100%;
    }

    .cdet-option:last-child { border-bottom: 0; }
    .cdet-toggle-label { font-size: 12.5px; }
    .cdet-option .cdet-btn { margin-top: 4px; width: 100%; }

    .cdet-actions { padding: 6px 8px; justify-content: stretch; gap: 6px; }
    .cdet-actions .cdet-btn { flex: 1 1 calc(50% - 3px); min-width: 0; }

    .cdet-overlay { padding: 6px; align-items: flex-end; }

    .cdet-modal {
        max-width: none;
        border-radius: 12px 12px 8px 8px;
        max-height: calc(100dvh - 12px);
    }

    .cdet-modal-head { padding: 9px 12px; }
    .cdet-modal-head h3 { font-size: 13.5px; }
    .cdet-modal-body { padding: 10px; gap: 8px; }

    .cdet-modal-foot {
        flex-direction: column-reverse;
        padding: 8px 12px;
        gap: 6px;
    }

    .cdet-modal-foot .cdet-btn { width: 100%; }
    .cdet-carer-list { max-height: min(250px, 35dvh); }
    .cdet-pick { padding: 6px 8px; }
    .cdet-search-input { font-size: 14px; }
}

@media (max-width: 380px) {
    .call-details-tab.cdet-root { font-size: 12px; }
    .cdet-hero-time { font-size: 14px; }
    .cdet-hero-client-name { font-size: 12.5px; max-width: 120px; }
    .cdet-btn { font-size: 11.5px; padding: 5px 9px; }
    .cdet-btn-sm { min-height: 28px; padding: 3px 8px; font-size: 11px; }
    .cdet-carer-actions .cdet-btn,
    .cdet-actions .cdet-btn { flex: 1 1 100%; }
    .cdet-toggle-label { font-size: 12px; }
}

/* Short screens (small laptops, landscape phones): tighten spacing so it still fits */
@media (max-height: 800px) {
    .call-details-tab.cdet-root { gap: 6px; }
    .cdet-hero { padding: 7px 10px; }
    .cdet-hero-main { gap: 4px; }
    .cdet-card-body { padding: 8px; }
    .cdet-card-head { padding: 4px 10px; }
    .cdet-carer { padding: 8px; gap: 6px; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .cdet-modal { max-height: 95vh; }
    .cdet-modal-body { max-height: 50vh; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cdet-root *,
    .cdet-modal,
    .cdet-toast {
        animation: none !important;
        transition: none !important;
    }
}

/* Layout fixes - remove parent overflow conflicts and sideways scrolling */
:has(> .call-details-tab.cdet-root) {
    max-height: none !important;
    overflow: hidden !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.scroll-to-y:has(> .call-details-tab.cdet-root) {
    max-height: none !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

.call-details-tab.cdet-root,
.call-details-tab.cdet-root * {
    min-width: 0;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
    max-width: 100vw;
}/* ============================================
   CLIENT DETAILS TAB
   Everything is scoped under .cdt-root so it can't clash with global styles.
   ============================================ */

.cdt-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.cdt-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 16px;
  color: #6b7686;
}

.cdt-empty svg {
  color: #e0a919;
}

.cdt-root {
  --cdt-navy: #002060;
  --cdt-magenta: #e820da;
  --cdt-ink: #1b2430;
  --cdt-muted: #6b7686;
  --cdt-line: #e4e8f1;
  --cdt-surface: #ffffff;
  --cdt-tint: #eef2fb;

  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 2px 24px;
  color: var(--cdt-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Profile hero ---------- */
.cdt-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px 18px;
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(232, 32, 218, 0.28) 0%, rgba(232, 32, 218, 0) 55%),
    linear-gradient(160deg, #002060 0%, #0a3190 100%);
  color: #ffffff;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 32, 96, 0.25);
}

.cdt-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #dfe7f7, #f6d9f3);
  color: var(--cdt-navy);
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.95), 0 0 0 7px rgba(232, 32, 218, 0.55);
  user-select: none;
}

.cdt-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cdt-hero-name {
  margin: 14px 0 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
  background: none;
  border: none;
  padding: 0;
}

.cdt-hero-pref {
  margin: 0;
  font-size: 13px;
  color: #c9d6f5;
}

.cdt-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.cdt-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.cdt-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.cdt-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 104px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--cdt-navy);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.cdt-action:hover {
  transform: translateY(-1px);
  background: #f1f4fc;
}

.cdt-action-alt {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.cdt-action-alt:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* ---------- Section cards ---------- */
.cdt-card {
  background: var(--cdt-surface);
  border: 1px solid var(--cdt-line);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
  overflow: hidden;
}

.cdt-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
  color: var(--cdt-navy);
  background: var(--cdt-tint);
  border: none;
  border-bottom: 1px solid var(--cdt-line);
  text-align: left;
}

.cdt-card-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--cdt-navy);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.cdt-card-body {
  display: flex;
  flex-direction: column;
}

/* ---------- Detail rows ---------- */
.cdt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--cdt-line);
}

.cdt-row:last-child {
  border-bottom: none;
}

.cdt-row-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--cdt-tint);
  color: var(--cdt-navy);
}

.cdt-row-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.cdt-row-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--cdt-muted);
  line-height: 1.2;
}

.cdt-row-value {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--cdt-ink);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cdt-row-empty {
  font-size: 13px;
  font-style: italic;
  color: #a2abba;
}

.cdt-link {
  color: #1650c7;
  text-decoration: none;
}

.cdt-link:hover {
  text-decoration: underline;
}

/* ---------- Wider screens ---------- */
@media (min-width: 768px) {
  .cdt-root {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }

  .cdt-hero {
    grid-column: 1 / -1;
  }
}/* ============================================================
   LOGBOOK TAB  –  Care Runner
   Brand: magenta #E820DA  ·  navy #002060
   ============================================================ */

:root {
    --lb-magenta: #E820DA;
    --lb-navy: #002060;
    --lb-accent: #5b4de0;
    --lb-text: #1f2937;
    --lb-text-soft: #4b5563;
    --lb-muted: #6b7280;
    --lb-border: #e5e7eb;
    --lb-surface: #ffffff;
    --lb-surface-soft: #f8fafc;
    --lb-radius: 12px;
    --lb-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 4px 14px rgba(16, 24, 40, 0.06);
}

/* ---------- Panel / toolbar ---------- */

.logbook-panel {
    padding-top: 18px;
    padding-bottom: 24px;
}

.logbook-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.logbook-title-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logbook-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--lb-text);
}

.logbook-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--lb-navy);
    background: #e8edf8;
    padding: 3px 10px;
    border-radius: 999px;
}

.logbook-actions-container {
    display: flex;
    justify-content: flex-end;
}

.logbook-add-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--lb-magenta) 50%, var(--lb-navy) 50%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(232, 32, 218, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.logbook-add-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(232, 32, 218, 0.38);
}

.logbook-add-button:active {
    transform: translateY(0);
}

.logbook-add-button:focus-visible {
    outline: 3px solid rgba(232, 32, 218, 0.35);
    outline-offset: 2px;
}

/* ---------- Loading / error / empty ---------- */

.tab-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.tab-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 0;
    color: #dc2626;
}

.logbook-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 48px 16px;
    color: var(--lb-muted);
    background: var(--lb-surface-soft);
    border: 1px dashed var(--lb-border);
    border-radius: var(--lb-radius);
}

.logbook-empty-state p {
    margin: 0;
}

/* ---------- Visit list & card ---------- */

.visit-groups-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.visit-logbook-card {
    background: var(--lb-surface);
    border-radius: var(--lb-radius);
    box-shadow: var(--lb-shadow);
    border: 1px solid var(--lb-border);
    border-left: 4px solid var(--lb-accent);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.visit-logbook-card:hover {
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.1), 0 10px 24px rgba(16, 24, 40, 0.08);
}

/* ── Header ── */
.visit-card-header {
    background: linear-gradient(135deg, var(--lb-magenta) 50%, var(--lb-navy) 50%);
    color: #fff;
    padding: 10px 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    flex-wrap: wrap;
}

.visit-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.visit-call-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 1.02rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.visit-time-range,
.visit-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.86rem;
    font-weight: 500;
    opacity: 0.95;
}

/* Carer pills */
.visit-carers-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.carer-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 12px 3px 4px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    backdrop-filter: blur(2px);
}

.carer-pill--1 {
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.carer-pill--2 {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.carer-pill-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    color: var(--lb-navy);
    font-size: 0.65rem;
    font-weight: 800;
}

/* ── Body ── */
.visit-card-body {
    padding: 0;
}

.visit-card-body--double {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 0;
}

.visit-note-column {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.visit-note-divider {
    background: linear-gradient(180deg, transparent, #c7cdf0, transparent);
    width: 1px;
    align-self: stretch;
}

/* Author label (double visits) */
.visit-note-author {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--lb-border);
}

.visit-note-author-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--lb-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.carer-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    flex-shrink: 0;
}

.carer-avatar--1 { background: var(--lb-magenta); }
.carer-avatar--2 { background: var(--lb-navy); }

/* Note text */
.visit-note-text {
    margin: 0;
    line-height: 1.65;
    color: var(--lb-text);
    font-size: 0.94rem;
    overflow-wrap: anywhere;
}

/* Completed activities chips */
.visit-activities {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: var(--lb-surface-soft);
    border: 1px solid var(--lb-border);
    border-radius: 10px;
}

.visit-activities-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #047857;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.visit-activities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.activity-chip {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
}

/* In / Out footer */
.visit-note-times {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.visit-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--lb-text-soft);
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 999px;
}

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
    .visit-card-body--double {
        grid-template-columns: 1fr;
    }

    .visit-note-divider {
        width: 100%;
        height: 1px;
        background: linear-gradient(90deg, transparent, #c7cdf0, transparent);
    }
}

@media (max-width: 480px) {
    .visit-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 12px;
        background: linear-gradient(160deg, var(--lb-magenta) 55%, var(--lb-navy) 55%);
    }

    .visit-note-column {
        padding: 14px;
    }

    .logbook-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .logbook-actions-container {
        justify-content: stretch;
    }

    .logbook-add-button {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.55);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
    padding: 16px;
}

.modal-content {
    background-color: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
    position: relative;
    padding: 0;
}

.lb-modal-header,
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--lb-border);
    margin: 0;
}

.lb-modal-header {
    background: linear-gradient(135deg, rgba(232, 32, 218, 0.07), rgba(0, 32, 96, 0.07));
    border-radius: 14px 14px 0 0;
}

.lb-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lb-modal-title h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--lb-navy);
}

.lb-modal-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--lb-magenta) 50%, var(--lb-navy) 50%);
}

.modal-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 2px;
    border-radius: 50%;
    transition: color 0.15s ease, background 0.15s ease;
}

.modal-close-button:hover {
    color: #dc2626;
    background: #fee2e2;
}

.lb-modal-form {
    padding: 18px;
}

.lb-client-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    background: var(--lb-surface-soft);
    border: 1px solid var(--lb-border);
    border-radius: 10px;
    color: var(--lb-text);
}

.lb-client-banner-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--lb-muted);
}

.lb-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 480px) {
    .lb-form-grid {
        grid-template-columns: 1fr;
    }
}

.modal-form-group {
    margin-bottom: 16px;
}

.modal-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--lb-text-soft);
    margin-bottom: 6px;
}

.modal-input,
.modal-textarea {
    width: 100%;
    padding: 9px 12px;
    font-size: 0.93rem;
    color: var(--lb-text);
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-input:focus,
.modal-textarea:focus {
    outline: none;
    border-color: var(--lb-accent);
    box-shadow: 0 0 0 3px rgba(91, 77, 224, 0.18);
}

.modal-input--readonly {
    background: #f3f4f6;
    color: var(--lb-muted);
    cursor: not-allowed;
}

.modal-textarea {
    resize: vertical;
    min-height: 130px;
    line-height: 1.55;
}

.modal-submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #007bff;
    color: #fff;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.modal-submit-button:hover:not(:disabled) {
    filter: brightness(1.08);
}

.modal-submit-button:disabled,
.modal-cancel-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.lb-primary-btn {
    background: linear-gradient(135deg, var(--lb-magenta) 50%, var(--lb-navy) 50%);
    box-shadow: 0 2px 8px rgba(232, 32, 218, 0.25);
}

/* ---------- Confirmation dialog ---------- */

.confirmation-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.94);
    z-index: 10;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.modal-confirmation-content {
    background-color: #fff;
    padding: 24px 22px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.22);
    text-align: center;
    max-width: 100%;
    width: 360px;
    border: 1px solid var(--lb-border);
}

.modal-confirmation-content p {
    margin: 0 0 6px;
    color: var(--lb-text-soft);
}

.lb-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fef3c7;
    color: #d97706;
    margin-bottom: 10px;
}

.lb-confirm-title {
    margin: 0 0 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--lb-text);
}

.lb-confirm-warning {
    font-size: 0.82rem;
    color: #dc2626 !important;
}

.confirmation-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.modal-submit-button.confirm-button {
    background-color: #16a34a;
    flex: 1;
    width: auto;
}

.modal-cancel-button {
    background-color: #e5e7eb;
    color: #374151;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    transition: background 0.15s ease;
}

.modal-cancel-button:hover:not(:disabled) {
    background-color: #d1d5db;
}

/* ============================================================
   NOTIFICATIONS
   ============================================================ */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    min-width: 260px;
    max-width: 420px;
    animation: lb-slide-in 0.25s ease-out;
}

.notification-icon {
    flex-shrink: 0;
    margin-top: 1px;
    color: #fff;
}

.notification-message {
    flex: 1;
    font-size: 0.92rem;
    line-height: 1.4;
}

.notification-success { background-color: #16a34a; }
.notification-error   { background-color: #dc2626; }
.notification-warning  { background-color: #f59e0b; }

.notification-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.notification-close-btn:hover {
    opacity: 1;
}

@keyframes lb-slide-in {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   SHARED / LEGACY STYLES
   (kept unchanged so other tabs that rely on this stylesheet
   – medication, location, geolocation – keep working)
   ============================================================ */

.logs-container {
    padding: 10px;
    background-color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin-bottom: 20px;
    max-height: 72vh;
}

.medication-list {
    list-style: disc inside;
    padding-left: 15px;
    margin-top: 5px;
    font-size: 0.75rem;
    color: #333;
    white-space: pre-wrap;
}

.medication-list-item {
    margin-bottom: 5px;
    line-height: 1.4;
}

.medication-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.medication-item:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.medication-item label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    cursor: pointer;
}

.medication-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.medication-details { flex: 1; }

.medication-name {
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

.medication-name span {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

.medication-color {
    display: inline-block;
    margin-left: 6px;
    color: #0891b2;
    font-weight: 600;
}

.medication-count-section { display: flex; align-items: center; }

.medication-count-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.medication-count-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    transition: 0.2s;
}

.medication-count-plus { background: #10b981; }
.medication-count-plus:hover { transform: scale(1.1); }
.medication-count-minus { background: #ef4444; }
.medication-count-minus:hover { transform: scale(1.1); }

.medication-count-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: white;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 15px;
    color: #374151;
}

/* Location status */
.location-status-section {
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.location-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.location-status-header h4 {
    margin: 0;
    font-size: 16px;
    color: #495057;
}

.location-status-indicator {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.location-status-indicator.checking    { color: #6c757d; }
.location-status-indicator.allowed     { color: #28a745; }
.location-status-indicator.denied      { color: #dc3545; }
.location-status-indicator.unavailable { color: #ffc107; }

.status-icon {
    margin-right: 8px;
    font-size: 18px;
}

.location-error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    border: 1px solid #f5c6cb;
}

.location-help-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.location-help-links a {
    color: #0066cc;
    text-decoration: underline;
    font-size: 14px;
}

.location-help-links a:hover { color: #004499; }

.geolocation-error {
    display: flex;
    align-items: center;
    background-color: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    border: 1px solid #fcc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.geolocation-error .error-icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Geolocation toggle */
.geolocation-toggle {
    margin: 15px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.toggle-label input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: background-color 0.3s;
    margin-right: 10px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-label input:checked + .toggle-slider { background-color: #4CAF50; }
.toggle-label input:checked + .toggle-slider:before { transform: translateX(26px); }

.toggle-text {
    margin-left: 10px;
    font-weight: 500;
}

.geolocation-note {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
    margin-left: 60px;
}/* ============================================================================
   LOGBOOK TAB – THEME
   Import AFTER LogbookTab.css. Every class is prefixed with lbk-, so no other
   screen is affected.
   ============================================================================ */

.lbk-root {
  --lb-navy: #002060;
  --lb-ink: #1b2430;
  --lb-muted: #6b7686;
  --lb-line: #e4e8f1;
  --lb-tint: #eef2fb;
  --lb-blue: #1650c7;
  --lb-magenta: #e820da;

  width: 100%;
  max-width: none;
  margin: 0;
  padding: 14px 14px 32px;
  box-sizing: border-box;
  color: var(--lb-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Loading / error ---------- */
.lbk-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 300px;
}
.lbk-state-error { color: #c0392b; font-weight: 600; }

/* ---------- Toolbar ---------- */
.lbk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(232, 32, 218, 0.28) 0%, rgba(232, 32, 218, 0) 55%),
    linear-gradient(160deg, #002060 0%, #0a3190 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 32, 96, 0.2);
}

.lbk-toolbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }

.lbk-toolbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  flex: 0 0 auto;
}

.lbk-toolbar-title h3 { margin: 0; font-size: 18px; font-weight: 800; color: #fff; line-height: 1.2; }
.lbk-toolbar-sub { font-size: 12.5px; color: #c9d6f5; font-weight: 500; }

/* ---------- Buttons ---------- */
.lbk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 18px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.lbk-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(16, 24, 40, 0.2); }
.lbk-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.lbk-btn-block { width: 100%; }

.lbk-btn-primary { background: var(--lb-magenta); color: #fff; }
.lbk-btn-primary:hover:not(:disabled) { background: #c919bd; }
.lbk-btn-success { background: #10b981; color: #fff; }
.lbk-btn-success:hover:not(:disabled) { background: #0b9669; }
.lbk-btn-ghost { background: #eef1f7; color: #344054; }
.lbk-btn-ghost:hover:not(:disabled) { background: #e1e6f0; }

.lbk-spin { animation: lbkSpin 0.9s linear infinite; }
@keyframes lbkSpin { to { transform: rotate(360deg); } }

/* ---------- List + day headings ---------- */
.lbk-list { display: flex; flex-direction: column; gap: 14px; }

.lbk-day {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lb-navy);
}
.lbk-day::after { content: ""; flex: 1; height: 1px; background: var(--lb-line); }
.lbk-day:first-child { margin-top: 0; }
.lbk-day em {
  order: 2;
  padding: 2px 9px;
  border-radius: 999px;
  background: #e6f5ec;
  color: #15803d;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* ---------- Visit card ---------- */
.lbk-card {
  background: #fff;
  border: 1px solid var(--lb-line);
  border-left: 5px solid var(--lb-blue);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.07);
  overflow: hidden;
}
.lbk-card.is-double { border-left-color: var(--lb-magenta); }

.lbk-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 11px 16px;
  background: var(--lb-tint);
  border-bottom: 1px solid var(--lb-line);
}

.lbk-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

.lbk-call-type {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--lb-navy);
}

.lbk-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--lb-line);
  font-size: 12.5px;
  font-weight: 600;
  color: #46526a;
  font-variant-numeric: tabular-nums;
}

.lbk-card-carers { display: flex; flex-wrap: wrap; gap: 6px; }

.lbk-carer-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 999px;
  background: #dfe8fb;
  color: #123a9b;
  font-size: 12.5px;
  font-weight: 700;
}
.lbk-carer-pill-2 { background: #fbe3f9; color: #a3139a; }

/* ---------- Card body / notes ---------- */
.lbk-card-body { display: block; }

/* double visit: two notes side by side */
.lbk-card-body.is-double {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
}

/* solo visit: note on the left, details panel on the right */
.lbk-card-body.is-solo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 26%, 340px);
  align-items: stretch;
}

.lbk-divider { background: var(--lb-line); width: 1px; align-self: stretch; }

.lbk-note {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  min-width: 0;
}

.lbk-note-author { display: flex; align-items: center; gap: 10px; }

.lbk-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #dfe8fb;
  color: #123a9b;
}
.lbk-avatar-2 { background: #fbe3f9; color: #a3139a; }

.lbk-note-author-text { display: flex; flex-direction: column; line-height: 1.25; }
.lbk-note-author-text strong { font-size: 14px; }
.lbk-note-author-text span { font-size: 11.5px; color: var(--lb-muted); font-weight: 600; }

.lbk-note-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: #2b3442;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 120ch;
}

/* the solo note now has its own column, so let it fill it and breathe a little */
.lbk-card-body.is-solo .lbk-note { padding: 16px 20px; }
.lbk-card-body.is-solo .lbk-note-text { max-width: none; font-size: 15px; }

/* long notes are clamped until "Show more" is pressed */
.lbk-note-text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lbk-more {
  align-self: flex-start;
  padding: 0;
  border: none;
  background: none;
  color: var(--lb-blue);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.lbk-more:hover { text-decoration: underline; }

.lbk-note-times { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

.lbk-time-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 8px;
  background: #f4f6fb;
  font-size: 12px;
  color: var(--lb-muted);
  font-weight: 600;
}
.lbk-time-chip strong { color: var(--lb-ink); font-variant-numeric: tabular-nums; }

/* ---------- Solo visit: details side panel ---------- */
.lbk-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #f6f8fd 0%, #f0f4fc 100%);
  border-left: 1px solid var(--lb-line);
  min-width: 0;
}

.lbk-side-block { display: flex; flex-direction: column; gap: 4px; }

.lbk-side-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lb-muted);
}

.lbk-side-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--lb-navy);
  font-variant-numeric: tabular-nums;
}

.lbk-side-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lbk-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--lb-line);
  border-top: 3px solid #10b981;
}
.lbk-stat-out { border-top-color: #f59e0b; }
.lbk-stat strong {
  font-size: 19px;
  font-weight: 800;
  color: var(--lb-ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.lbk-duration {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 9px 12px;
  border-radius: 10px;
  background: #dfe8fb;
  color: #123a9b;
  font-size: 13px;
  font-weight: 600;
}
.lbk-duration strong { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Empty state ---------- */
.lbk-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 44px 16px;
  border: 1px dashed #d6ddea;
  border-radius: 14px;
  background: #f7f9fc;
  color: var(--lb-muted);
}
.lbk-empty p { margin: 0; font-size: 15px; font-weight: 600; }

/* ---------- Toast ---------- */
.lbk-toast {
  position: fixed;
  top: calc(var(--titlebar-height, 0px) + 14px);
  right: 16px;
  z-index: 12000;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 250px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.28);
  animation: lbkSlide 0.25s ease-out;
}
.lbk-toast-success { background: #10b981; }
.lbk-toast-error { background: #ef4444; }
.lbk-toast-warning { background: #f59e0b; color: #3b2a00; }
.lbk-toast-icon { flex: 0 0 auto; margin-top: 1px; }
.lbk-toast-text { flex: 1; line-height: 1.4; }
.lbk-toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  cursor: pointer;
}
.lbk-toast-close:hover { background: rgba(255, 255, 255, 0.35); }
@keyframes lbkSlide { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- Modal ---------- */
.lbk-overlay {
  position: fixed;
  top: var(--titlebar-height, 0px);
  left: 0;
  right: 0;
  bottom: var(--statusbar-height, 0px);
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.lbk-modal {
  position: relative; /* anchors the confirmation layer */
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - var(--titlebar-height, 0px) - var(--statusbar-height, 0px) - 32px);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.4);
  animation: lbkPop 0.18s ease-out;
}
@keyframes lbkPop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.lbk-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(160deg, #002060 0%, #0a3190 100%);
  color: #fff;
}
.lbk-modal-head h3 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 16.5px; font-weight: 800; color: #fff; }

.lbk-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
}
.lbk-modal-close:hover { background: rgba(255, 255, 255, 0.3); }

.lbk-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
  min-height: 0;
}

.lbk-client-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--lb-tint);
  color: var(--lb-navy);
  font-size: 14px;
}

.lbk-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lbk-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbk-label { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--lb-muted); }

.lbk-input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  box-sizing: border-box;
  border: 1px solid #d4dbea;
  border-radius: 10px;
  background: #fff;
  color: var(--lb-ink);
  font-family: inherit;
  font-size: 14.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lbk-input:focus { outline: none; border-color: #3b6cf0; box-shadow: 0 0 0 3px rgba(59, 108, 240, 0.18); }
.lbk-input[readonly] { background: #f4f6fb; color: #536074; }
.lbk-textarea { min-height: 140px; resize: vertical; line-height: 1.55; }

/* ---------- Confirmation (inside the modal) ---------- */
.lbk-confirm-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(2px);
}

.lbk-confirm {
  width: 100%;
  max-width: 360px;
  padding: 22px 20px 18px;
  border: 1px solid var(--lb-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
  text-align: center;
}
.lbk-confirm h4 { margin: 8px 0 6px; font-size: 17px; font-weight: 800; color: var(--lb-ink); }
.lbk-confirm p { margin: 0 0 4px; font-size: 14px; color: #46526a; }
.lbk-confirm-warn { color: #c0392b !important; font-weight: 700; font-size: 13px !important; }

.lbk-confirm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e6f5ec;
  color: #15803d;
}

.lbk-confirm-actions { display: flex; gap: 10px; margin-top: 16px; }
.lbk-confirm-actions .lbk-btn { flex: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  /* narrower screens: details panel drops under the note as a compact strip */
  .lbk-card-body.is-solo { grid-template-columns: minmax(0, 1fr); }
  .lbk-side {
    border-left: none;
    border-top: 1px solid var(--lb-line);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
  }
  .lbk-side-grid { display: flex; gap: 10px; }
  .lbk-duration { margin-top: 0; }
}

@media (max-width: 700px) {
  .lbk-root { padding: 10px 8px 28px; }
  .lbk-card-body.is-double { grid-template-columns: minmax(0, 1fr); }
  .lbk-divider { width: 100%; height: 1px; }
  .lbk-add { width: 100%; }
  .lbk-form-row { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .lbk-modal, .lbk-toast { animation: none; }
  .lbk-btn { transition: none; }
}.tabs-navigation {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tabs-navigation::-webkit-scrollbar {
    display: none;
}

.tabs-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: max-content;
}

.tab-button {
    white-space: nowrap;
    flex-shrink: 0;
}
/* Base Styles for Components */
.focusable-grid:focus,
.client-call:focus,
.staff-action:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* spinner.css */
.spinner {
    border: 2px solid #f3f3f3;
    /* Light grey */
    border-top: 2px solid #fff;
    /* White top */
    border-right: 2px solid #333;
    /* Dark edge */
    border-radius: 50%;
    width: 14px;
    height: 14px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 🆕 NEW CSS: Style for the live drag position indicator */
.drag-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    /* Or a small width to make it a line */
    background-color: #ff5722;
    z-index: 10;
    pointer-events: none;
    /* Allows mouse events to pass through to the element below */
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.drag-indicator-time {
    position: absolute;
    top: -25px;
    padding: 2px 5px;
    background-color: #ff5722;
    color: white;
    font-size: 10px;
    white-space: nowrap;
    border-radius: 3px;
    transform: translateX(-50%);
    z-index: 10;
}

/* Added styles for break time visualization */
.break-time-bar {
    pointer-events: none;
    user-select: none;
    box-sizing: border-box;
}

.break-time-bar:hover {
    opacity: 0.9;
}

/* Ensure break bars appear behind calls but above timeline */
.staff-timeline {
    position: relative;
}

.client-call {
    position: relative;
    z-index: 1;
}

.break-time-bar {
    z-index: 0;
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {

    .client-call,
    .staff-action,
    .schedule-container {
        transition: none;
        animation: none;
    }

    .priority-indicator {
        animation: none;
    }
}

/* ================================
Button Base Styles 
===================*/

.location {
    padding: 2px;
    margin-left: 10px;
    box-shadow: 0 4px 6px rgba(55, 49, 68, 0.265);
    cursor: pointer;
    font-weight: bold;
    border-radius: 5px;
    border: 1px solid rgba(36, 155, 223, 0.507);
}


.btn {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.btn:hover {
    filter: brightness(110%);
}

/* Specific Button Styles */
.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-lg {
    width: 20%;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #1e7e34;
}

/* Staff Action Buttons */
.staff-action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    font-size: 9px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.staff-action:hover {
    opacity: 1;
    background: rgba(226, 27, 200, 0.2);
    transform: scale(1.1);
}

.staff-action.email {
    border: 1px solid rgb(191, 204, 231);
    padding: 0px;
}

.staff-action:focus {
    outline-offset: 1px;
}

/*====================
Schedule Layout & Grid /  Main Layout Containers
=================== */
.schedule-container {
    background: #c0d5eb;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(21, 18, 28, 0.6);
    margin: 15px;
    animation: fadeIn 0.5s ease-in-out;
    overflow: hidden;
    position: relative;
}

.schedule-grid {
    display: block;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    position: relative;
}

.grid-body {
    display: grid;
    grid-template-columns: 150px 1fr;
    grid-template-rows: auto 1fr;
    overflow: auto;
    max-height: calc(100vh - 160px);
    background: #ffffff;
    scroll-behavior: smooth;
}

/* Fixed Header Cells */
.staff-header-cell {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 32;
    font-weight: bold;
    font-size: 14px;
    color: #e8fff7;
    background: linear-gradient(135deg, #836f86, #4f6d8f);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #ddd;
    border-left: 2px solid #761683;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.time-header-row {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 31;
    display: grid;
    grid-template-columns: repeat(48, minmax(30px, 1fr));
    background: linear-gradient(135deg, #435c79, #874f8f);
    min-height: 20px;
    width: 150%;
    min-width: 1610px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.staff-grid-row {
    display: contents;
}

.staff-name-cell {
    grid-column: 1;
    grid-row: auto;
    position: sticky;
    left: 0;
    z-index: 20;
    width: 150px;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    justify-content: space-between;
    padding: 3px;
    border-top: 1px solid #c8eef7;
    border-bottom: 1px solid #cfcfcf;
    border-right: 1px solid #ddd;
    min-height: 45px;
    max-height: 45px;
}

.staff-timeline {
    grid-column: 2;
    grid-row: auto;
    display: grid;
    grid-template-columns: repeat(48, minmax(30px, 1fr));
    align-items: center;
    z-index: 1;
    position: relative;
    width: 150%;
    min-width: 1610px;
    background: #fff;
}

/* ========================
Schedule Details / Staff Information
================ */
.staff-header-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.staff-photo-container {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.staff-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-info {
    flex: 1;
}

.staff-name {
    font-size: 14px;
    font-weight: 600;
    color: #120d1d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.staff-details-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.staff-count {
    font-size: 10px;
    color: #9c9e9e;
    font-style: italic;
    white-space: nowrap;
}

.staff-hours {
    font-size: 10px;
    color: #9c9e9e;
    font-style: italic;
    white-space: nowrap;
}

.curent-day {
    font-size: 10px;
    font-weight: normal;
    opacity: 0.8;
}

/* Time Headers */
.time-slot-header {
    grid-column: span 2;
    text-align: left;
    font-size: 11px;
    font-weight: bold;
    color: rgb(195, 234, 247);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 30px;
    justify-content: flex-start;
    padding-left: 2px;
    padding-top: 5px;
    box-sizing: border-box;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.time-text {
    font-size: 12px;
    text-align: left;
    display: block;
    white-space: nowrap;
}

.time-cell {
    border-right: 1px solid #e3e8eb !important;
    border-top: 1px solid #999999 !important;
    position: relative;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
    min-height: 45px;
}

.time-cell.hourly-border {
    border-left: 1px solid #a7b7be !important;
}


/* Client Call Cards */
.client-call {
    border-radius: 5px;
    padding: 2px 2px;
    position: absolute;
    top: 65%;
    transform: translateY(-50%);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 22px;
    max-height: 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(1px);
}

.client-call:hover {
    transform: translateY(-50%) scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

/* Priority Indicators */
.client-call.priority-high {
    border-left: 4px solid #ff4444;
}

.client-call.priority-medium {
    border-left: 4px solid #ff9800;
}

.client-call.priority-low {
    border-left: 4px solid #4caf50;
}

.priority-indicator {
    background: #1b2a4e;
    color: #ffffff;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
    margin-left: 4px;
    animation: pulse-priority 2s infinite;
}

/* =================================
Call Blocks// Call Text & Content
==================== */
.call-text,
.call-type-text {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8));
}

.call-text {
    font-size: 10px;
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 0px 1px rgba(0, 0, 0, 0.1);
    line-height: 1.1;
    flex: 1;
    text-align: left;
    width: 100%;
}

.call-text span {
    font-size: 11px;
    display: block;
    margin-bottom: 1px;
    padding-top: 3px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

.call-type-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 6px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    width: 100%;
}

/* =======================
State & Animations / Loading and Error States
============== */
.loading-state {
    display: flex;
    backdrop-filter: blur(4px);
    border-radius: 8px;
    justify-content: center;
    align-items: center;
    height: 6px;
    font-size: 9px;
    color: #666;
    background: rgba(134, 8, 126, 0.9);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.error-state {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 18px;
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-priority {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ===============================
Responsive & Print //Mobile Styles 
=================*/
@media (max-width: 768px) {
    .schedule-container {
        margin: 5px;
        max-height: calc(100vh - 100px);
    }

    .staff-header-cell,
    .staff-name-cell {
        width: 150px;
        min-width: 150px;
    }

    .staff-photo-container {
        width: 18px;
        height: 18px;
    }

    .staff-name {
        font-size: 12px;
    }

    .staff-count {
        font-size: 9px;
    }

    .time-header-row,
    .staff-timeline {
        grid-template-columns: repeat(48, minmax(25px, 1fr));
        min-width: 1200px;
    }

    .time-slot-header {
        min-height: 30px;
        font-size: 10px;
    }

    .client-call {
        min-height: 20px;
        max-height: 20px;
        font-size: 9px;
        padding: 2px 4px;
    }

    .call-text,
    .call-text strong {
        font-size: 8px;
    }

    .call-type-text {
        font-size: 6px;
    }
}

/* Tablet Styles */
@media (max-width: 1024px) and (min-width: 769px) {
    .schedule-container {
        margin: 8px;
    }

    .staff-header-cell,
    .staff-name-cell {
        width: 130px;
        min-width: 130px;
    }

    .time-header-row,
    .staff-timeline {
        grid-template-columns: repeat(48, minmax(28px, 1fr));
        min-width: 1344px;
    }
}

/* Print Styles */
@media print {
    .schedule-container {
        box-shadow: none;
        margin: 0;
        max-height: none;
        min-height: auto;
    }

    .grid-body {
        max-height: none;
        overflow: visible;
    }

    .client-call {
        box-shadow: none;
        border: 1px solid #ccc;
        background-color: #f8f9fa !important;
        color: #000 !important;
    }

    .call-text,
    .call-type-text {
        color: #000 !important;
        text-shadow: none;
    }

    .staff-action {
        display: none;
    }
}

/* ===========================
High DPI & Dark Mode 
=============================== */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .client-call,
    .time-cell {
        border-width: 0.5px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {

    .schedule-container,
    .schedule-grid,
    .grid-body,
    .staff-grid-row,
    .staff-name-cell,
    .staff-timeline {
        background: #ffffff;
        color: #000000;
    }

    .staff-grid-row:hover {
        background: #f8f9fa;
    }

    .staff-name-cell {
        border-color: #ddd;
    }

    .staff-name {
        color: #070303;
    }

    .staff-count {
        color: #9c9e9e;
    }

    .time-cell {
        border-color: #f0f0f0;
    }

    .time-cell.hourly-border {
        border-left-color: #b8e2f0 !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .client-call {
        border: 2px solid #000;
    }

    .staff-name-cell {
        border: 1px solid #000;
    }

    .time-cell {
        border-color: #000;
    }
}

/* Current Time Indicator Line */
.current-time-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #ff00ae;
    border-left: 2px dotted #ff0000;
    z-index: 100;
    pointer-events: none;
    animation: pulse-time-line 2s infinite;
}

.current-time-line-staff {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #df13722f;
    border-left: 2px dotted #ea09988a;
    z-index: 50;
    pointer-events: none;
    opacity: 0.8;
    box-shadow: 0 4px 6px rgba(202, 216, 236, 0.6);
}

@keyframes pulse-time-line {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}


/* Summary Section Styling */
.summary-section {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-top: 2px solid #007bff;
    padding: 20px;
    margin-top: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.summary-header {
    text-align: center;
    margin-bottom: 20px;
}

.summary-header h3 {
    color: #495057;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.summary-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.summary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.summary-stat-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-left: 4px solid #007bff;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 18px;
    color: #495057;
    font-weight: bold;
}

.summary-top-carers {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-top-carers h4 {
    color: #495057;
    font-size: 16px;
    margin: 0 0 15px 0;
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.top-carers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-carer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #28a745;
    transition: all 0.2s ease;
}

.top-carer-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.carer-name {
    font-weight: bold;
    color: #495057;
    font-size: 14px;
}

.carer-stats {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Responsive adjustments for summary */
@media (max-width: 768px) {
    .summary-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .summary-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .summary-stat-item {
        padding: 10px;
    }

    .stat-value {
        font-size: 16px;
    }

    .staff-stats {
        gap: 2px;
    }


}

.toast {
    position: fixed;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: fadeInOut 3s ease-in-out forwards;
    z-index: 2000;
}

/* Error toast - red */
.toastError {
    background: linear-gradient(135deg, #ff4d4d, #cc0000);
}

/* Success toast - green */
.toastSuccess {
    background: linear-gradient(135deg, #28a745, #218838);
}

/* Fade animation */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    10% {
        opacity: 1;
        transform: translateY(0);
    }

    90% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}



.date-input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.date-label {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 4px;
}

.date-input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.lock-toggle-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 1px;
    margin-top: 2px;
    margin-bottom: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}


.modal-cancel-button {
    background-color: #e0e0e0;
    color: #333;
}

.modal-cancel-button:hover {
    background-color: #d0d0d0;
}

.modal-confirm-button {
    background-color: #4CAF50;
    color: #fff;
}

.modal-confirm-button:hover {
    background-color: #45a049;
}

.lock-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lock-toggle-btn.locked {
    color: #ff6b6b;
    background: rgba(84, 115, 12, 0.354);
}

.lock-toggle-btn.unlocked {
    color: #51cf66;
    background: rgba(81, 207, 102, 0.1);
}



/* ===============================
NEW TIME ADJUSTMENT INDICATORS
=============================== */

/* Time Adjustment Indicators */
.time-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 150;
    animation: pulse-indicator 2s infinite;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.time-indicator.time-earlier {
    left: -45px;
    /* Float to the left of the call */
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.95), rgba(255, 0, 0, 0.9));
    border-color: rgba(255, 255, 255, 0.3);
}

.time-indicator.time-later {
    right: -45px;
    /* Float to the right of the call */
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.95), rgba(0, 128, 0, 0.9));
    border-color: rgba(255, 255, 255, 0.3);
}

.time-arrow {
    font-size: 12px;
    margin: 0 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.time-diff {
    font-size: 9px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

/* Enhanced Drag Preview Indicators */
.drag-preview-container {
    position: absolute;
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 200;
}

.drag-preview-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 90%;
    border-radius: 3px;
    animation: pulse-preview 1s infinite;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.drag-preview-indicator.earlier {
    background: linear-gradient(to bottom, #ff4444, #ff6666, #ff4444);
    border: 2px solid #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
}

.drag-preview-indicator.later {
    background: linear-gradient(to bottom, #44ff44, #66ff66, #44ff44);
    border: 2px solid #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
}

/* Enhanced Animations */
@keyframes pulse-indicator {

    0%,
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translateY(-50%) scale(1.05);
    }
}

@keyframes pulse-preview {

    0%,
    100% {
        opacity: 0.9;
        transform: translateY(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.15);
    }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .time-indicator.time-earlier {
        left: -35px;
    }

    .time-indicator.time-later {
        right: -35px;
    }

    .time-indicator {
        padding: 2px 6px;
        font-size: 9px;
    }

    .time-diff {
        font-size: 8px;
    }

    .time-arrow {
        font-size: 10px;
    }
}

/* Hover effects for calls with time adjustments */
.client-call.has-time-adjustment:hover {
    border-color: #ff8c00;
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.8);
    transform: translateY(-50%) scale(1.08);
}

.client-call.has-time-adjustment:hover .time-indicator {
    animation: none;
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}

/* Ensure indicators don't interfere with call content */
.client-call.has-time-adjustment .call-text,
.client-call.has-time-adjustment .call-type-text {
    position: relative;
    z-index: 1;
}



.preview-time-indicator {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.preview-arrow {
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.preview-time {
    font-size: 10px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

/*================================ Modals Overlays and Containers =================*/
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(37, 37, 45, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content,
.modal-lg,
.modal-sm {
    background: white;
    border-radius: 16px;
    /* Ensures no white space with header */
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    /* Clips content to border-radius */
    display: flex;
    /* Enables flexbox for vertical stacking */
    flex-direction: column;
    /* Stacks children vertically */
}

.modal-content {
    max-width: 500px;
    width: 90%;
    border: 3px solid #96329deb;
}

.modal-lg {
    /* padding: 20px; removed, handled by modal-content-scroll */
    max-width: 1050px;
    max-height: 90vh;
    width: 90%;
    /* overflow-y: auto; removed, handled by modal-content-scroll */
    animation: modalFadeIn 0.3s ease-out;
}

.modal-sm {
    /* padding: 10px; removed, handled by modal-content-scroll */
    max-width: 400px;
    max-height: 90vh;
    width: 50%;
    /* overflow-y: auto; removed, handled by modal-content-scroll */
    animation: modalFadeIn 0.3s ease-out;
}

/* Modal Components */
.modal-header-top {
    background: linear-gradient(135deg, teal, #dd34f8);
    /* Preserving your specified color */
    color: #fff;
    padding: 8px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    flex-shrink: 0;
    /* Prevents header from shrinking */
}

.modal-header-top .modal-title {
    color: #fff;
    font-size: 1.1em;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(36, 23, 23, 0.527);
    margin: 0;
    flex-grow: 1;
}

.modal-header-top .modal-postcode {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    opacity: 0.9;
    white-space: nowrap;
}

.modal-header-top .modal-postcode img {
    filter: invert(1);
}

.modal-body h3 {
    border-bottom: 2px solid #c6d3db;
    padding-bottom: 10px;
    margin-bottom: 15px;
    margin-top: 0;
}

.padding {
    padding: 20px;
}


/* The first .modal-content-scroll definition was removed as it conflicted with the second and the desired behavior. */

.modal-tabs {
    display: flex;
    flex-wrap: wrap;
    padding: 10px 20px 0;
    background: #ffffff;
    border-bottom: 1px solid #58565c;
    flex-shrink: 0;
    /* Prevents tabs from shrinking */
}

/* This is the main scrollable content area */
.modal-content-scroll {
    flex-grow: 1;
    /* Takes all available vertical space */
    overflow-y: scroll;
    /* Enables vertical scrolling for this container only */
    padding: 20px;
    max-height: 400px;
    min-height: 400px;
    /* Padding for the content inside */
    background-color: #ccc5cb54;
    /* Preserving your specified color */
}

/* Modal Footer */
.modal-footer {
    padding: 20px 20px;
    display: flex;
    justify-content: space-between;

    gap: 10px;
    flex-shrink: 0;
    /* Prevents the footer from shrinking */
}

.modal-close-button {
    position: absolute;
    top: 10px;
    /* Positioned at the top right of the modal content */
    right: 10px;
    /* transform: translateY(-50%); removed to align to top */
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #fff;
    /* Match header color */
    opacity: 0.7;
    z-index: 1001;
}

.modal-close-button:hover {
    opacity: 1;
}

/* Modal Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}




/* ======================================Form Grouping and Layout=============== */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.form-group label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 600;
}

/* Inputs and Controls */
.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #fdb1ed;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.txtbox {
    width: 100%;
    padding: 4px;
    border: 1px solid #fdb1ed;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-align {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Optional: Aligns items vertically in the center */
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Checkbox and other specific form styles */
.confirm {
    line-height: 1.8em;
    color: #4c6b80;
}

/* Checkbox and other specific form styles */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

/* Other Form-related Components */
.medication-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.medication-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    background-color: #ffffff;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e0f0ff;
}

.medication-item input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 3px;
}

.medication-item label {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    cursor: pointer;
    flex-grow: 1;
}

/* Logbook Notes Styles */
.logbook-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.logbook-textarea {
    min-height: 80px;
    resize: vertical;
}

.logbook-submit-btn {
    align-self: flex-end;
    margin-top: 10px;
}

.recent-logbook-title {
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 25px;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.recent-logbook-notes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.logbook-item {
    background-color: #fdfdfd;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e9e9e9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.logbook-item-date {
    font-size: 0.85em;
    color: #777;
    margin-bottom: 5px;
    font-style: italic;
}

.logbook-item-content {
    font-size: 0.95em;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.4;
}

.logbook-item-carer {
    font-size: 0.85em;
    color: #555;
    font-weight: 500;
    text-align: right;
}

/* Client Details Styles */
.client-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.client-detail-item {
    font-size: 14px;
    color: #64628f;
    line-height: 1.4;
}

.client-detail-item strong {
    color: #5e616c;
    margin-right: 5px;
    font-size: 13px;
}

.client-medication-suite-title {
    font-size: 14px;
    font-weight: bold;
    margin-top: 35px;
    margin-bottom: 5px;
    color: #5992ab;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.client-medication-suite {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.client-medication-item {
    background-color: #f0f8ff;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e0f0ff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.client-medication-item strong {
    color: #007bff;
}

.client-medication-item p {
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
    margin-bottom: 0;
}

/* Carer Details Styles */
.carers-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 15px;
}

.carer-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.carer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.carer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.carer-header h5 {
    margin: 0;
    font-size: 1.2em;
    color: #2c3e50;
    font-weight: 600;
}

.carer-role {
    background: linear-gradient(135deg, #007bffa0, #8900b3);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.carer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.contact-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
}

.contact-value {
    color: #2c3e50;
    font-size: 1em;
    font-weight: 500;
    margin-left: 8px;
}

.contact-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.call-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.call-btn:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
}

.sms-btn {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.sms-btn:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
}

.email-btn {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    color: white;
}

.email-btn:hover {
    background: linear-gradient(135deg, #5a32a3, #4c2a85);
}

.whatsapp-btn {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
}

.whatsapp-btn:hover {
    background: linear-gradient(135deg, #128c7e, #075e54);
}

.carer-availability {
    margin-top: 15px;
    padding: 10px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

.availability-label {
    font-weight: 600;
    color: #155724;
    font-size: 0.9em;
}

.availability-value {
    color: #155724;
    margin-left: 8px;
    font-weight: 500;
}

.no-contact-info {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.no-carers-assigned {
    text-align: center;
    padding: 30px;
    color: #6c757d;
    font-style: italic;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 12px;
    border: 2px dashed #dee2e6;
    font-size: 1.1em;
}

/* Responsive design for carer details */
@media (max-width: 768px) {
    .carer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .contact-actions {
        justify-content: center;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
        min-width: 80px;
    }
}

/* WebSocket connection status styles */
.websocket-status {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.connection-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background-color: #4caf50;
}

.status-dot.disconnected {
    background-color: #f44336;
}

.status-text {
    color: #333;
}

.connection-indicator.connected .status-text {
    color: #4caf50;
}

.connection-indicator.disconnected .status-text {
    color: #f44336;
}

.connection-indicator.connecting .status-text {
    color: #ff9800;
}

.connection-indicator.error .status-text {
    color: #f44336;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Real-time update animation */
@keyframes realtime-update {
    0% {
        background-color: rgba(76, 175, 80, 0.3);
    }

    100% {
        background-color: transparent;
    }
}

.client-call.realtime-updated {
    animation: realtime-update 1s ease-out;
}

.staff-grid-row.realtime-updated {
    animation: realtime-update 1s ease-out;
}

/*====================================================
  Bootstrap Grid (Flat, No Media Queries)
  Includes: .row, .col/.col-auto, and full sets:
  .col-1..12, .col-sm-1..12, .col-md-1..12, .col-lg-1..12, .col-xl-1..12, .col-xxl-1..12,
  plus .col-{bp} and .col-{bp}-auto for each breakpoint.
====================================================*/

/* Row container */
.row {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 0;
    display: flex;
    flex-wrap: wrap;
    margin-top: calc(-1 * var(--bs-gutter-y));
    margin-right: calc(-.5 * var(--bs-gutter-x));
    margin-left: calc(-.5 * var(--bs-gutter-x));
}

.row>* {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: calc(var(--bs-gutter-x) * .5);
    padding-left: calc(var(--bs-gutter-x) * .5);
    margin-top: var(--bs-gutter-y);
}

/* Base auto columns */
.col {
    flex: 1 0 0%;
}

.col-auto {
    flex: 0 0 auto;
    width: auto;
}

/* Base fixed columns */
.col-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
}

/* 1/12 */
.col-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
}

/* 2/12 */
.col-3 {
    flex: 0 0 auto;
    width: 25%;
}

/* 3/12 */
.col-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
}

/* 4/12 */
.col-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
}

/* 5/12 */
.col-6 {
    flex: 0 0 auto;
    width: 50%;
}

/* 6/12 */
.col-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
}

/* 7/12 */
.col-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
}

/* 8/12 */
.col-9 {
    flex: 0 0 auto;
    width: 75%;
}

/* 9/12 */
.col-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
}

/* 10/12 */
.col-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
}

/* 11/12 */
.col-12 {
    flex: 0 0 auto;
    width: 100%;
}

/* 12/12 */

/* Small breakpoint (flat) */
.col-sm {
    flex: 1 0 0%;
}

.col-sm-auto {
    flex: 0 0 auto;
    width: auto;
}

.col-sm-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
}

.col-sm-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
}

.col-sm-3 {
    flex: 0 0 auto;
    width: 25%;
}

.col-sm-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
}

.col-sm-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
}

.col-sm-6 {
    flex: 0 0 auto;
    width: 50%;
}

.col-sm-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
}

.col-sm-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
}

.col-sm-9 {
    flex: 0 0 auto;
    width: 75%;
}

.col-sm-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
}

.col-sm-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
}

.col-sm-12 {
    flex: 0 0 auto;
    width: 100%;
}

/* Medium breakpoint (flat) */
.col-md {
    flex: 1 0 0%;
}

.col-md-auto {
    flex: 0 0 auto;
    width: auto;
}

.col-md-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
}

.col-md-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
}

.col-md-3 {
    flex: 0 0 auto;
    width: 25%;
}

.col-md-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
}

.col-md-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
}

.col-md-6 {
    flex: 0 0 auto;
    width: 50%;
}

.col-md-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
}

.col-md-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
}

.col-md-9 {
    flex: 0 0 auto;
    width: 75%;
}

.col-md-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
}

.col-md-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
}

.col-md-12 {
    flex: 0 0 auto;
    width: 100%;
}

/* Large breakpoint (flat) */
.col-lg {
    flex: 1 0 0%;
}

.col-lg-auto {
    flex: 0 0 auto;
    width: auto;
}

.col-lg-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
}

.col-lg-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
}

.col-lg-3 {
    flex: 0 0 auto;
    width: 25%;
}

.col-lg-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
}

.col-lg-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
}

.col-lg-6 {
    flex: 0 0 auto;
    width: 50%;
}

.col-lg-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
}

.col-lg-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
}

.col-lg-9 {
    flex: 0 0 auto;
    width: 75%;
}

.col-lg-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
}

.col-lg-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
}

.col-lg-12 {
    flex: 0 0 auto;
    width: 100%;
}

/* Extra large breakpoint (flat) */
.col-xl {
    flex: 1 0 0%;
}

.col-xl-auto {
    flex: 0 0 auto;
    width: auto;
}

.col-xl-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
}

.col-xl-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
}

.col-xl-3 {
    flex: 0 0 auto;
    width: 25%;
}

.col-xl-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
}

.col-xl-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
}

.col-xl-6 {
    flex: 0 0 auto;
    width: 50%;
}

.col-xl-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
}

.col-xl-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
}

.col-xl-9 {
    flex: 0 0 auto;
    width: 75%;
}

.col-xl-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
}

.col-xl-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
}

.col-xl-12 {
    flex: 0 0 auto;
    width: 100%;
}

/* Extra extra large breakpoint (flat) */
.col-xxl {
    flex: 1 0 0%;
}

.col-xxl-auto {
    flex: 0 0 auto;
    width: auto;
}

.col-xxl-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
}

.col-xxl-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
}

.col-xxl-3 {
    flex: 0 0 auto;
    width: 25%;
}

.col-xxl-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
}

.col-xxl-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
}

.col-xxl-6 {
    flex: 0 0 auto;
    width: 50%;
}

.col-xxl-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
}

.col-xxl-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
}

.col-xxl-9 {
    flex: 0 0 auto;
    width: 75%;
}

.col-xxl-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
}

.col-xxl-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
}

.col-xxl-12 {
    flex: 0 0 auto;
    width: 100%;
}

/* =============================== Modal Overlay & Container =============================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    /* shorthand for top, right, bottom, left */
    background-color: rgba(37, 37, 45, 0.7);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 2px;
}

.modal-content,
.modal-lg,
.modal-sm {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.25s ease-out;
}

/* Modal sizes */
.modal-content {
    border: 3px solid #96329deb;
}

.modal-long {
    max-width: 1050px;
    border-radius: 15px;
    border: 3px solid #96329deb;
}



.modal-sm {
    max-width: 400px;
    width: 50%;
    max-height: 90vh;
}

/* =============================== Modal Header =============================== */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.close-btn {
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.close-btn:hover {
    opacity: 1;
}

/* =============================== Modal Tabs =============================== */
.modal-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f7f7f7;
    padding: 10px 20px 0;
    gap: 5px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    font-size: 1rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn.active {
    color: #007bff;
    border-bottom: 3px solid #007bff;
    background-color: #fff;
}

.is_active {
    color: #131864 !important;
    background-color: #41375e36 !important;
}

.tab-btn:hover:not(.active) {
    color: #0056b3;
    background-color: #f0f0f0;
}

.tab-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.7rem;
    color: #ff5722;
}

/* =============================== Modal Body =============================== */
.modal-body {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    background-color: white;
}

/* Scrollable inner content for large content */
.modal-content-scroll {
    overflow-y: auto;
    flex-grow: 1;
    padding: 20px;
    max-height: 60vh;
    background-color: #f0f0f05c;
}

/* =============================== Toast Messages =============================== */
.toast-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #fff;
    z-index: 2000;
    animation: toastFadeIn 0.3s ease-out;
}

.toast-success {
    background-color: #28a745;
}

.toast-error {
    background-color: #dc3545;
}

.toast-icon {
    font-size: 1.2rem;
}

/* =============================== Forms & Inputs =============================== */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.form-group label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s;
    margin-bottom: 20px;
    margin-top: 5px;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Checkboxes & Small Controls */
.form-check {
    margin-bottom: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check-label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

/* =============================== Lists & Logbook =============================== */
.medication-list,
.recent-logbook-notes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.medication-item,
.logbook-item {
    background-color: #f0f8ff;
    border-radius: 8px;
    border: 1px solid #e0f0ff;
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* =============================== Client Details =============================== */
.client-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
}

.client-detail-item {
    font-size: 0.95em;
    color: #333;
    line-height: 1.4;
}

.client-detail-item strong {
    color: #000;
    margin-right: 4px;
}

/* =============================== Buttons =============================== */
button {
    transition: all 0.2s ease;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =============================== Animations =============================== */
@keyframes modalFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes toastFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================== Responsive Enhancements =============================== */
@media (max-width: 768px) {

    .modal-content,
    .modal-lg,
    .modal-sm {
        width: 95%;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
}

/* ===== Modal Overlay ===== */
.profile_modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== Modal Container ===== */
.profile_modal-container {
    background-color: #fff;
    color: #1f2937;
    padding: 0;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    max-width: 900px;
    width: 100%;
    margin: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
}

/* ===== Modal Header ===== */
.profile_modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.2rem 2rem;
    margin: 0;
    border-bottom: none;
}

.profile_modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile_modal-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 0.25rem;
    font-weight: 400;
}

/* ===== Close Button ===== */
.profile_modal-close-button {
    font-size: 1.5rem;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.profile_modal-close-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* ===== Modal Body / Layout ===== */
.profile_modal-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* ===== Profile Section ===== */
.profile_modal-profile-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile_profile-photo-container {
    position: relative;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    margin-bottom: 1rem;
}

.profile_profile-photo-container:hover {
    transform: scale(1.05);
}

.profile_profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile_profile-photo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1976d2;
}

.profile_account-id-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ===== Section Headers ===== */
.profile_section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.profile_section-icon {
    color: #667eea;
    flex-shrink: 0;
}

/* ===== Info Grid ===== */
.profile_info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.profile_info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.profile_info-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile_info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.profile_info-item:hover::before {
    opacity: 1;
}

.profile_info-icon {
    color: #667eea;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.profile_info-content {
    flex: 1;
    min-width: 0;
}

.profile_info-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.profile_info-value {
    font-size: 0.875rem;
    color: #6b7280;
    word-break: break-word;
}

.profile_info-value a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.profile_info-value a:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.profile_info-value-empty {
    color: #9ca3af;
    font-style: italic;
}

/* ===== Off Days Section ===== */
.profile_off-days-container {
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #b3e5fc;
}

.profile_off-days-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #0277bd;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.profile_off-days-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile_off-day-tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    color: #0369a1;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 1px solid #bae6fd;
    box-shadow: 0 2px 4px rgba(3, 105, 161, 0.1);
    transition: all 0.2s ease;
}

.profile_off-day-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(3, 105, 161, 0.15);
}

/* ===== Emergency Contact Section ===== */
.profile_emergency-contact-container {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #fecaca;
    margin-top: 1rem;
}

.profile_emergency-contact-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #dc2626;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.profile_emergency-contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.profile_emergency-contact-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #f9a8a8;
}

.profile_emergency-contact-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.profile_emergency-contact-value {
    font-size: 0.875rem;
    color: #6b7280;
}

.profile_emergency-contact-value a {
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.profile_emergency-contact-value a:hover {
    color: #b91c1c;
    text-decoration: underline;
}

/* ===== Responsive Design ===== */
@media (min-width: 640px) {
    .profile_info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile_emergency-contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile_profile-photo-container {
        width: 10rem;
        height: 10rem;
    }
}

@media (min-width: 768px) {
    .profile_modal-container {
        max-width: 1000px;
    }

    .profile_modal-content-wrapper {
        grid-template-columns: 300px 1fr;
        gap: 3rem;
    }

    .profile_modal-profile-column {
        position: sticky;
        top: 0;
        align-self: start;
    }
}

@media (min-width: 1024px) {
    .profile_modal-content-wrapper {
        grid-template-columns: 320px 1fr;
    }

    .profile_emergency-contact-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Scrollbar Styling ===== */
.profile_modal-content-wrapper::-webkit-scrollbar {
    width: 6px;
}

.profile_modal-content-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.profile_modal-content-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.profile_modal-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}



/* Base Styles for Components */
.focusable-grid:focus,
.client-call:focus,
.staff-action:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Added loading spinner and overlay styles for progressive loading */
.loading-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    font-size: 16px;
    color: #666;
    gap: 16px;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.mb-10 {
    margin-bottom: 20px;
}

.loading-overlay {
    position: fixed;
    top: 20%;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.306);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    gap: 16px;
}

.loading-overlay p {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.error-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    font-size: 18px;
    color: #d32f2f;
    background-color: #ffebee;
    border: 1px solid #ef9a9a;
    border-radius: 8px;
    margin: 20px;
    padding: 20px;
}

/* Base break indicator styling */
.break-indicator {
    position: absolute;
    background-color: rgb(134, 135, 137);
    height: 9px !important;
    z-index: 5;
    top: 20px;
    border-radius: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

/* Dotted pattern overlay */
.break-indicator::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.269) 1px,
            rgba(255, 255, 255, 0.406) 3px,
            transparent 3px,
            transparent 6px);
    border-radius: 2px;
}

/* Darker breaks for longer durations */
.break-indicator.dark {
    background-color: rgba(80, 80, 80, 0.991);
}

.break-indicator.dark::before {
    background-image: repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.4) 0px,
            rgba(255, 255, 255, 0.4) 3px,
            transparent 3px,
            transparent 6px);
}

/* Hover effects */
.break-indicator:hover {
    height: 8px;
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Pulse animation for longer breaks */
.break-indicator.long-break {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.9;
    }

    100% {
        opacity: 0.6;
    }
}

/* Tooltip for break duration */
.break-indicator::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-bottom: 5px;
}

.break-indicator:hover::after {
    opacity: 1;
}

/* Small arrow for tooltip */
.break-indicator::after::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

/* Break indicators in different positions */
.break-indicator.top-position {
    top: 10px;
}

.break-indicator.middle-position {
    top: 50%;
    transform: translateY(-50%);
}

.break-indicator.bottom-position {
    bottom: 10px;
    top: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .break-indicator {
        height: 3px;
        top: 15px;
    }

    .break-indicator:hover {
        height: 6px;
    }

    .break-indicator::after {
        font-size: 10px;
        padding: 2px 4px;
    }
}

/* Unavailability indicator styles */
.unavailability-indicator {
    position: absolute;
    left: 0;
    height: 10px;
    background-color: rgba(194, 146, 104, 0.491);
    /* Match inline style */
    top: 30px;
    /* Match inline style */
    border-radius: 4px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(47, 46, 46);
    font-size: 10px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.unavailability-indicator:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Holiday indicator styles */
.holiday-indicator {
    position: absolute;
    left: 0;
    width: 100%;
    height: 10px;
    background-color: rgba(237, 72, 1, 0.505);
    /* Orange color for holidays */
    top: 30px;
    border-radius: 4px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(16, 2, 32);
    font-size: 10px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.holiday-indicator:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.travel-dot {

    position: absolute;
    top: 6px;

    width: 10px;
    height: 10px;

    background: #000;
    border-radius: 50%;

    cursor: pointer;
    z-index: 5;

}

.travel-dot:hover {

    transform: scale(1.4);

}

.travel-dot {
    position: absolute;
    top: 4px;
    width: 10px;
    height: 10px;
    background: #000;
    z-index: 50;
    border-radius: 50%;
    cursor: pointer;
}
/* ==========================================
   ✅ SCROLLABLE TABS ROW (mobile friendly)
   Works on ALL screen sizes - icons stay
   beside labels, user swipes to scroll
   ========================================== */
.tabs-scroll-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;          /* never wrap - stay in one row */
    align-items: center;
    gap: 8px;
    overflow-x: auto;                      /* horizontal scroll */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;     /* smooth momentum scroll on iOS */
    scrollbar-width: none;                 /* hide scrollbar (Firefox) */
    padding: 8px 6px;
    scroll-snap-type: x proximity;         /* optional: nice snap feel */
}

/* hide scrollbar (Chrome / Safari / Edge) */
.tabs-scroll-row::-webkit-scrollbar {
    display: none;
}

/* each tab keeps its natural width - no stretching */
.tabs-scroll-row .tab-button,
.tabs-scroll-row .BackButton {
    flex: 0 0 auto !important;             /* don't grow, don't shrink */
    width: auto !important;                /* override any 100% width rule */
    min-width: max-content;
    white-space: nowrap;                   /* keep label on one line */
    flex-direction: row !important;        /* icon BESIDE text, not above */
    align-items: center;
    justify-content: center;
    gap: 6px;
    scroll-snap-align: start;
}

/* safety: make sure the parent header never clips the scroll */
.tabs-navigation,
.clients-header {
    overflow: hidden;
    max-width: 100%;
}/* Risk Assessment Badges */
.risk-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.risk-badge.low {
    background: #d1fae5;
    color: #065f46;
}

.risk-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.risk-badge.high {
    background: #fed7aa;
    color: #c2410c;
}

.risk-badge.critical {
    background: #fecaca;
    color: #991b1b;
}

.risk-rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 15px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid #6366f1;
}

.risk-emoji {
    font-size: 20px;
}

/* Hazard Items */
.hazards-list,
.domestic-risks-list,
.environment-list,
.other-risks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hazard-item,
.domestic-risk-item,
.environment-item,
.other-risk-item {
    padding: 15px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid #6366f1;
}

.hazard-title,
.domestic-risk-title,
.environment-title,
.other-risk-title {
    margin: 0 0 10px 0;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

/* Comments Section */
.comments-section {
    margin-top: 20px;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 6px;
    border-left: 4px solid #0ea5e9;
}

.comments-section .sub-section-title {
    margin: 0 0 10px 0;
    color: #0369a1;
    font-size: 16px;
}

.comments-text {
    margin: 0;
    color: #475569;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* No Data Message */
.no-data {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 6px;
}
/* Support Plan Page Styles */
.support-plan-page {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.client-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.client-name,
.client-postcode {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #495057;
}

.client-emoji,
.postcode-emoji {
    font-size: 18px;
}

.support-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.support-plan-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.support-plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}


.basic-info-card .card-header {
        background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
}

.personal-details-card .card-header {
        background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
}

.visit-requirements-card .card-header {
        background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
}

.health-card .card-header {
        background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
}

.contacts-card .card-header {
        background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
}

.risk-card .card-header {
        background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.card-content {
    padding: 20px;
}

.sub-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin: 20px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.support-plan-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.support-plan-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4299e1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.support-plan-item:hover {
    background-color: #f1f3f5;
    transform: translateX(3px);
}

.item-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.item-value {
    color: #4a5568;
    font-size: 15px;
    line-height: 1.5;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #4299e1;
}

.contact-item h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2d3748;
    font-weight: 600;
}

.contact-item h5 {
    margin-top: 15px;
    margin-bottom: 5px;
    color: #4a5568;
    font-weight: 600;
    font-size: 14px;
}

.contact-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.no-data {
    color: #718096;
    font-style: italic;
    padding: 10px 0;
}

.support-plan-footer {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    text-align: right;
    color: #718096;
}

.notification {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-weight: 500;
}

.notification.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notification.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .support-plan-page {
        padding: 15px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .client-info {
        align-items: flex-start;
    }

    .support-plan-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-content {
        padding: 15px;
    }

    .contact-details {
        grid-template-columns: 1fr;
    }
}

/* Loading and Error States */
.tab-loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    font-size: 16px;
    color: #4a5568;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-error-state {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    font-size: 16px;
    color: #e53e3e;
    background-color: #fff5f5;
    border-radius: 8px;
    border: 1px solid #feb2b2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}/* ===================================
   BODY MAP COMPONENTS - COMPLETE CSS
   =================================== */
.camera-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

.camera-switch-buttons {
    display: flex;
    gap: 10px;
}

.camera-switch-button {
    padding: 8px 12px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.camera-switch-button:hover {
    background-color: #e0e0e0;
}

.camera-switch-button.active {
    background-color: #4CAF50;
    color: white;
    border-color: #45a049;
}

/* ===== BODY MAP CONTAINER ===== */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.camera-video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background-color: #000;
}

.camera-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.switch-camera-button {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.switch-camera-button:hover {
    background-color: #357ab8;
}

.capture-button {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #daeb29a8;
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.capture-button:hover {
    background-color: #c0392b;
}

.camera-canvas {
    display: none;
}

.camera-loading {
    color: #666;
    font-size: 14px;
}

.switch-camera-button {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.switch-camera-button:hover {
    background-color: #357ab8;
}

.capture-button:hover:not(:disabled) {
    background-color: #c0392b;
    transform: scale(1.05);
}

.capture-button:disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.camera-canvas {
    display: none;
}

.camera-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    padding: 8px;
    background-color: #ffeaea;
    border-radius: 4px;
}

.bodymap-header {
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 1px;
    border-bottom: 2px solid #e0e0e0;
}

.bodymap-header h3 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
}

.bodymap-header p {
    margin: 0;
    color: #7f8c8d;
    font-size: 16px;
}

/* ===== BODY MAP VIEWS ===== */
.bodymap-views {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.bodymap-view {
    flex: 1;
    background-color: white;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.bodymap-view h4 {
    text-align: center;
    margin: 0 0 15px 0;
    color: #34495e;
    font-size: 18px;
    font-weight: 500;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

/* ===== BODY MAP FIGURE ===== */
.bodymap-figure {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    background-color: #fafafa;
    border-radius: 8px;
    padding: 10px;
}

.bodymap-figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* Add to bodymap.css */

.image-error-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    background-color: #f5f5f5;
    border: 1px dashed #ddd;
    border-radius: 4px;
    color: #888;
    font-size: 14px;
}

/* Add to bodymap.css */

.camera-error {
    background-color: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 14px;
}

.camera-not-supported {
    color: #7f8c8d;
    font-style: italic;
    padding: 5px 0;
    font-size: 14px;
}

/* Add to bodymap.css */

.image-loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.small-spinner {
    border: 2px solid rgba(0, 0, 0, 0.1);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border-left-color: #3498db;
    animation: spin 1s linear infinite;
}

.large-spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: #3498db;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== BODY MAP POINTS ===== */
.bodymap-point {
    position: absolute;
    width: 28px;
    height: 28px;
    background-color: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    transform: translate(-50%, -50%);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    border: 2px solid white;
}

.bodymap-point:hover {
    background-color: #2980b9;
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.bodymap-point.has-entry {
    background-color: #e74c3c;
    border-color: #c0392b;
}

.bodymap-point.has-entry:hover {
    background-color: #c0392b;
}

/* Adjust font size for two-digit numbers */
.bodymap-point .bodymap-number {
    line-height: 1;
    user-select: none;
}

/* ===== ERROR MESSAGES ===== */
.bodymap-error {
    background-color: #fee;
    color: #c33;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #c33;
    font-size: 14px;
}

/* ===== MODAL STYLES ===== */
.bodymap-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.bodymap-modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bodymap-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #ecf0f1;
    background-color: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.bodymap-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.bodymap-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #95a5a6;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.bodymap-modal-close:hover {
    background-color: #ecf0f1;
    color: #7f8c8d;
}

/* ===== FORM STYLES ===== */
.bodymap-form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input[type="file"] {
    display: none;
}

.image-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.upload-button,
.camera-button {
    background-color: #ecf0f1;
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    display: inline-block;
    transition: all 0.3s ease;
    color: #7f8c8d;
    font-weight: 500;
}

.upload-button:hover,
.camera-button:hover {
    background-color: #e8eaeb;
    border-color: #95a5a6;
    color: #34495e;
}

.camera-button {
    border-style: solid;
    border-color: #3498db;
    color: #3498db;
}

.camera-button:hover {
    background-color: #e1f0fa;
}

/* ===== CAMERA STYLES ===== */
.camera-container {
    position: relative;
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
}

.camera-video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.camera-canvas {
    display: none;
}


.image-preview {
    margin-top: 15px;
    text-align: center;
    position: relative;
}

.image-preview img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    border: 1px solid #ecf0f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.remove-image-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-image-button:hover {
    background-color: #c0392b;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.cancel-button,
.submit-button {
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.cancel-button {
    background-color: #ecf0f1;
    color: #7f8c8d;
}

.cancel-button:hover {
    background-color: #d5dbdd;
    color: #34495e;
}

.submit-button {
    background-color: #3498db;
    color: white;
}

.submit-button:hover:not(:disabled) {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.submit-button:disabled {
    background-color: #aed6f1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== TOAST NOTIFICATION ===== */
.bodymap-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #27ae60;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    animation: toastSlideIn 0.4s ease-out;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bodymap-toast::before {
    content: "✓";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: white;
    color: #27ae60;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== BODY MAP DETAILS ===== */
.bodymap-details-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    background-color: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.bodymap-details-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.bodymap-details-header h3 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
}

.bodymap-details-header p {
    margin: 0;
    color: #7f8c8d;
    font-size: 16px;
}

.bodymap-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: #3498db;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.bodymap-empty {
    text-align: center;
    padding: 60px;
    background-color: white;
    border-radius: 10px;
    color: #7f8c8d;
    font-size: 16px;
}

.bodymap-entries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.bodymap-entry-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bodymap-entry-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ecf0f1;
}

.entry-header h4 {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
    font-weight: 600;
}

.entry-date {
    font-size: 12px;
    color: #95a5a6;
    white-space: nowrap;
}

.entry-content {
    padding: 20px;
}

.entry-content p {
    margin: 0 0 12px 0;
    color: #34495e;
    line-height: 1.5;
    font-size: 14px;
}

.entry-thumbnail {
    margin-top: 12px;
    text-align: center;
}

.entry-thumbnail img {
    max-width: 100%;
    max-height: 140px;
    border-radius: 6px;
    border: 1px solid #ecf0f1;
}

.bodymap-entry-details {
    padding: 24px;
}

.entry-detail-section {
    margin-bottom: 24px;
}

.entry-detail-section:last-child {
    margin-bottom: 0;
}

.entry-detail-section h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #ecf0f1;
}

.entry-detail-section p {
    margin: 0;
    color: #34495e;
    line-height: 1.6;
}

.entry-image {
    text-align: center;
}

.entry-image img {
    max-width: 100%;
    max-height: 320px;
    border-radius: 8px;
    border: 1px solid #ecf0f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.entry-location {
    position: relative;
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.location-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #ecf0f1;
}

.location-point {
    position: absolute;
    width: 28px;
    height: 28px;
    background-color: #e74c3c;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
    .bodymap-views {
        flex-direction: column;
        gap: 20px;
    }

    .bodymap-entries-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {

    .bodymap-container,
    .bodymap-details-container {
        padding: 15px;
        border-radius: 8px;
    }

    .bodymap-header h3,
    .bodymap-details-header h3 {
        font-size: 24px;
    }

    .bodymap-view {
        padding: 15px;
    }

    .bodymap-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .bodymap-form {
        padding: 20px;
    }

    .bodymap-entries-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .bodymap-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
    }

    .image-options {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .bodymap-point {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .entry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .form-actions {
        flex-direction: column;
    }

    .cancel-button,
    .submit-button {
        width: 100%;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* ===== FOCUS STYLES FOR ACCESSIBILITY ===== */
.bodymap-point:focus,
.upload-button:focus,
.camera-button:focus,
.cancel-button:focus,
.submit-button:focus,
.bodymap-modal-close:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {

    .bodymap-modal,
    .bodymap-toast {
        display: none !important;
    }

    .bodymap-container,
    .bodymap-details-container {
        box-shadow: none;
        background-color: white;
    }

    .bodymap-entry-card {
        break-inside: avoid;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
}/* Financial Transaction Component Styles */

/* ============================================
   BASE / DESKTOP STYLES
   ============================================ */

.financialtransaction-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    min-height: 600px;
}

.financialtransaction-header {
    margin-bottom: 20px;
}

.financialtransaction-view-toggle {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}

.financialtransaction-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-radius: 6px 6px 0 0;
}

.financialtransaction-tab:hover {
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.04);
}

.financialtransaction-tab.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
    background: rgba(79, 70, 229, 0.06);
}

/* Form Styles */
.financialtransaction-form {
    background: white;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.financialtransaction-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 8px;
}

.financialtransaction-form-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
}

.financialtransaction-client-info {
    display: flex;
    gap: 12px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.financialtransaction-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.financialtransaction-form-group {
    margin-bottom: 0;
}

.financialtransaction-form-group.financialtransaction-full-width {
    grid-column: 1 / -1;
}

.financialtransaction-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #334155;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.financialtransaction-required {
    color: #e11d48;
    margin-left: 2px;
}

.financialtransaction-input,
.financialtransaction-select,
.financialtransaction-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background: #fafafa;
    color: #1e293b;
    min-height: 40px;
}

.financialtransaction-input:focus,
.financialtransaction-select:focus,
.financialtransaction-textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    background: white;
}

.financialtransaction-textarea {
    resize: vertical;
    min-height: 72px;
}

.financialtransaction-currency-input {
    position: relative;
    display: flex;
    align-items: center;
}

.financialtransaction-currency-symbol {
    position: absolute;
    left: 12px;
    color: #64748b;
    font-weight: 600;
    pointer-events: none;
    font-size: 14px;
}

.financialtransaction-currency-input .financialtransaction-input {
    padding-left: 28px;
}

/* Items Section */
.financialtransaction-items-section {
    margin: 20px 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.financialtransaction-section-title {
    margin: 0 0 14px 0;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.financialtransaction-items-header {
    display: grid;
    grid-template-columns: 1fr 110px 70px 44px;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.financialtransaction-item-row {
    display: grid;
    grid-template-columns: 1fr 110px 70px 44px;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.financialtransaction-item-col-item,
.financialtransaction-item-col-price,
.financialtransaction-item-col-qty,
.financialtransaction-item-col-action {
    display: flex;
    align-items: center;
}

.financialtransaction-btn-remove {
    width: 36px;
    height: 36px;
    border: none;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.financialtransaction-btn-remove:hover {
    background: #fecaca;
    transform: scale(1.05);
}

.financialtransaction-btn-add-item {
    padding: 10px 16px;
    background: white;
    border: 2px dashed #c7d2fe;
    color: #4f46e5;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    margin-bottom: 16px;
    width: 100%;
}

.financialtransaction-btn-add-item:hover {
    border-color: #4f46e5;
    background: #eef2ff;
}

/* Totals */
.financialtransaction-totals {
    background: white;
    padding: 14px 16px;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid #e2e8f0;
}

.financialtransaction-total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    font-size: 14px;
}

.financialtransaction-total-row:last-child {
    border-bottom: none;
}

.financialtransaction-total-amount {
    font-weight: 700;
    color: #0f172a;
    font-family: 'SF Mono', Monaco, monospace;
}

.financialtransaction-balance-row {
    font-size: 15px;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 2px solid #e2e8f0;
}

.financialtransaction-balance-amount {
    font-size: 17px;
    font-family: 'SF Mono', Monaco, monospace;
}

.financialtransaction-balance-amount.negative {
    color: #dc2626;
}

/* Upload Area */
.financialtransaction-hint {
    font-size: 12px;
    color: #64748b;
    margin: 4px 0 10px 0;
    line-height: 1.5;
}

.financialtransaction-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.financialtransaction-upload-area:hover {
    border-color: #4f46e5;
    background: #eef2ff;
}

.financialtransaction-upload-placeholder {
    color: #64748b;
}

.financialtransaction-upload-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
}

.financialtransaction-upload-placeholder p {
    margin: 6px 0 3px 0;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.financialtransaction-upload-placeholder small {
    color: #9ca3af;
    font-size: 12px;
}

.financialtransaction-file-input {
    display: none;
}

.financialtransaction-preview-container {
    position: relative;
    display: inline-block;
}

.financialtransaction-preview {
    max-width: 100%;
    max-height: 260px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.financialtransaction-remove-preview {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    background: rgba(220, 38, 38, 0.92);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.financialtransaction-remove-preview:hover {
    background: #dc2626;
}

/* Form Actions */
.financialtransaction-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.financialtransaction-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.financialtransaction-btn-primary {
    background: #4f46e5;
    color: white;
}

.financialtransaction-btn-primary:hover:not(:disabled) {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.financialtransaction-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.financialtransaction-btn-secondary:hover {
    background: #e2e8f0;
}

.financialtransaction-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Transaction Log */
.financialtransaction-log {
    background: white;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.financialtransaction-filters {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.financialtransaction-filters h3 {
    margin: 0 0 14px 0;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.financialtransaction-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 10px;
    align-items: end;
}

.financialtransaction-filter-group {
    display: flex;
    flex-direction: column;
}

.financialtransaction-filter-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    min-height: 16px;
}

.financialtransaction-filter-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.financialtransaction-clear-btn {
    width: 100%;
    padding: 9px 14px;
    text-align: center;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.financialtransaction-results-count {
    color: #64748b;
    font-size: 13px;
    margin: 10px 0 0 0;
    font-weight: 500;
}

.financialtransaction-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.financialtransaction-log-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
}

.financialtransaction-log-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.financialtransaction-total-display {
    font-size: 14px;
    font-weight: 700;
    color: #4f46e5;
    background: #eef2ff;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: 'SF Mono', Monaco, monospace;
    border: 1px solid #c7d2fe;
}

.financialtransaction-loading,
.financialtransaction-no-data {
    text-align: center;
    padding: 48px 20px;
    color: #64748b;
    font-size: 15px;
    font-weight: 500;
}

/* Transaction Cards */
.financialtransaction-transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.financialtransaction-transaction-card {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s;
}

.financialtransaction-transaction-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
    border-color: #d1d5db;
}

.financialtransaction-transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.financialtransaction-transaction-type {
    background: #dbeafe;
    color: #1e40af;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.financialtransaction-transaction-amount {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    font-family: 'SF Mono', Monaco, monospace;
}

.financialtransaction-transaction-shop {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.financialtransaction-transaction-meta {
    color: #64748b;
    font-size: 12px;
    margin-bottom: 12px;
    font-weight: 500;
}

.financialtransaction-transaction-items {
    margin: 12px 0;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.financialtransaction-item-line {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #374151;
}

.financialtransaction-item-line:last-child {
    border-bottom: none;
}

.financialtransaction-transaction-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #f1f5f9;
    font-size: 13px;
    font-weight: 600;
}

.financialtransaction-balance-value {
    color: #64748b;
}

.financialtransaction-balance-value strong.positive {
    color: #16a34a;
}

.financialtransaction-balance-value strong.negative {
    color: #dc2626;
}

.financialtransaction-transaction-notes {
    background: #fefce8;
    padding: 10px 12px;
    border-radius: 8px;
    color: #854d0e;
    font-size: 13px;
    margin: 10px 0;
    border-left: 3px solid #eab308;
    line-height: 1.5;
}

.financialtransaction-transaction-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.financialtransaction-transaction-footer small {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 500;
}

.financialtransaction-btn-edit {
    padding: 6px 14px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    min-height: 32px;
}

.financialtransaction-btn-edit:hover {
    background: #4338ca;
}

/* Delete Button */
.financialtransaction-btn-delete {
    padding: 6px 14px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    min-height: 32px;
}

.financialtransaction-btn-delete:hover {
    background: #dc2626;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.financialtransaction-transaction-actions {
    display: flex;
    gap: 6px;
}

/* Toast Notifications */
.financialtransaction-toast {
    position: fixed;
    top: 16px;
    right: 16px;
    padding: 14px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(420px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 380px;
    line-height: 1.4;
}

.financialtransaction-toast-show {
    transform: translateX(0);
}

.financialtransaction-toast-success {
    background: #10b981;
}

.financialtransaction-toast-error {
    background: #ef4444;
}

.financialtransaction-toast-info {
    background: #3b82f6;
}

.financialtransaction-toast-icon {
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.financialtransaction-toast-message {
    flex: 1;
}

/* Custom Confirmation Modal */
.financialtransaction-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
    padding: 16px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.financialtransaction-confirm-modal {
    background: white;
    border-radius: 14px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(16px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.financialtransaction-confirm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.financialtransaction-confirm-icon {
    font-size: 28px;
}

.financialtransaction-confirm-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
}

.financialtransaction-confirm-body {
    margin-bottom: 20px;
}

.financialtransaction-confirm-body p {
    margin: 6px 0;
    color: #475569;
    line-height: 1.6;
    font-size: 14px;
}

.financialtransaction-confirm-warning {
    color: #dc2626;
    font-weight: 700;
    font-size: 13px;
}

.financialtransaction-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.financialtransaction-btn-danger {
    background: #dc2626;
    color: white;
}

.financialtransaction-btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

/* ============================================
   TABLET (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    .financialtransaction-container {
        padding: 12px;
        border-radius: 10px;
    }

    .financialtransaction-form {
        padding: 16px;
        border-radius: 10px;
    }

    .financialtransaction-form-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .financialtransaction-form-header h2 {
        font-size: 16px;
    }

    .financialtransaction-client-info {
        font-size: 12px;
        gap: 8px;
    }

    .financialtransaction-form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 16px;
    }

    .financialtransaction-items-section {
        padding: 12px;
        margin: 16px 0;
    }

    .financialtransaction-items-header {
        grid-template-columns: 1fr 90px 55px 40px;
        gap: 8px;
        font-size: 10px;
    }

    .financialtransaction-item-row {
        grid-template-columns: 1fr 90px 55px 40px;
        gap: 8px;
        margin-bottom: 8px;
    }

    .financialtransaction-input,
    .financialtransaction-select,
    .financialtransaction-textarea {
        padding: 8px 10px;
        font-size: 16px; /* Prevents iOS zoom */
        min-height: 42px;
    }

    .financialtransaction-totals {
        padding: 12px;
    }

    .financialtransaction-upload-area {
        padding: 16px;
    }

    .financialtransaction-upload-icon {
        font-size: 36px;
    }

    .financialtransaction-form-actions {
        flex-direction: column-reverse;
        gap: 8px;
        margin-top: 16px;
        padding-top: 14px;
    }

    .financialtransaction-btn {
        width: 100%;
        padding: 12px 16px;
        min-height: 44px;
        font-size: 14px;
    }

    .financialtransaction-log {
        padding: 16px;
    }

    .financialtransaction-filters {
        margin-bottom: 16px;
        padding-bottom: 14px;
    }

    .financialtransaction-filters-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        align-items: stretch;
    }

    .financialtransaction-filter-group:last-child {
        grid-column: 1 / -1;
    }

    .financialtransaction-clear-btn {
        margin-top: 0;
        height: 42px;
    }

    .financialtransaction-log-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .financialtransaction-log-actions {
        width: 100%;
        justify-content: space-between;
    }

    .financialtransaction-transaction-card {
        padding: 14px;
    }

    .financialtransaction-transaction-amount {
        font-size: 16px;
    }

    .financialtransaction-transaction-shop {
        font-size: 15px;
    }

    .financialtransaction-transaction-balance {
        flex-direction: row;
        gap: 8px;
        text-align: left;
    }

    .financialtransaction-transaction-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .financialtransaction-transaction-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .financialtransaction-toast {
        left: 12px;
        right: 12px;
        max-width: none;
        top: 12px;
        transform: translateY(-120%);
    }

    .financialtransaction-toast-show {
        transform: translateY(0);
    }
}

/* ============================================
   MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    .financialtransaction-container {
        padding: 8px;
        border-radius: 0;
        background: #f1f5f9;
    }

    .financialtransaction-header {
        margin-bottom: 12px;
    }

    .financialtransaction-view-toggle {
        gap: 2px;
    }

    .financialtransaction-tab {
        padding: 10px 12px;
        font-size: 13px;
        flex: 1;
        text-align: center;
        justify-content: center;
    }

    .financialtransaction-form {
        padding: 14px;
        border-radius: 10px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }

    .financialtransaction-form-header {
        margin-bottom: 14px;
    }

    .financialtransaction-form-header h2 {
        font-size: 15px;
    }

    .financialtransaction-label {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .financialtransaction-input,
    .financialtransaction-select,
    .financialtransaction-textarea {
        padding: 8px 10px;
        font-size: 16px;
        border-radius: 8px;
    }

    /* Items section - stack layout for very small screens */
    .financialtransaction-items-section {
        padding: 12px;
        margin: 14px 0;
    }

    .financialtransaction-section-title {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .financialtransaction-items-header {
        display: none; /* Hide header on very small screens */
    }

    .financialtransaction-item-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "item item"
            "price qty"
            "action action";
        gap: 8px;
        margin-bottom: 14px;
        padding: 12px;
        background: white;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
        position: relative;
    }

    .financialtransaction-item-row:last-child {
        margin-bottom: 10px;
    }

    .financialtransaction-item-col-item {
        grid-area: item;
    }

    .financialtransaction-item-col-item::before {
        content: "Item";
        display: block;
        font-size: 10px;
        font-weight: 700;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 4px;
    }

    .financialtransaction-item-col-price {
        grid-area: price;
    }

    .financialtransaction-item-col-price::before {
        content: "Price";
        display: block;
        font-size: 10px;
        font-weight: 700;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 4px;
    }

    .financialtransaction-item-col-qty {
        grid-area: qty;
    }

    .financialtransaction-item-col-qty::before {
        content: "Qty";
        display: block;
        font-size: 10px;
        font-weight: 700;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 4px;
    }

    .financialtransaction-item-col-action {
        grid-area: action;
        justify-content: flex-end;
        padding-top: 4px;
        border-top: 1px solid #f1f5f9;
    }

    .financialtransaction-item-col-action::before {
        content: "";
        display: none;
    }

    .financialtransaction-btn-remove {
        width: 100%;
        height: 36px;
        font-size: 14px;
        background: #fef2f2;
        color: #dc2626;
        border-radius: 6px;
    }

    .financialtransaction-btn-remove::before {
        content: "Remove item";
        font-size: 12px;
        font-weight: 600;
        margin-right: 4px;
    }

    .financialtransaction-btn-add-item {
        padding: 10px;
        font-size: 13px;
        margin-bottom: 12px;
    }

    .financialtransaction-totals {
        padding: 12px;
        margin-top: 8px;
    }

    .financialtransaction-total-row {
        font-size: 13px;
        padding: 5px 0;
    }

    .financialtransaction-balance-row {
        font-size: 14px;
        padding-top: 8px;
        margin-top: 4px;
    }

    .financialtransaction-balance-amount {
        font-size: 15px;
    }

    .financialtransaction-upload-area {
        padding: 16px 12px;
    }

    .financialtransaction-upload-icon {
        font-size: 32px;
    }

    .financialtransaction-upload-placeholder p {
        font-size: 13px;
    }

    .financialtransaction-preview {
        max-height: 200px;
    }

    .financialtransaction-form-actions {
        margin-top: 16px;
        padding-top: 12px;
        gap: 8px;
    }

    .financialtransaction-btn {
        padding: 11px 16px;
        font-size: 14px;
        min-height: 44px;
    }

    .financialtransaction-log {
        padding: 14px;
        border-radius: 10px;
    }

    .financialtransaction-filters h3 {
        font-size: 12px;
    }

    .financialtransaction-filters-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .financialtransaction-filter-group:last-child {
        grid-column: auto;
    }

    .financialtransaction-clear-btn {
        width: 100%;
    }

    .financialtransaction-log-header h3 {
        font-size: 15px;
    }

    .financialtransaction-log-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .financialtransaction-total-display {
        width: 100%;
        text-align: center;
        font-size: 14px;
    }

    .financialtransaction-transaction-card {
        padding: 14px;
        border-radius: 10px;
    }

    .financialtransaction-transaction-header {
        margin-bottom: 8px;
    }

    .financialtransaction-transaction-amount {
        font-size: 17px;
    }

    .financialtransaction-transaction-shop {
        font-size: 15px;
        margin-bottom: 4px;
    }

    .financialtransaction-transaction-meta {
        font-size: 11px;
        margin-bottom: 10px;
    }

    .financialtransaction-transaction-items {
        padding: 8px 10px;
        margin: 10px 0;
    }

    .financialtransaction-item-line {
        font-size: 12px;
        padding: 4px 0;
    }

    .financialtransaction-transaction-balance {
        padding: 8px 10px;
        font-size: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .financialtransaction-transaction-notes {
        padding: 8px 10px;
        font-size: 12px;
    }

    .financialtransaction-transaction-footer {
        margin-top: 10px;
        padding-top: 10px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .financialtransaction-transaction-footer small {
        font-size: 10px;
        width: 100%;
        order: 2;
    }

    .financialtransaction-transaction-actions {
        width: 100%;
        justify-content: flex-end;
        order: 1;
    }

    .financialtransaction-btn-edit,
    .financialtransaction-btn-delete {
        padding: 8px 14px;
        font-size: 12px;
        min-height: 36px;
        flex: 1;
    }

    .financialtransaction-confirm-modal {
        padding: 20px;
        border-radius: 12px;
    }

    .financialtransaction-confirm-header h3 {
        font-size: 16px;
    }

    .financialtransaction-confirm-actions {
        flex-direction: column-reverse;
    }

    .financialtransaction-confirm-actions .financialtransaction-btn {
        width: 100%;
    }
}

/* ============================================
   VERY SMALL SCREENS (max-width: 360px)
   ============================================ */
@media (max-width: 360px) {
    .financialtransaction-container {
        padding: 6px;
    }

    .financialtransaction-tab {
        padding: 8px 8px;
        font-size: 12px;
    }

    .financialtransaction-form {
        padding: 12px;
    }

    .financialtransaction-item-row {
        padding: 10px;
    }

    .financialtransaction-transaction-card {
        padding: 12px;
    }

    .financialtransaction-transaction-amount {
        font-size: 15px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .financialtransaction-header,
    .financialtransaction-filters,
    .financialtransaction-log-actions,
    .financialtransaction-btn-edit,
    .financialtransaction-btn-delete,
    .financialtransaction-form-actions,
    .financialtransaction-toast,
    .financialtransaction-modal-overlay {
        display: none !important;
    }

    .financialtransaction-container {
        background: white;
        padding: 0;
    }

    .financialtransaction-transaction-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ddd;
    }
}/* ============================================
   CLIENT PROFILE
   Scoped under .cp-root so it can't clash with global styles.
   ============================================ */

.cp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.cp-root {
  --cp-navy: #002060;
  --cp-ink: #1b2430;
  --cp-muted: #6b7686;
  --cp-line: #e4e8f1;
  --cp-surface: #ffffff;
  --cp-tint: #eef2fb;

  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 2px 24px;
  color: var(--cp-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Profile hero ---------- */
.cp-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 16px 18px;
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(232, 32, 218, 0.28) 0%, rgba(232, 32, 218, 0) 55%),
    linear-gradient(160deg, #002060 0%, #0a3190 100%);
  color: #ffffff;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 32, 96, 0.25);
}

.cp-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #dfe7f7, #f6d9f3);
  color: var(--cp-navy);
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.95), 0 0 0 7px rgba(232, 32, 218, 0.55);
  user-select: none;
}

.cp-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cp-hero-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cp-hero-name {
  margin: 0;
  padding: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
  background: none;
  border: none;
}

.cp-hero-pref {
  margin: 0;
  font-size: 13px;
  color: #c9d6f5;
}

.cp-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.cp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.cp-chip-warn {
  background: rgba(255, 190, 80, 0.25);
  color: #ffe2a6;
}

.cp-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.cp-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 104px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--cp-navy);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.cp-action:hover {
  transform: translateY(-1px);
  background: #f1f4fc;
}

.cp-action-alt {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.cp-action-alt:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* ---------- Card grid ---------- */
.cp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.cp-card {
  --tone: #1650c7;
  --tone-soft: #eaf0fd;

  background: var(--cp-surface);
  border: 1px solid var(--cp-line);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
  overflow: hidden;
}

.cp-tone-blue   { --tone: #1650c7; --tone-soft: #eaf0fd; }
.cp-tone-purple { --tone: #7a2fc4; --tone-soft: #f2eafc; }
.cp-tone-green  { --tone: #17824a; --tone-soft: #e6f5ec; }
.cp-tone-amber  { --tone: #b7790a; --tone-soft: #fdf3dc; }
.cp-tone-red    { --tone: #c0392b; --tone-soft: #fdecea; }

.cp-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--cp-ink);
  text-align: left;
  background: var(--cp-tint);
  border: none;
  border-bottom: 1px solid var(--cp-line);
  border-left: 4px solid var(--tone);
}

.cp-card-title-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--tone-soft);
  color: var(--tone);
}

.cp-card-body {
  display: flex;
  flex-direction: column;
}

/* ---------- Detail rows ---------- */
.cp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--cp-line);
}

.cp-row:last-child {
  border-bottom: none;
}

.cp-row-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--tone-soft);
  color: var(--tone);
}

.cp-row-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.cp-row-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--cp-muted);
  line-height: 1.2;
}

.cp-row-value {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--cp-ink);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cp-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.cp-row-empty {
  font-size: 13px;
  font-style: italic;
  color: #a2abba;
}

.cp-link {
  color: #1650c7;
  text-decoration: none;
}

.cp-link:hover {
  text-decoration: underline;
}

/* ---------- Free-text blocks ---------- */
.cp-text {
  margin: 0;
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.65;
  color: #2b3442;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cp-text-empty {
  font-size: 13px;
  font-style: italic;
  color: #a2abba;
}

/* ---------- Larger screens ---------- */
@media (min-width: 700px) {
  .cp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .cp-card-wide {
    grid-column: 1 / -1;
  }

  .cp-hero {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 22px;
    padding: 22px 28px;
  }

  .cp-hero-main {
    align-items: flex-start;
  }

  .cp-chips {
    justify-content: flex-start;
  }

  .cp-hero-name {
    font-size: 26px;
  }
}

@media (min-width: 1200px) {
  .cp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}/* ==========================================================================
   ROTA GRID – ONE MERGED STYLESHEET
   (replaces RotaGrid.css + RotaGridTheme.css – delete RotaGridTheme.css)

   PART 1  Shared / base styles used by the rest of the app
           (modals, forms, bootstrap-style grid, profile modal, toasts, …)
   PART 2  Rota grid base layout
   PART 3  Professional full-screen rota theme  (scoped to .rota-container)
   ========================================================================== */


/* ==========================================================================
   PART 1 – SHARED / BASE
   ========================================================================== */

/* ---------- Tabs ---------- */
.tabs-navigation {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tabs-navigation::-webkit-scrollbar { display: none; }
.tabs-list { display: flex; flex-wrap: nowrap; gap: 8px; min-width: max-content; }
.tab-button { white-space: nowrap; flex-shrink: 0; }

.tabs-scroll-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 6px;
  scroll-snap-type: x proximity;
}
.tabs-scroll-row::-webkit-scrollbar { display: none; }
.tabs-scroll-row .tab-button,
.tabs-scroll-row .BackButton {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: max-content;
  white-space: nowrap;
  flex-direction: row !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  scroll-snap-align: start;
}
.tabs-navigation,
.clients-header { overflow: hidden; max-width: 100%; }

/* ---------- Focus ---------- */
.focusable-grid:focus,
.client-call:focus,
.staff-action:focus { outline: 2px solid #007bff; outline-offset: 2px; }

/* ---------- Spinner ---------- */
.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #fff;
  border-right: 2px solid #333;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ---------- Drag indicator ---------- */
.drag-indicator {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background-color: #ff5722; z-index: 10; pointer-events: none;
  display: flex; justify-content: center; align-items: flex-start;
}
.drag-indicator-time {
  position: absolute; top: -25px; padding: 2px 5px;
  background-color: #ff5722; color: #fff; font-size: 10px;
  white-space: nowrap; border-radius: 3px; transform: translateX(-50%); z-index: 10;
}

/* ---------- Break time bar ---------- */
.break-time-bar { pointer-events: none; user-select: none; box-sizing: border-box; z-index: 0; }
.break-time-bar:hover { opacity: 0.9; }
.staff-timeline { position: relative; }
.client-call { position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.location {
  padding: 2px; margin-left: 10px;
  box-shadow: 0 4px 6px rgba(55, 49, 68, 0.265);
  cursor: pointer; font-weight: bold; border-radius: 5px;
  border: 1px solid rgba(36, 155, 223, 0.507);
}
.btn { padding: 8px 12px; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; transition: background-color 0.2s ease; }
.btn:hover { filter: brightness(110%); }
.btn-primary { background-color: #007bff; color: #fff; }
.btn-primary:hover { background-color: #0056b3; }
.btn-lg { width: 20%; }
.btn-secondary { background-color: #6c757d; color: #fff; }
.btn-secondary:hover { background-color: #545b62; }
.btn-success { background-color: #28a745; color: #fff; }
.btn-success:hover { background-color: #1e7e34; }

.staff-action {
  background: none; border: none; cursor: pointer; padding: 2px;
  font-size: 9px; border-radius: 4px; transition: all 0.2s ease; opacity: 0.7;
}
.staff-action:hover { opacity: 1; background: rgba(226, 27, 200, 0.2); transform: scale(1.1); }
.staff-action.email { border: 1px solid rgb(191, 204, 231); padding: 0; }
.staff-action:focus { outline-offset: 1px; }

button { transition: all 0.2s ease; }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.lock-toggle-btn {
  background: none; border: none; font-size: 16px; cursor: pointer;
  padding: 1px; margin-top: 2px; margin-bottom: 4px; border-radius: 4px;
  transition: all 0.2s ease; display: flex; align-items: center; justify-content: center;
}
.lock-toggle-btn:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.1); }
.lock-toggle-btn.locked { color: #ff6b6b; background: rgba(84, 115, 12, 0.354); }
.lock-toggle-btn.unlocked { color: #51cf66; background: rgba(81, 207, 102, 0.1); }

/* ---------- Priority indicators ---------- */
.client-call.priority-high { border-left: 4px solid #ff4444; }
.client-call.priority-medium { border-left: 4px solid #ff9800; }
.client-call.priority-low { border-left: 4px solid #4caf50; }
.priority-indicator {
  background: #1b2a4e; color: #fff; border-radius: 50%; width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: bold; margin-left: 4px; animation: pulse-priority 2s infinite;
}
@keyframes pulse-priority { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modalFadeIn { 0% { opacity: 0; transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }
@keyframes toastFadeIn { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(20px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(20px); }
}
@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 0.9; } 100% { opacity: 0.6; } }
@keyframes pulse-time-line { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes realtime-update { 0% { background-color: rgba(76, 175, 80, 0.3); } 100% { background-color: transparent; } }

/* ---------- Loading / error ---------- */
.loading-state {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  min-height: 400px; height: 6px; font-size: 16px; color: #666; gap: 16px;
  backdrop-filter: blur(4px); border-radius: 8px;
  background: rgba(134, 8, 126, 0.9);
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 1000;
}
.loading-overlay {
  position: fixed; top: 20%; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.306);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  z-index: 9999; gap: 16px;
}
.loading-overlay p { font-size: 14px; color: #333; font-weight: 500; }
.error-state {
  display: flex; justify-content: center; align-items: center;
  height: 200px; min-height: 200px; font-size: 18px; color: #d32f2f;
  background-color: #ffebee; border: 1px solid #ef9a9a; border-radius: 8px;
  margin: 20px; padding: 20px;
}
.mb-10 { margin-bottom: 20px; }
.padding { padding: 20px; }

/* ---------- Toasts ---------- */
.toast {
  position: fixed; color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 500; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: fadeInOut 3s ease-in-out forwards; z-index: 2000;
}
.toastError { background: linear-gradient(135deg, #ff4d4d, #cc0000); }
.toastSuccess { background: linear-gradient(135deg, #28a745, #218838); }
.toast-message {
  position: fixed; bottom: 20px; right: 20px; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; color: #fff; z-index: 2000;
  animation: toastFadeIn 0.3s ease-out;
}
.toast-success { background-color: #28a745; }
.toast-error { background-color: #dc3545; }
.toast-icon { font-size: 1.2rem; }

/* ---------- Date input ---------- */
.date-input-group { display: flex; flex-direction: column; margin-bottom: 12px; }
.date-label { font-size: 0.9rem; color: #333; margin-bottom: 4px; }
.date-input { padding: 8px; border: 1px solid #ccc; border-radius: 4px; }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0; background-color: rgba(37, 37, 45, 0.7);
  backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: center;
  z-index: 1000; overflow-y: auto; padding: 2px;
}
.modal-content,
.modal-lg,
.modal-sm {
  background: #fff; border-radius: 16px; position: relative;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden; display: flex; flex-direction: column;
  animation: modalFadeIn 0.25s ease-out;
}
.modal-content { max-width: 500px; width: 90%; border: 3px solid #96329deb; }
.modal-lg { max-width: 1050px; max-height: 90vh; width: 90%; }
.modal-sm { max-width: 400px; max-height: 90vh; width: 50%; }
.modal-long { max-width: 1050px; border-radius: 15px; border: 3px solid #96329deb; }

.modal-header-top {
  background: linear-gradient(135deg, teal, #dd34f8); color: #fff;
  padding: 8px 30px; display: flex; justify-content: space-between; align-items: center;
  position: relative; flex-shrink: 0;
}
.modal-header-top .modal-title {
  color: #fff; font-size: 1.1em; font-weight: bold;
  text-shadow: 0 2px 8px rgba(36, 23, 23, 0.527); margin: 0; flex-grow: 1;
}
.modal-header-top .modal-postcode { display: flex; align-items: center; gap: 5px; font-size: 0.9em; opacity: 0.9; white-space: nowrap; }
.modal-header-top .modal-postcode img { filter: invert(1); }

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 20px; border-bottom: 1px solid #e0e0e0; flex-shrink: 0;
}
.modal-title { font-size: 1.5rem; font-weight: 600; color: #333; margin: 0; }
.close-btn { font-size: 1.5rem; background: none; border: none; cursor: pointer; color: #333; opacity: 0.6; transition: opacity 0.2s; }
.close-btn:hover { opacity: 1; }

.modal-body { padding: 20px; flex-grow: 1; overflow-y: auto; background-color: #fff; }
.modal-body h3 { border-bottom: 2px solid #c6d3db; padding-bottom: 10px; margin-bottom: 15px; margin-top: 0; }

.modal-tabs {
  display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 20px 0;
  background-color: #f7f7f7; border-bottom: 1px solid #e0e0e0; flex-shrink: 0;
}
.tab-btn {
  background: none; border: none; padding: 10px 16px; font-size: 1rem; font-weight: 500;
  color: #555; cursor: pointer; transition: all 0.3s ease; position: relative;
}
.tab-btn.active { color: #007bff; border-bottom: 3px solid #007bff; background-color: #fff; }
.tab-btn:hover:not(.active) { color: #0056b3; background-color: #f0f0f0; }
.is_active { color: #131864 !important; background-color: #41375e36 !important; }
.tab-indicator { position: absolute; top: 4px; right: 4px; font-size: 0.7rem; color: #ff5722; }

.modal-content-scroll {
  flex-grow: 1; overflow-y: auto; padding: 20px;
  max-height: 60vh; min-height: 400px; background-color: #f0f0f05c;
}
.modal-footer { padding: 20px; display: flex; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.modal-close-button {
  position: absolute; top: 10px; right: 10px; background: none; border: none;
  font-size: 24px; cursor: pointer; color: #fff; opacity: 0.7; z-index: 1001;
}
.modal-close-button:hover { opacity: 1; }
.modal-cancel-button { background-color: #e0e0e0; color: #333; }
.modal-cancel-button:hover { background-color: #d0d0d0; }
.modal-confirm-button { background-color: #4caf50; color: #fff; }
.modal-confirm-button:hover { background-color: #45a049; }

/* ---------- Forms ---------- */
.form-row { display: flex; gap: 15px; margin-bottom: 10px; }
.form-group { flex: 1; display: flex; flex-direction: column; margin-bottom: 12px; }
.form-group label { font-size: 12px; color: #666; margin-bottom: 4px; font-weight: 600; }
.form-control {
  width: 100%; padding: 8px 10px; font-size: 14px; border: 1px solid #ddd; border-radius: 6px;
  box-sizing: border-box; transition: all 0.2s; margin: 5px 0 20px;
}
.form-control:focus { outline: none; border-color: #007bff; box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25); }
.txtbox { width: 100%; padding: 4px; border: 1px solid #fdb1ed; border-radius: 4px; font-size: 14px; box-sizing: border-box; }
.form-align { display: flex; justify-content: space-between; align-items: center; }
.confirm { line-height: 1.8em; color: #4c6b80; }
.checkbox-group { display: flex; align-items: center; gap: 8px; margin-top: 15px; margin-bottom: 15px; }
.checkbox-group input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.checkbox-group label { font-size: 14px; color: #333; cursor: pointer; }
.form-check { margin-bottom: 8px; }
.form-check-input { width: 18px; height: 18px; cursor: pointer; }
.form-check-label { font-size: 14px; color: #333; cursor: pointer; }

/* ---------- Medication / logbook lists ---------- */
.medication-list, .recent-logbook-notes { list-style: none; padding: 0; margin: 0; }
.recent-logbook-notes { display: flex; flex-direction: column; gap: 10px; }
.medication-item {
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px;
  background-color: #f0f8ff; padding: 10px 12px; border-radius: 8px;
  border: 1px solid #e0f0ff; font-size: 0.95rem; line-height: 1.4;
}
.medication-item input[type="checkbox"] { flex-shrink: 0; margin-top: 3px; }
.medication-item label { font-size: 13px; color: #333; line-height: 1.4; cursor: pointer; flex-grow: 1; }

.logbook-form {
  display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; padding: 15px;
  background-color: #f9f9f9; border-radius: 8px; border: 1px solid #eee;
}
.logbook-textarea { min-height: 80px; resize: vertical; }
.logbook-submit-btn { align-self: flex-end; margin-top: 10px; }
.recent-logbook-title {
  font-size: 1.1em; font-weight: bold; margin-top: 25px; margin-bottom: 15px;
  color: #333; border-bottom: 1px solid #eee; padding-bottom: 5px;
}
.logbook-item {
  display: flex; align-items: flex-start; gap: 8px; background-color: #f0f8ff;
  padding: 10px 12px; border-radius: 8px; border: 1px solid #e0f0ff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); font-size: 0.95rem; line-height: 1.4;
}
.logbook-item-date { font-size: 0.85em; color: #777; margin-bottom: 5px; font-style: italic; }
.logbook-item-content { font-size: 0.95em; color: #333; margin-bottom: 5px; line-height: 1.4; }
.logbook-item-carer { font-size: 0.85em; color: #555; font-weight: 500; text-align: right; }

/* ---------- Client details ---------- */
.client-details-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px;
  margin-bottom: 20px; padding: 15px; background-color: #fff; border-radius: 8px; border: 1px solid #eee;
}
.client-detail-item { font-size: 0.95em; color: #333; line-height: 1.4; }
.client-detail-item strong { color: #000; margin-right: 4px; font-size: 13px; }
.client-medication-suite-title {
  font-size: 14px; font-weight: bold; margin-top: 35px; margin-bottom: 5px;
  color: #5992ab; border-bottom: 1px solid #eee; padding-bottom: 5px;
}
.client-medication-suite { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.client-medication-item {
  background-color: #f0f8ff; padding: 12px; border-radius: 8px;
  border: 1px solid #e0f0ff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.client-medication-item strong { color: #007bff; }
.client-medication-item p { font-size: 0.9em; color: #555; margin-top: 5px; margin-bottom: 0; }

/* ---------- Carer details ---------- */
.carers-list { display: flex; flex-direction: column; gap: 20px; margin-top: 15px; }
.carer-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); border: 2px solid #dee2e6;
  border-radius: 12px; padding: 20px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); transition: all 0.3s ease;
}
.carer-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15); border-color: #007bff; }
.carer-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #e9ecef;
}
.carer-header h5 { margin: 0; font-size: 1.2em; color: #2c3e50; font-weight: 600; }
.carer-role {
  background: linear-gradient(135deg, #007bffa0, #8900b3); color: #fff; padding: 4px 12px;
  border-radius: 20px; font-size: 0.8em; font-weight: 500; letter-spacing: 0.5px;
}
.carer-contact-info { display: flex; flex-direction: column; gap: 12px; }
.contact-item { gap: 8px; padding: 12px; background: rgba(255, 255, 255, 0.8); border-radius: 8px; border: 1px solid #e9ecef; }
.contact-label { font-weight: 600; color: #495057; font-size: 0.9em; }
.contact-value { color: #2c3e50; font-size: 1em; font-weight: 500; margin-left: 8px; }
.contact-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.action-btn {
  padding: 6px 12px; border: none; border-radius: 6px; font-size: 0.85em; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease; text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.action-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }
.call-btn { background: linear-gradient(135deg, #28a745, #20c997); color: #fff; }
.call-btn:hover { background: linear-gradient(135deg, #218838, #1ea085); }
.sms-btn { background: linear-gradient(135deg, #17a2b8, #138496); color: #fff; }
.sms-btn:hover { background: linear-gradient(135deg, #138496, #117a8b); }
.email-btn { background: linear-gradient(135deg, #6f42c1, #5a32a3); color: #fff; }
.email-btn:hover { background: linear-gradient(135deg, #5a32a3, #4c2a85); }
.whatsapp-btn { background: linear-gradient(135deg, #25d366, #128c7e); color: #fff; }
.whatsapp-btn:hover { background: linear-gradient(135deg, #128c7e, #075e54); }
.carer-availability { margin-top: 15px; padding: 10px; background: rgba(40, 167, 69, 0.1); border-radius: 6px; border-left: 4px solid #28a745; }
.availability-label { font-weight: 600; color: #155724; font-size: 0.9em; }
.availability-value { color: #155724; margin-left: 8px; font-weight: 500; }
.no-contact-info {
  color: #6c757d; font-style: italic; text-align: center; padding: 20px;
  background: rgba(248, 249, 250, 0.8); border-radius: 8px; border: 2px dashed #dee2e6;
}
.no-carers-assigned {
  text-align: center; padding: 30px; color: #6c757d; font-style: italic;
  background: rgba(248, 249, 250, 0.8); border-radius: 12px; border: 2px dashed #dee2e6; font-size: 1.1em;
}

/* ---------- Summary section ---------- */
.summary-section {
  grid-column: 1 / -1; background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-top: 2px solid #007bff; padding: 20px; margin-top: 10px; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.summary-header { text-align: center; margin-bottom: 20px; }
.summary-header h3 { color: #495057; font-size: 18px; font-weight: bold; margin: 0; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.summary-content { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
.summary-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.summary-stat-item {
  background: #fff; padding: 15px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex; flex-direction: column; align-items: center; text-align: center; border-left: 4px solid #007bff;
}
.stat-label { font-size: 12px; color: #6c757d; font-weight: 500; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 18px; color: #495057; font-weight: bold; }
.summary-top-carers { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.summary-top-carers h4 { color: #495057; font-size: 16px; margin: 0 0 15px; text-align: center; border-bottom: 2px solid #e9ecef; padding-bottom: 10px; }
.top-carers-list { display: flex; flex-direction: column; gap: 10px; }
.top-carer-item {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 15px;
  background: #f8f9fa; border-radius: 6px; border-left: 3px solid #28a745; transition: all 0.2s ease;
}
.top-carer-item:hover { background: #e9ecef; transform: translateX(5px); }
.carer-name { font-weight: bold; color: #495057; font-size: 14px; }
.carer-stats { font-size: 12px; color: #6c757d; font-style: italic; }

/* ---------- WebSocket status ---------- */
.websocket-status {
  position: fixed; top: 10px; right: 10px; z-index: 1000; background: rgba(255, 255, 255, 0.95);
  border-radius: 8px; padding: 8px 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); border: 1px solid #e0e0e0;
}
.connection-indicator { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; animation: pulse 2s infinite; }
.status-dot.connected { background-color: #4caf50; }
.status-dot.disconnected { background-color: #f44336; }
.status-text { color: #333; }
.connection-indicator.connected .status-text { color: #4caf50; }
.connection-indicator.disconnected .status-text { color: #f44336; }
.connection-indicator.connecting .status-text { color: #ff9800; }
.connection-indicator.error .status-text { color: #f44336; }
.client-call.realtime-updated,
.staff-grid-row.realtime-updated { animation: realtime-update 1s ease-out; }

/* ---------- Bootstrap-style grid (flat, no media queries) ---------- */
.row {
  --bs-gutter-x: 1.5rem; --bs-gutter-y: 0;
  display: flex; flex-wrap: wrap;
  margin-top: calc(-1 * var(--bs-gutter-y));
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}
.row > * {
  flex-shrink: 0; width: 100%; max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}
.col, .col-sm, .col-md, .col-lg, .col-xl, .col-xxl { flex: 1 0 0%; }
.col-auto, .col-sm-auto, .col-md-auto, .col-lg-auto, .col-xl-auto, .col-xxl-auto { flex: 0 0 auto; width: auto; }
.col-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xl-1,.col-xxl-1 { flex: 0 0 auto; width: 8.33333333%; }
.col-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xl-2,.col-xxl-2 { flex: 0 0 auto; width: 16.66666667%; }
.col-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xl-3,.col-xxl-3 { flex: 0 0 auto; width: 25%; }
.col-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xl-4,.col-xxl-4 { flex: 0 0 auto; width: 33.33333333%; }
.col-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xl-5,.col-xxl-5 { flex: 0 0 auto; width: 41.66666667%; }
.col-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xl-6,.col-xxl-6 { flex: 0 0 auto; width: 50%; }
.col-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xl-7,.col-xxl-7 { flex: 0 0 auto; width: 58.33333333%; }
.col-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xl-8,.col-xxl-8 { flex: 0 0 auto; width: 66.66666667%; }
.col-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xl-9,.col-xxl-9 { flex: 0 0 auto; width: 75%; }
.col-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xl-10,.col-xxl-10 { flex: 0 0 auto; width: 83.33333333%; }
.col-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xl-11,.col-xxl-11 { flex: 0 0 auto; width: 91.66666667%; }
.col-12,.col-sm-12,.col-md-12,.col-lg-12,.col-xl-12,.col-xxl-12 { flex: 0 0 auto; width: 100%; }

/* ---------- Profile modal ---------- */
.profile_modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; justify-content: center; align-items: center; z-index: 1000;
  padding: 1rem; box-sizing: border-box; backdrop-filter: blur(4px); animation: fadeIn 0.3s ease-out;
}
.profile_modal-container {
  background-color: #fff; color: #1f2937; padding: 0; border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4); max-width: 900px; width: 100%; margin: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  position: relative; overflow: hidden; max-height: 90vh; display: flex; flex-direction: column;
  animation: slideIn 0.3s ease-out;
}
.profile_modal-header {
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff;
  padding: 0.2rem 2rem; margin: 0; border-bottom: none;
}
.profile_modal-title { font-size: 1.75rem; font-weight: 700; margin: 0; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.profile_modal-subtitle { font-size: 0.875rem; opacity: 0.9; margin-top: 0.25rem; font-weight: 400; }
.profile_modal-close-button {
  font-size: 1.5rem; color: #fff; background: rgba(255, 255, 255, 0.2); border: none; cursor: pointer;
  padding: 0.75rem; border-radius: 50%; transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
}
.profile_modal-close-button:hover { background: rgba(255, 255, 255, 0.3); transform: scale(1.05); }
.profile_modal-content-wrapper { flex: 1; overflow-y: auto; padding: 2rem; display: grid; grid-template-columns: 1fr; gap: 2rem; }
.profile_modal-profile-column { display: flex; flex-direction: column; align-items: center; text-align: center; }
.profile_profile-photo-container {
  position: relative; width: 8rem; height: 8rem; border-radius: 50%; overflow: hidden;
  border: 4px solid #fff; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); transition: transform 0.3s ease; margin-bottom: 1rem;
}
.profile_profile-photo-container:hover { transform: scale(1.05); }
.profile_profile-photo { width: 100%; height: 100%; object-fit: cover; }
.profile_profile-photo-placeholder {
  width: 100%; height: 100%; background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  display: flex; align-items: center; justify-content: center; color: #1976d2;
}
.profile_account-id-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 0.75rem 1.5rem;
  border-radius: 2rem; font-size: 0.875rem; font-weight: 600; box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.profile_section-header {
  display: flex; align-items: center; gap: 0.75rem; font-size: 1.25rem; font-weight: 700; color: #374151;
  margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom: 2px solid #e5e7eb;
}
.profile_section-icon { color: #667eea; flex-shrink: 0; }
.profile_info-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.profile_info-item {
  display: flex; align-items: flex-start; gap: 1rem; background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 1.25rem; border-radius: 1rem; border: 1px solid #e2e8f0; transition: all 0.3s ease; position: relative; overflow: hidden;
}
.profile_info-item::before {
  content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); opacity: 0; transition: opacity 0.3s ease;
}
.profile_info-item:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); border-color: #cbd5e1; }
.profile_info-item:hover::before { opacity: 1; }
.profile_info-icon { color: #667eea; flex-shrink: 0; margin-top: 0.125rem; }
.profile_info-content { flex: 1; min-width: 0; }
.profile_info-label { font-size: 0.875rem; font-weight: 600; color: #374151; margin-bottom: 0.25rem; }
.profile_info-value { font-size: 0.875rem; color: #6b7280; word-break: break-word; }
.profile_info-value a { color: #667eea; text-decoration: none; font-weight: 500; transition: color 0.2s ease; }
.profile_info-value a:hover { color: #4f46e5; text-decoration: underline; }
.profile_info-value-empty { color: #9ca3af; font-style: italic; }
.profile_off-days-container { background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 100%); border-radius: 1rem; padding: 1.5rem; border: 1px solid #b3e5fc; }
.profile_off-days-title { display: flex; align-items: center; gap: 0.75rem; color: #0277bd; margin-bottom: 1rem; font-size: 1.125rem; font-weight: 700; }
.profile_off-days-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.profile_off-day-tag {
  display: inline-flex; align-items: center; background: linear-gradient(135deg, #fff 0%, #f0f9ff 100%);
  color: #0369a1; font-size: 0.875rem; font-weight: 600; padding: 0.5rem 1rem; border-radius: 2rem;
  border: 1px solid #bae6fd; box-shadow: 0 2px 4px rgba(3, 105, 161, 0.1); transition: all 0.2s ease;
}
.profile_off-day-tag:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(3, 105, 161, 0.15); }
.profile_emergency-contact-container {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); border-radius: 1rem;
  padding: 1.5rem; border: 1px solid #fecaca; margin-top: 1rem;
}
.profile_emergency-contact-title { display: flex; align-items: center; gap: 0.75rem; color: #dc2626; margin-bottom: 1rem; font-size: 1.125rem; font-weight: 700; }
.profile_emergency-contact-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.profile_emergency-contact-item { background: rgba(255, 255, 255, 0.8); padding: 1rem; border-radius: 0.75rem; border: 1px solid #f9a8a8; }
.profile_emergency-contact-label { font-size: 0.875rem; font-weight: 600; color: #374151; margin-bottom: 0.25rem; }
.profile_emergency-contact-value { font-size: 0.875rem; color: #6b7280; }
.profile_emergency-contact-value a { color: #dc2626; text-decoration: none; font-weight: 500; transition: color 0.2s ease; }
.profile_emergency-contact-value a:hover { color: #b91c1c; text-decoration: underline; }
.profile_modal-content-wrapper::-webkit-scrollbar { width: 6px; }
.profile_modal-content-wrapper::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
.profile_modal-content-wrapper::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.profile_modal-content-wrapper::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

@media (min-width: 640px) {
  .profile_info-grid, .profile_emergency-contact-grid { grid-template-columns: repeat(2, 1fr); }
  .profile_profile-photo-container { width: 10rem; height: 10rem; }
}
@media (min-width: 768px) {
  .profile_modal-container { max-width: 1000px; }
  .profile_modal-content-wrapper { grid-template-columns: 300px 1fr; gap: 3rem; }
  .profile_modal-profile-column { position: sticky; top: 0; align-self: start; }
}
@media (min-width: 1024px) {
  .profile_modal-content-wrapper { grid-template-columns: 320px 1fr; }
  .profile_emergency-contact-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Time-adjustment indicators ---------- */
.time-indicator {
  position: absolute; top: 50%; transform: translateY(-50%); display: flex; align-items: center;
  background: rgba(0, 0, 0, 0.9); color: #fff; padding: 3px 8px; border-radius: 12px;
  font-size: 10px; font-weight: bold; white-space: nowrap; z-index: 150;
  animation: pulse-indicator 2s infinite; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.time-indicator.time-earlier { left: -45px; background: linear-gradient(135deg, rgba(220, 53, 69, 0.95), rgba(255, 0, 0, 0.9)); border-color: rgba(255, 255, 255, 0.3); }
.time-indicator.time-later { right: -45px; background: linear-gradient(135deg, rgba(40, 167, 69, 0.95), rgba(0, 128, 0, 0.9)); border-color: rgba(255, 255, 255, 0.3); }
.time-arrow { font-size: 12px; margin: 0 3px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.time-diff { font-size: 9px; font-weight: bold; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); letter-spacing: 0.5px; }
.drag-preview-container { position: absolute; top: 0; bottom: 0; pointer-events: none; z-index: 200; }
.drag-preview-indicator {
  position: absolute; top: 50%; transform: translateY(-50%); width: 6px; height: 90%;
  border-radius: 3px; animation: pulse-preview 1s infinite; box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.drag-preview-indicator.earlier { background: linear-gradient(to bottom, #ff4444, #ff6666, #ff4444); border: 2px solid #f00; box-shadow: 0 0 15px rgba(255, 0, 0, 0.6); }
.drag-preview-indicator.later { background: linear-gradient(to bottom, #44ff44, #66ff66, #44ff44); border: 2px solid #0f0; box-shadow: 0 0 15px rgba(0, 255, 0, 0.6); }
@keyframes pulse-indicator {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.8; transform: translateY(-50%) scale(1.05); }
}
@keyframes pulse-preview {
  0%, 100% { opacity: 0.9; transform: translateY(-50%) scale(1); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.15); }
}
.client-call.has-time-adjustment:hover {
  border-color: #ff8c00; box-shadow: 0 0 15px rgba(255, 140, 0, 0.8); transform: translateY(-50%) scale(1.08);
}
.client-call.has-time-adjustment:hover .time-indicator {
  animation: none; opacity: 1; transform: translateY(-50%) scale(1.1); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}
.client-call.has-time-adjustment .call-text,
.client-call.has-time-adjustment .call-type-text { position: relative; z-index: 1; }
.preview-time-indicator { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
.preview-arrow { font-size: 14px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.preview-time { font-size: 10px; font-weight: bold; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); letter-spacing: 0.5px; }

/* ---------- Break / unavailability / holiday / travel indicators ---------- */
.break-indicator {
  position: absolute; background-color: rgb(134, 135, 137); height: 9px !important; z-index: 5;
  top: 20px; border-radius: 2px; transition: all 0.3s ease; cursor: pointer; overflow: hidden;
}
.break-indicator::before {
  content: ""; position: absolute; inset: 0; border-radius: 2px;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.269) 1px, rgba(255,255,255,0.406) 3px, transparent 3px, transparent 6px);
}
.break-indicator.dark { background-color: rgba(80, 80, 80, 0.991); }
.break-indicator.dark::before {
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.4) 0, rgba(255,255,255,0.4) 3px, transparent 3px, transparent 6px);
}
.break-indicator:hover { height: 8px; opacity: 0.9; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.break-indicator.long-break { animation: pulse 2s infinite; }
.break-indicator::after {
  content: attr(data-tooltip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8); color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 12px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; margin-bottom: 5px;
}
.break-indicator:hover::after { opacity: 1; }
.break-indicator.top-position { top: 10px; }
.break-indicator.middle-position { top: 50%; transform: translateY(-50%); }
.break-indicator.bottom-position { bottom: 10px; top: auto; }

.unavailability-indicator {
  position: absolute; left: 0; height: 10px; background-color: rgba(194, 146, 104, 0.491); top: 30px;
  border-radius: 4px; z-index: 6; display: flex; align-items: center; justify-content: center;
  color: rgb(47, 46, 46); font-size: 10px; font-weight: bold; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; padding: 0 4px; transition: all 0.3s ease; cursor: pointer;
}
.unavailability-indicator:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); }
.holiday-indicator {
  position: absolute; left: 0; width: 100%; height: 10px; background-color: rgba(237, 72, 1, 0.505); top: 30px;
  border-radius: 4px; z-index: 6; display: flex; align-items: center; justify-content: center;
  color: rgb(16, 2, 32); font-size: 10px; font-weight: bold; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; padding: 0 4px; transition: all 0.3s ease; cursor: pointer;
}
.holiday-indicator:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); }
.travel-dot { position: absolute; top: 4px; width: 10px; height: 10px; background: #000; z-index: 50; border-radius: 50%; cursor: pointer; }
.travel-dot:hover { transform: scale(1.4); }

/* ---------- Current-time line ---------- */
.current-time-line {
  position: absolute; top: 0; bottom: 0; width: 2px; background-color: #ff00ae;
  border-left: 2px dotted #f00; z-index: 100; pointer-events: none; animation: pulse-time-line 2s infinite;
}
.current-time-line-staff {
  position: absolute; top: 0; bottom: 0; width: 2px; background-color: #df13722f;
  border-left: 2px dotted #ea09988a; z-index: 50; pointer-events: none; opacity: 0.8;
  box-shadow: 0 4px 6px rgba(202, 216, 236, 0.6);
}


/* ==========================================================================
   PART 2 – ROTA GRID BASE LAYOUT
   (also used by the call-details screen via .schedule-container)
   ========================================================================== */
.schedule-container {
  background: #c0d5eb; display: flex; flex-direction: column; border-radius: 8px;
  box-shadow: 0 4px 6px rgba(21, 18, 28, 0.6); margin: 15px; animation: fadeIn 0.5s ease-in-out;
  overflow: hidden; position: relative;
}
.schedule-grid { display: block; overflow: hidden; flex: 1; min-height: 0; position: relative; }
.grid-body {
  display: grid; grid-template-columns: 150px 1fr; grid-template-rows: auto 1fr; overflow: auto;
  max-height: calc(100vh - 160px); background: #fff; scroll-behavior: smooth;
}
.staff-header-cell {
  grid-column: 1; grid-row: 1; position: sticky; top: 0; left: 0; z-index: 32;
  font-weight: bold; font-size: 14px; color: #e8fff7; background: linear-gradient(135deg, #836f86, #4f6d8f);
  text-align: center; display: flex; align-items: center; justify-content: center;
  border-right: 1px solid #ddd; border-left: 2px solid #761683; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.time-header-row {
  grid-column: 2; grid-row: 1; position: sticky; top: 0; z-index: 31; display: grid;
  grid-template-columns: repeat(48, minmax(30px, 1fr)); background: linear-gradient(135deg, #435c79, #874f8f);
  min-height: 20px; width: 150%; min-width: 1610px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.staff-grid-row { display: contents; }
.staff-name-cell {
  grid-column: 1; grid-row: auto; position: sticky; left: 0; z-index: 20; width: 150px; min-width: 150px;
  display: flex; flex-direction: column; background: #f8f9fa; justify-content: space-between; padding: 3px;
  border-top: 1px solid #c8eef7; border-bottom: 1px solid #cfcfcf; border-right: 1px solid #ddd;
  min-height: 45px; max-height: 45px;
}
.staff-timeline {
  grid-column: 2; grid-row: auto; display: grid; grid-template-columns: repeat(48, minmax(30px, 1fr));
  align-items: center; z-index: 1; position: relative; width: 150%; min-width: 1610px; background: #fff;
}
.staff-header-top { display: flex; align-items: center; gap: 6px; }
.staff-photo-container { width: 20px; height: 20px; border-radius: 50%; overflow: hidden; border: 1px solid #ddd; flex-shrink: 0; }
.staff-photo { width: 100%; height: 100%; object-fit: cover; }
.staff-info { flex: 1; }
.staff-name {
  font-size: 14px; font-weight: 600; color: #120d1d; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.staff-details-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.staff-count, .staff-hours { font-size: 10px; color: #9c9e9e; font-style: italic; white-space: nowrap; }
.curent-day { font-size: 10px; font-weight: normal; opacity: 0.8; }
.time-slot-header {
  grid-column: span 2; text-align: left; font-size: 11px; font-weight: bold; color: rgb(195, 234, 247);
  display: flex; flex-direction: column; gap: 2px; min-height: 30px; justify-content: flex-start;
  padding-left: 2px; padding-top: 5px; box-sizing: border-box; border-right: 1px solid rgba(255, 255, 255, 0.2);
}
.time-text { font-size: 12px; text-align: left; display: block; white-space: nowrap; }
.time-cell {
  border-right: 1px solid #e3e8eb !important; border-top: 1px solid #999 !important;
  position: relative; height: 100%; padding: 0; box-sizing: border-box; min-height: 45px;
}
.time-cell.hourly-border { border-left: 1px solid #a7b7be !important; }

.client-call {
  border-radius: 5px; padding: 2px; position: absolute; top: 65%; transform: translateY(-50%);
  overflow: hidden; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); cursor: pointer; transition: all 0.3s ease;
  min-height: 22px; max-height: 22px; display: flex; flex-direction: column; align-items: flex-start;
  justify-content: center; box-sizing: border-box; border: 1px solid rgba(255, 255, 255, 0.3); backdrop-filter: blur(1px);
}
.client-call:hover {
  transform: translateY(-50%) scale(1.05); z-index: 10; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
}
.call-text, .call-type-text { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8)); }
.call-text {
  font-size: 10px; color: #fff; font-weight: 600; text-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
  line-height: 1.1; flex: 1; text-align: left; width: 100%;
}
.call-text span {
  font-size: 11px; display: block; margin-bottom: 1px; padding-top: 3px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.call-type-text {
  color: rgba(255, 255, 255, 0.9); font-size: 6px; font-weight: 400; white-space: nowrap;
  overflow: hidden; text-overflow: clip; width: 100%;
}

/* ---------- Base responsive ---------- */
@media (max-width: 768px) {
  .schedule-container { margin: 5px; max-height: calc(100vh - 100px); }
  .staff-header-cell, .staff-name-cell { width: 150px; min-width: 150px; }
  .staff-photo-container { width: 18px; height: 18px; }
  .staff-name { font-size: 12px; }
  .staff-count { font-size: 9px; }
  .time-header-row, .staff-timeline { grid-template-columns: repeat(48, minmax(25px, 1fr)); min-width: 1200px; }
  .time-slot-header { min-height: 30px; font-size: 10px; }
  .client-call { min-height: 20px; max-height: 20px; font-size: 9px; padding: 2px 4px; }
  .call-text, .call-text strong { font-size: 8px; }
  .call-type-text { font-size: 6px; }
  .summary-content, .summary-stats { grid-template-columns: 1fr; }
  .summary-stats { gap: 10px; }
  .summary-content { gap: 20px; }
  .summary-stat-item { padding: 10px; }
  .stat-value { font-size: 16px; }
  .carer-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .contact-actions { justify-content: center; }
  .action-btn { flex: 1; justify-content: center; min-width: 80px; }
  .time-indicator.time-earlier { left: -35px; }
  .time-indicator.time-later { right: -35px; }
  .time-indicator { padding: 2px 6px; font-size: 9px; }
  .time-diff { font-size: 8px; }
  .time-arrow { font-size: 10px; }
  .break-indicator { height: 3px; top: 15px; }
  .break-indicator:hover { height: 6px; }
  .break-indicator::after { font-size: 10px; padding: 2px 4px; }
  .modal-content, .modal-lg, .modal-sm { width: 95%; }
  .tab-btn { padding: 10px 12px; font-size: 0.95rem; }
}
@media (max-width: 1024px) and (min-width: 769px) {
  .schedule-container { margin: 8px; }
  .staff-header-cell, .staff-name-cell { width: 130px; min-width: 130px; }
  .time-header-row, .staff-timeline { grid-template-columns: repeat(48, minmax(28px, 1fr)); min-width: 1344px; }
}
@media (prefers-reduced-motion: reduce) {
  .client-call, .staff-action, .schedule-container { transition: none; animation: none; }
  .priority-indicator { animation: none; }
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .client-call, .time-cell { border-width: 0.5px; }
}
@media (prefers-color-scheme: dark) {
  .schedule-container, .schedule-grid, .grid-body, .staff-grid-row, .staff-name-cell, .staff-timeline {
    background: #fff; color: #000;
  }
  .staff-grid-row:hover { background: #f8f9fa; }
  .staff-name-cell { border-color: #ddd; }
  .staff-name { color: #070303; }
  .staff-count { color: #9c9e9e; }
  .time-cell { border-color: #f0f0f0; }
  .time-cell.hourly-border { border-left-color: #b8e2f0 !important; }
}
@media (prefers-contrast: high) {
  .client-call { border: 2px solid #000; }
  .staff-name-cell { border: 1px solid #000; }
  .time-cell { border-color: #000; }
}
@media print {
  .schedule-container { box-shadow: none; margin: 0; max-height: none; min-height: auto; }
  .grid-body { max-height: none; overflow: visible; }
  .client-call { box-shadow: none; border: 1px solid #ccc; background-color: #f8f9fa !important; color: #000 !important; }
  .call-text, .call-type-text { color: #000 !important; text-shadow: none; }
  .staff-action { display: none; }
}


/* ==========================================================================
   PART 3 – PROFESSIONAL FULL-SCREEN ROTA THEME
   Everything below is scoped to .rota-container so nothing else is affected.
   The container height is set from RotaGrid.tsx (--rg-fit-height) so the grid
   always fills the screen from its top edge down to the bottom of the window.
   ========================================================================== */
.rota-container {
  --rg-navy: #0b2a66;
  --rg-navy-2: #123a8a;
  --rg-ink: #172033;
  --rg-muted: #6b7789;
  --rg-line: #e3e8f2;
  --rg-line-soft: #eef1f7;
  --rg-zebra: #fafbfe;
  --rg-hover: #eaf2ff;
  --rg-accent: #2f6bff;
  --rg-name-col: 200px;
  --rg-timeline-min: 1800px;
  --rg-row-h: 54px;
  --rg-call-h: 30px;

  background: #fff;
  border: 1px solid #d5deee;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.08);
  margin: 6px 8px 8px;
  animation: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: var(--rg-fit-height, calc(100dvh - 190px));
  min-height: 420px;
}

/* ---------- Legend ---------- */
.rota-legend {
  flex: 0 0 auto; display: flex; flex-wrap: nowrap; align-items: center; gap: 6px 16px;
  background: #f6f8fc; border-bottom: 1px solid var(--rg-line);
  overflow-x: auto; scrollbar-width: none;
}
.rota-legend::-webkit-scrollbar { display: none; }
.rota-legend-item {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  font-size: 12px; font-weight: 600; color: #46526a; white-space: nowrap;
}
.rota-legend-swatch { width: 13px; height: 13px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.rota-legend-swatch.is-double { background: #e8ecf7; border-top: 3px solid #ff00f7; }
.rota-legend-swatch.is-med {
 background: rgba(0, 60, 128, 0.757) !important;
  border-left: 3px solid rgb(6, 1, 73);
}

/* ---------- Grid fills the remaining height ---------- */
.rota-container .schedule-grid { flex: 1 1 auto; min-height: 0; background: #fff; }
.rota-container .grid-body {
  grid-template-columns: var(--rg-name-col) 1fr;
  grid-template-rows: 42px;
  grid-auto-rows: minmax(var(--rg-row-h), auto);
  align-content: start;
  height: 100%;
  max-height: none;
  min-height: 0;
  background: #fff;
  overflow: auto;
  scroll-behavior: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b7c3dc #f1f4f9;
  margin-bottom: 10px;
}
.rota-container .grid-body::-webkit-scrollbar { width: 11px; height: 11px; }
.rota-container .grid-body::-webkit-scrollbar-track { background: #f1f4f9; }
.rota-container .grid-body::-webkit-scrollbar-thumb { background: #b7c3dc; border-radius: 8px; border: 2px solid #f1f4f9; }
.rota-container .grid-body::-webkit-scrollbar-thumb:hover { background: #93a3c4; }
.rota-container .grid-body::-webkit-scrollbar-corner { background: #f1f4f9; }

/* ---------- Header (corner + hours) ---------- */
.rota-container .staff-header-cell {
  height: 42px; min-height: 42px; padding: 0 10px 0 16px; justify-content: space-between;
  text-align: left; font-size: 13.5px; font-weight: 700; letter-spacing: 0.02em; color: #fff;
  background: linear-gradient(180deg, var(--rg-navy-2), var(--rg-navy)); border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.16); box-shadow: none; z-index: 40;
}
.rota-container .header-content { display: flex; align-items: center; gap: 8px; }
.rota-container .time-header-row {
  height: 42px; min-height: 42px; width: 150%; min-width: var(--rg-timeline-min);
  background: linear-gradient(180deg, var(--rg-navy-2), var(--rg-navy)); box-shadow: none; z-index: 35;
}
.rota-container .time-slot-header {
  min-height: 42px; padding: 0 0 0 10px; justify-content: center;
  font-size: 12px; font-weight: 700; color: #dbe5ff; border-right: 1px solid rgba(255, 255, 255, 0.14);
}
.rota-container .time-text { font-size: 12.5px; font-variant-numeric: tabular-nums; }

.rota-container .lock-toggle-container { display: flex; align-items: center; }
.rota-container .lock-toggle-btn {
  width: 28px; height: 28px; margin: 0; padding: 0; border-radius: 8px;
  background: rgba(255, 255, 255, 0.14); color: #fff;
}
.rota-container .lock-toggle-btn:hover { background: rgba(255, 255, 255, 0.26); transform: none; }
.rota-container .lock-toggle-btn.locked { color: #ffc2c2; background: rgba(255, 120, 120, 0.22); }
.rota-container .lock-toggle-btn.unlocked { color: #a9f0c0; background: rgba(110, 230, 160, 0.22); }

/* ---------- Carer column ---------- */
.rota-container .staff-name-cell {
  width: var(--rg-name-col); min-width: var(--rg-name-col);
  height: 100%; min-height: var(--rg-row-h); max-height: none;
  padding: 6px 12px; gap: 3px; justify-content: center;
  background: #fff; border: none; border-bottom: 1px solid var(--rg-line); border-right: 1px solid var(--rg-line);
  box-shadow: 4px 0 8px -5px rgba(16, 24, 40, 0.16); z-index: 20; box-sizing: border-box;
}
.rota-container .staff-header-top { gap: 9px; min-width: 0; }
.rota-container .staff-photo-container {
  width: 30px; height: 30px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--rg-line);
}
.rota-container .staff-info { min-width: 0; }
.rota-container .staff-name {
  font-size: 13.5px; font-weight: 700; color: var(--rg-ink); text-shadow: none; line-height: 1.2;
}
.rota-container .staff-details-bottom {
  margin-top: 0; padding-left: 39px; gap: 8px; justify-content: flex-start; align-items: center;
}
.rota-container .staff-count,
.rota-container .staff-hours {
  font-size: 11px; font-style: normal; font-weight: 500; color: var(--rg-muted);
}

/* ---------- Timeline rows ---------- */
.rota-container .staff-timeline {
  width: 150%; min-width: var(--rg-timeline-min); background: #fff; height: 100%; min-height: var(--rg-row-h);
}
.rota-container .staff-grid-row:nth-of-type(even) .staff-timeline,
.rota-container .staff-grid-row:nth-of-type(even) .staff-name-cell { background: var(--rg-zebra); }
.rota-container .staff-grid-row:hover .staff-timeline,
.rota-container .staff-grid-row:hover .staff-name-cell { background: var(--rg-hover); }
.rota-container .time-cell {
  min-height: var(--rg-row-h); border-top: none !important;
  border-right: 1px solid var(--rg-line-soft) !important; border-bottom: 1px solid var(--rg-line);
}
.rota-container .time-cell.hourly-border { border-left: 1px solid #d9e0ec !important; }

/* ---------- Call blocks: aligned, centred, readable ---------- */
.rota-container .client-call {
  top: 58%;
  min-height: var(--rg-call-h); max-height: var(--rg-call-h); height: var(--rg-call-h);
  padding: 0 6px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.3); backdrop-filter: none;
  display: flex; flex-direction: row; align-items: center; justify-content: center; text-align: center;
  transition: box-shadow 0.15s ease, filter 0.15s ease;
}
.rota-container .client-call:hover,
.rota-container .client-call.has-time-adjustment:hover {
  transform: translateY(-50%); filter: brightness(1.08);
  box-shadow: 0 5px 12px rgba(16, 24, 40, 0.32); z-index: 30;
}
.rota-container .call-text,
.rota-container .call-type-text { filter: none; }
.rota-container .call-text {
  flex: 1 1 auto; width: 100%; min-width: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; line-height: 1; text-align: center;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); letter-spacing: 0.01em;
}
.rota-container .call-text span {
  display: block; width: 100%; margin: 0; padding: 0; font-size: 12px; line-height: 1.2;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rota-container .call-type-text { display: none; }

/* ---------- Breaks ---------- */
.rota-container .break-indicator {
  height: 10px !important; border-radius: 5px; opacity: 0.95;
  background: repeating-linear-gradient(135deg, #d3dae7 0 4px, #e5e9f1 4px 8px);
}
.rota-container .break-indicator::before { display: none; }
.rota-container .break-indicator.dark { background: repeating-linear-gradient(135deg, #b9c3d6 0 4px, #cdd5e3 4px 8px); }
.rota-container .break-indicator:hover { height: 10px !important; transform: none; box-shadow: none; opacity: 1; }
.rota-container .break-time-bar { border-radius: 5px; opacity: 0.9; }

/* ---------- Leave & unavailability ---------- */
.rota-container .holiday-indicator,
.rota-container .unavailability-indicator {
  top: 50% !important; height: 22px !important; transform: translateY(-50%); border-radius: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em; box-sizing: border-box;
}
.rota-container .holiday-indicator { border: 1px dashed rgba(214, 110, 52, 0.7); color: #7a3410; }
.rota-container .unavailability-indicator { border: 1px dashed rgba(150, 110, 70, 0.6); color: #54381d; }
.rota-container .holiday-indicator:hover,
.rota-container .unavailability-indicator:hover { transform: translateY(-50%); box-shadow: none; opacity: 1; }

/* ---------- Current-time marker ---------- */
.rota-container .current-time-line {
  width: 2px; border-left: none; background: #ff2d95; box-shadow: 0 0 0 1px rgba(255, 45, 149, 0.15);
  animation: none; z-index: 60;
}
.rota-container .current-time-line-staff {
  width: 1px; border-left: none; background: rgba(255, 45, 149, 0.4); box-shadow: none; opacity: 1; z-index: 50;
}

/* ---------- Loading states (inside the card, not the whole page) ---------- */
.rota-container .loading-overlay {
  position: absolute; inset: 0; top: 0; background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(2px); z-index: 50;
}
.rota-container .loading-state {
  position: absolute; inset: auto; top: 54px; left: 50%; transform: translateX(-50%);
  height: auto; min-height: 0; padding: 6px 16px; border-radius: 999px; background: var(--rg-navy);
  color: #fff; font-size: 12px; font-weight: 600; backdrop-filter: none;
  box-shadow: 0 4px 12px rgba(0, 32, 96, 0.3); z-index: 60;
}

/* ---------- Confirmation message ---------- */
.rota-confirm-message { display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.rota-confirm-message svg { flex: 0 0 auto; margin-top: 3px; color: #f59e0b; }

/* ---------- Tablet / phone ---------- */
@media (max-width: 1024px) {
  .rota-container { --rg-name-col: 160px; --rg-timeline-min: 1500px; --rg-row-h: 50px; --rg-call-h: 28px; }
  .rota-container .staff-details-bottom { padding-left: 0; }
}
@media (max-width: 768px) {
  .rota-container { --rg-name-col: 128px; --rg-timeline-min: 1200px; margin: 4px; border-radius: 8px; }
  .rota-container .staff-name-cell { padding: 5px 6px; }
  .rota-container .staff-photo-container { width: 24px; height: 24px; }
  .rota-container .staff-name { font-size: 12px; }
  .rota-container .call-text, .rota-container .call-text span { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .rota-container * { transition: none !important; animation: none !important; }
}
@media print {
  .rota-container { border: none; box-shadow: none; margin: 0; height: auto; }
  .rota-legend { display: none; }
}
/* ── Day Off bar (from Days Off Tracker) ── */
.rota-dayoff-bar {
  position: absolute;
  left: 0;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 148, 136, 0.85); /* Teal color, distinct from Annual Leave */
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 4px;
  z-index: 1; /* Sits behind call blocks */
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.rota-dayoff-text {
  background: rgba(0, 0, 0, 0.15);
  padding: 2px 8px;
  border-radius: 3px;
}
/* ── Days Off Tracker legend swatches ── */
.rota-legend-swatch.is-dayoff {
  background: rgba(13, 148, 136, 0.85); /* teal – Day off bar */
}
.rota-legend-swatch.is-overtime {
  background: rgba(188, 5, 130, 0.85); /* amber – Overtime bar */
}
/* ── Break legend swatch (amber, matches the break bars) ── */
.rota-legend-swatch.is-break {
  background: #fde68a;
  border: 2px solid #f59e0b;
}/* ============================================================
   ITSupport.css — Floating IT Support Button (right side)
   ⭐ Wrapper-anchored tooltip: it CANNOT drift from its button.
   The tooltip is position:absolute inside .ItSupport-wrap and
   anchored with right: calc(100% + 12px), so it always sits
   flush to the LEFT of the button — same pattern as the audit
   widget's .fw-wrap--audit / .fw-tooltip.
   ============================================================ */

/* ── Fixed wrapper (button + tooltip anchor) ────────────────── */
.ItSupport-wrap {
  position: fixed;
  bottom: 25px;
  right: 50px;
  z-index: 99999;
  display: flex;
  align-items: center;
}

/* ── FAB ─────────────────────────────────────────────────── */
.ItSupport-fab {
  position: relative; /* anchor for badge & pulse */
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #0072ff 50%, #002060 50%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;

  overflow: visible;
  isolation: isolate;

  box-shadow:
    0 4px 14px rgba(0, 114, 255, 0.45),
    0 1px 3px  rgba(0, 0, 0, 0.12);

  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;

  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.ItSupport-fab:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 20px rgba(0, 114, 255, 0.55),
    0 2px 6px  rgba(0, 0, 0, 0.15);
}

.ItSupport-fab:active {
  transform: scale(0.94);
}

/* ── Red count badge ────────────────────────────────────── */
.ItSupport-fab__badge {
  position: absolute;
  top: -10px;
  left: -10px;
  z-index: 100000;

  background: #ff2020;
  color: #ffffff;

  font-size: 11px;
  font-weight: 800;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.3px;
  line-height: 1;

  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  padding: 0 5px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 2.5px solid #ffffff;

  box-shadow:
    0 2px 8px  rgba(255, 32, 32, 0.65),
    0 0   0 1px rgba(255, 32, 32, 0.15);

  animation: ItSupport-badge-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;

  pointer-events: none;
  user-select: none;
}

@keyframes ItSupport-badge-pop {
  0%   { transform: scale(0) rotate(-12deg); opacity: 0; }
  65%  { transform: scale(1.25) rotate(4deg); }
  100% { transform: scale(1)   rotate(0deg); opacity: 1; }
}

/* ── Pulse ring (only when badge is absent) ──────────────── */
.ItSupport-fab__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(0, 114, 255, 0.4);
  animation: ItSupport-pulse 2s ease-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes ItSupport-pulse {
  0%   { transform: scale(1);    opacity: 0.7; }
  100% { transform: scale(1.55); opacity: 0;   }
}

/* ── Tooltip — locked to the LEFT of the button ─────────────
   Positioned absolute *inside* the fixed .ItSupport-wrap, so
   `right: calc(100% + 12px)` always places it flush against
   the left edge of the button, vertically centered on it. */
.ItSupport-tooltip {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  transform: translateY(-50%);
  z-index: 99998;

  background: linear-gradient(135deg, #0072ff 50%, #002060 50%);
  color: #ffffff;

  padding: 10px 14px;
  border-radius: 10px;
  max-width: 220px;

  display: flex;
  flex-direction: column;
  gap: 4px;

  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;

  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  animation: ItSupport-tooltip-in 0.25s ease-out both;
  pointer-events: none;
}

.ItSupport-tooltip-title {
  font-size: 13px;
  font-weight: 600;
}

.ItSupport-tooltip-sub {
  font-size: 11px;
  font-weight: 700;
  color: #9ec4ff;
}

/* Arrow on the RIGHT edge of the tooltip, pointing at the button */
.ItSupport-tooltip-arrow {
  position: absolute;
  top: 50%;
  right: -5px;
  transform: translateY(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, #0072ff 50%, #002060 50%);
  border-radius: 2px;
}

@keyframes ItSupport-tooltip-in {
  0%   { opacity: 0; transform: translateY(-50%) translateX(10px); }
  100% { opacity: 1; transform: translateY(-50%) translateX(0); }
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ItSupport-wrap {
    bottom: 16px;
    right: 16px;
  }

  .ItSupport-fab {
    width: 54px;
    height: 54px;
  }

  .ItSupport-fab__badge {
    min-width: 20px;
    height: 20px;
    font-size: 10px;
    top: -8px;
    left: -8px;
    border-radius: 10px;
  }

  .ItSupport-tooltip {
    font-size: 12px;
    padding: 8px 12px;
    max-width: 200px;
  }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ItSupport-fab        { transition: none; }
  .ItSupport-fab__pulse { animation: none; }
  .ItSupport-fab__badge { animation: none; }
  .ItSupport-tooltip    { animation: none; }
}/* ==========================================
   TICKET MODAL - WhatsApp Style Chat
   ========================================== */

.ticket-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ticket-modal {
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  background: white;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Header */
.ticket-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ticket-modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ticket-modal-icon {
  width: 40px;
  height: 40px;
  background: #ecfeff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0891b2;
}

.ticket-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.ticket-modal-subtitle {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0 0;
}

.ticket-modal-status {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ticket-modal-status.connected {
  color: #0891b2;
}

.ticket-modal-status.offline {
  color: #94a3b8;
}

.ticket-modal-live-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ticket-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: all 0.2s;
}

.ticket-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Content */
.ticket-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* List View */
.ticket-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.ticket-list-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

.ticket-new-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #0891b2;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ticket-new-btn:hover {
  background: #0e7490;
}

.ticket-loading {
  text-align: center;
  padding: 40px;
  color: #64748b;
}

.ticket-empty {
  text-align: center;
  padding: 60px 20px;
}

.ticket-empty p {
  color: #64748b;
  margin: 0 0 16px 0;
  font-size: 15px;
}

.ticket-create-first {
  padding: 10px 20px;
  background: #0891b2;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ticket-item {
  padding: 14px;
  background: #f8fafc;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent;
}

.ticket-item:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.ticket-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.ticket-item-id {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.ticket-item-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ticket-item-status {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  text-transform: capitalize;
}

.ticket-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.ticket-item-meta {
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 4px 0;
}

.ticket-item-preview {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-item-count {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: #94a3b8;
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Priority Badges */
.ticket-priority-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: capitalize;
}

.ticket-priority-urgent { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.ticket-priority-high { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.ticket-priority-medium { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.ticket-priority-low { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* Create Form */
.ticket-create {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ticket-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ticket-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.ticket-input,
.ticket-select,
.ticket-textarea {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
  width: 100%;
}

.ticket-input:focus,
.ticket-select:focus,
.ticket-textarea:focus {
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.ticket-textarea {
  resize: vertical;
  min-height: 80px;
}

.ticket-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ticket-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.ticket-cancel-btn {
  flex: 1;
  padding: 10px;
  background: #f1f5f9;
  color: #475569;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.ticket-cancel-btn:hover {
  background: #e2e8f0;
}

.ticket-submit-btn {
  flex: 2;
  padding: 10px;
  background: #0891b2;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ticket-submit-btn:hover {
  background: #0e7490;
}

.ticket-submit-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* Chat View */
.ticket-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ticket-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ticket-back-btn {
  padding: 7px 11px;
  background: #f1f5f9;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ticket-back-btn:hover {
  background: #e2e8f0;
}

.ticket-chat-info-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.ticket-chat-info-center h4 {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-chat-info-center p {
  font-size: 11px;
  color: #64748b;
  margin: 2px 0 0 0;
}

/* Avatar */
.ticket-modal-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.ticket-modal-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 12px;
  user-select: none;
}

.ticket-modal-online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid white;
  background: #94a3b8;
}

.ticket-modal-online-dot.online {
  background: #10b981;
}

/* Messages */
.ticket-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  max-height: 380px;
  padding-right: 4px;
    scroll-behavior: auto !important; /* Forces instant jump, blocks smooth scrolling */
  overflow-y: auto;
}

.ticket-empty-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-size: 13px;
}

/* WhatsApp-style message layout */
.ticket-modal-message {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  max-width: 85%;
  align-items: flex-end;
}

.ticket-modal-message-me {
  margin-left: auto;
  flex-direction: row-reverse;
}

.ticket-modal-message-other {
  margin-right: auto;
}

.ticket-modal-message-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ticket-modal-message-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  padding: 0 3px;
}

.ticket-modal-message-me .ticket-modal-message-header {
  justify-content: flex-end;
}

.ticket-modal-message-author {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ticket-modal-role-badge {
  background: #dbeafe;
  color: #2563eb;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
}

.ticket-modal-message-time {
  font-size: 10px;
  color: #94a3b8;
}

.ticket-modal-message-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  word-wrap: break-word;
}

.ticket-modal-message-me .ticket-modal-message-bubble {
  background: #0891b2;
  color: white;
  border-bottom-right-radius: 3px;
  align-self: flex-end;
}

.ticket-modal-message-other .ticket-modal-message-bubble {
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 3px;
  border: 1px solid #e2e8f0;
  align-self: flex-start;
}

.ticket-modal-message-time-ago {
  font-size: 10px;
  color: #94a3b8;
  padding: 0 3px;
}

.ticket-modal-message-me .ticket-modal-message-time-ago {
  align-self: flex-end;
}

.ticket-modal-message-image-wrapper {
  margin-bottom: 3px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}

.ticket-modal-message-image {
  max-width: 220px;
  max-height: 180px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

/* Typing */
.ticket-typing-text {
  color: #0891b2;
  font-style: italic;
}

.ticket-typing-dots {
  display: inline-flex;
  gap: 2px;
  margin-left: 3px;
}

.ticket-typing-dots span {
  width: 3px;
  height: 3px;
  background: #0891b2;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.ticket-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.ticket-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Chat Input */
.ticket-chat-input {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  align-items: center;
  flex-shrink: 0;
}

.ticket-input-field {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.ticket-input-field:focus {
  border-color: #0891b2;
}

.ticket-send-btn {
  width: 40px;
  height: 40px;
  background: #0891b2;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ticket-send-btn:hover {
  background: #0e7490;
}

.ticket-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.ticket-attach-btn {
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ticket-attach-btn:hover {
  background: #e2e8f0;
  color: #0891b2;
}

.ticket-attach-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ticket-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Scrollbar */
.ticket-modal-content::-webkit-scrollbar,
.ticket-messages::-webkit-scrollbar {
  width: 5px;
}

.ticket-modal-content::-webkit-scrollbar-track,
.ticket-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ticket-modal-content::-webkit-scrollbar-thumb,
.ticket-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* Responsive */
@media (min-width: 640px) {
  .ticket-modal {
    border-radius: 20px;
    max-height: 80vh;
    margin-bottom: 20px;
  }
}/* ==========================================================
   Floating Audit Widget
   ⭐ The wrapper (.fw-wrap) is the fixed anchor.
   The tooltip is position:absolute INSIDE the wrapper,
   so it can NEVER drift away from its parent button.
   ========================================================== */

/* ---------- Fixed wrapper (button + tooltip anchor) ---------- */
.fw-wrap--audit {
  position: fixed;
  bottom: 100px; /* above the chat FAB */
  right: 50px;
  z-index: 100000;
  display: flex;
  align-items: center;
}

/* ---------- The FAB button ---------- */
.fw-fab--audit {
  position: relative; /* anchor for badge & pulse */
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow:
    0 4px 14px rgba(245, 158, 11, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;
}

.fw-fab--audit:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 20px rgba(245, 158, 11, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.15);
}

.fw-fab--audit:active {
  transform: scale(0.95);
}

.fw-fab--expanded {
  transform: scale(1.1);
}

.fw-fab__icon {
  transition: transform 0.3s ease;
}

.fw-fab--audit:hover .fw-fab__icon {
  transform: scale(1.1);
}

/* ---------- Badge — bottom-left of FAB ---------- */
.fw-badge {
  position: absolute;
  bottom: -4px;
  left: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
  border: 2px solid #fff;
  animation: fwBadgePulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes fwBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ---------- Pulse ring ---------- */
.fw-fab__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(245, 158, 11, 0.5);
  animation: fwPulseRing 2s ease-out infinite;
  pointer-events: none;
}

@keyframes fwPulseRing {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ---------- Tooltip — locked to the LEFT of the button ---------- */
.fw-tooltip {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px); /* flush left of the button, 12px gap */
  transform: translateY(-50%);
  background: #1e293b;
  color: #f8fafc;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left; /* text towards the left */
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.12);
  animation: fwTooltipIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fw-tooltip__text {
  text-align: left;
}

.fw-tooltip__close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.fw-tooltip__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Arrow on the RIGHT edge, pointing at the button */
.fw-tooltip__arrow {
  position: absolute;
  top: 50%;
  right: -5px;
  transform: translateY(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #1e293b;
  border-radius: 2px;
}

@keyframes fwTooltipIn {
  0% { opacity: 0; transform: translateY(-50%) translateX(10px); }
  100% { opacity: 1; transform: translateY(-50%) translateX(0); }
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  .fw-wrap--audit {
    bottom: 165px;
    right: 20px;
  }

  .fw-fab--audit {
    width: 48px;
    height: 48px;
  }

  .fw-tooltip {
    font-size: 12px;
    padding: 8px 12px;
  }

  .fw-badge {
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .fw-fab--audit,
  .fw-fab__icon {
    transition: none;
  }

  .fw-fab__pulse,
  .fw-badge,
  .fw-tooltip {
    animation: none;
  }
}.content-placeholder {
  padding: 20px;
  text-align: center;
  font-size: 18px;
  color: #666;
  background: white;
  margin: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .main-content {
    padding: 0;
  }

  .content-placeholder {
    margin: 10px;
    padding: 15px;
  }
}/* AuditDashboard.css - Scoped with 'auditz-' prefix to prevent global CSS conflicts */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.auditz-dashboard-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f0f2f5;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: visible !important;
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
.auditz-header {
  background: white;
  border-bottom: 1px solid #e1e4e8;
  width: 100%;
  position: relative;
  z-index: 1000;
  flex-shrink: 0;
}

.auditz-header-content {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.auditz-back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #24292f;
  cursor: pointer;
  transition: all 0.2s;
}

.auditz-back-button:hover {
  background: #eaeef2;
  border-color: #8b949e;
}

.auditz-back-button svg {
  width: 16px;
  height: 16px;
}

.auditz-title {
  font-size: 22px;
  font-weight: 700;
  color: #24292f;
  margin: 0;
}

.auditz-tabs {
  background: white;
  border-bottom: 1px solid #e1e4e8;
  width: 100%;
  flex-shrink: 0;
}

.auditz-tabs-list {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 0;
  padding: 0 24px;
  overflow-x: auto;
}

.auditz-tab {
  padding: 16px 24px;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: #57606a;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.auditz-tab:hover {
  color: #24292f;
  background: #f6f8fa;
}

.auditz-tab.active {
  color: #0969da;
  border-bottom-color: #0969da;
}

/* =========================================
   STATS & BANNERS
   ========================================= */
.auditz-stats-grid {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  padding: 24px;
  flex-shrink: 0;
}

.auditz-stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  border: 1px solid #d0d7de;
}

.auditz-stat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #57606a;
  margin-bottom: 8px;
}

.auditz-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #24292f;
  margin-bottom: 8px;
  line-height: 1;
}

.auditz-stat-subtext {
  font-size: 13px;
  color: #57606a;
  line-height: 1.4;
}

.auditz-stat-subtext.positive { color: #1a7f37; }
.auditz-stat-subtext.negative { color: #cf222e; }
.auditz-stat-subtext.warning { color: #9a6700; }

.auditz-info-banner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: #ddf4ff;
  border: 1px solid #b6e3ff;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.auditz-info-banner h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 700;
  color: #0969da;
}

.auditz-info-banner p {
  margin: 0;
  font-size: 14px;
  color: #24292f;
  line-height: 1.6;
}

/* =========================================
   MAIN CONTENT & FILTERS
   ========================================= */
.auditz-content-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 24px 40px;
  overflow-x: hidden;
  flex: 1;
}

.auditz-filter-bar {
  background: white;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
}

.auditz-filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}

.auditz-filter-item label {
  font-size: 12px;
  font-weight: 600;
  color: #57606a;
  text-transform: uppercase;
}

.auditz-filter-select {
  padding: 8px 12px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  color: #24292f;
  cursor: pointer;
}

.auditz-filter-select:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9,105,218,0.1);
}

/* =========================================
   SPLIT VIEW LAYOUT
   ========================================= */
.auditz-split-view {
  display: grid;
  grid-template-columns: 450px 1fr;
  gap: 24px;
  align-items: start;
}

/* =========================================
   AUDIT QUEUE LIST (SCROLLABLE)
   ========================================= */
.auditz-queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding-right: 8px;
}

.auditz-queue-list::-webkit-scrollbar { width: 8px; }
.auditz-queue-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.auditz-queue-list::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }
.auditz-queue-list::-webkit-scrollbar-thumb:hover { background: #555; }
.auditz-queue-list { scrollbar-width: thin; scrollbar-color: #888 #f1f1f1; }

.auditz-queue-item {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  border: 1px solid #d0d7de;
  cursor: pointer;
  border-left: 4px solid #d0d7de;
  transition: all 0.2s;
  flex-shrink: 0;
}

.auditz-queue-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.auditz-queue-item.selected {
  border-left-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9,105,218,0.1);
  border-color: #0969da;
}

.auditz-queue-item.high-severity { border-left-color: #cf222e; }
.auditz-queue-item.medium-severity { border-left-color: #d29922; }
.auditz-queue-item.low-severity { border-left-color: #1a7f37; }

.auditz-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 8px;
}

.auditz-severity-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.auditz-severity-badge.high { background: #ffebe9; color: #cf222e; }
.auditz-severity-badge.medium { background: #fff8c5; color: #9a6700; }
.auditz-severity-badge.routine { background: #dafbe1; color: #1a7f37; }

.auditz-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.auditz-status-badge.pending { background: #ffebe9; color: #cf222e; }
.auditz-status-badge.actioned { background: #dafbe1; color: #1a7f37; }

.auditz-client-name { font-size: 16px; font-weight: 700; color: #24292f; margin-bottom: 4px; }
.auditz-queue-meta { font-size: 12px; color: #57606a; margin-bottom: 10px; }

.auditz-queue-preview {
  font-size: 13px;
  color: #24292f;
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.auditz-keyword-highlight {
  background: #fff8c5;
  color: #9a6700;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
}

.auditz-queue-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.auditz-tag {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: #f6f8fa;
  color: #24292f;
  border: 1px solid #d0d7de;
}

/* =========================================
   REVIEW PANEL (SCROLLABLE)
   ========================================= */
.auditz-review-panel {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 1px solid #d0d7de;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 250px);
}

.auditz-review-header {
  background: #24292f;
  color: white;
  padding: 20px;
  flex-shrink: 0;
}

.auditz-review-entry-id { font-size: 11px; opacity: 0.8; margin-bottom: 4px; }
.auditz-review-client { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.auditz-review-meta { font-size: 13px; opacity: 0.9; }

.auditz-review-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.auditz-review-content::-webkit-scrollbar { width: 8px; }
.auditz-review-content::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.auditz-review-content::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }
.auditz-review-content::-webkit-scrollbar-thumb:hover { background: #555; }

.auditz-section { margin-bottom: 24px; }

.auditz-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #57606a;
  margin-bottom: 10px;
}

.auditz-flagged-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.auditz-flag-reason {
  padding: 4px 10px;
  background: #ffebe9;
  color: #cf222e;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #cf222e;
}

.auditz-note-box {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: #24292f;
}

.auditz-action-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.auditz-action-option {
  padding: 14px;
  border: 2px solid #d0d7de;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  background: white;
}

.auditz-action-option:hover { border-color: #8b949e; background: #f6f8fa; }
.auditz-action-option.selected { border-color: #0969da; background: #ddf4ff; }

.auditz-action-title { font-size: 14px; font-weight: 700; color: #24292f; margin-bottom: 4px; }
.auditz-action-desc { font-size: 11px; color: #57606a; }

.auditz-textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.auditz-textarea:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9,105,218,0.1);
}

.auditz-submit-section {
  padding: 16px 20px;
  border-top: 1px solid #d0d7de;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f6f8fa;
  flex-shrink: 0;
}

.auditz-required-note { font-size: 12px; color: #57606a; }

.auditz-submit-btn {
  padding: 10px 24px;
  background: #0969da;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.auditz-submit-btn:hover { background: #0550ae; }
.auditz-submit-btn:disabled { background: #8b949e; cursor: not-allowed; }

/* =========================================
   ANALYTICS PANEL V2
   ========================================= */
.auditz-analytics-panel-v2 {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #e5e7eb;
}

.auditz-analytics-title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 24px 0;
}

.auditz-analytics-filters-v2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.auditz-filter-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: block;
}

.auditz-analytics-summary-v2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.auditz-analytics-stat-v2 {
  background: #f9fafb;
  padding: 24px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
}

.auditz-analytics-stat-v2:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.auditz-stat-value-v2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1;
}

.auditz-stat-label-v2 {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.auditz-download-report-btn-v2 {
  width: 100%;
  padding: 16px 24px;
  background: #16a34a;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auditz-download-report-btn-v2:hover:not(:disabled) {
  background: #15803d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.auditz-download-report-btn-v2:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* =========================================
   KEYWORD RULES
   ========================================= */
.auditz-keyword-rules-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.auditz-keyword-rules-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #24292f;
  margin: 0;
}

.auditz-add-keyword-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #0969da;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.auditz-add-keyword-btn:hover {
  background: #0550ae;
  transform: translateY(-1px);
}

.auditz-keyword-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  max-height: calc(100vh - 350px);
  overflow-y: auto;
  padding-right: 8px;
  align-content: start;
}

.auditz-keyword-rules-grid::-webkit-scrollbar { width: 8px; }
.auditz-keyword-rules-grid::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.auditz-keyword-rules-grid::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }

.auditz-keyword-rule-card {
  background: white;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: all 0.2s;
  flex-shrink: 0;
}

.auditz-keyword-rule-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.auditz-keyword-rule-info { flex: 1; }
.auditz-keyword-rule-word { font-size: 14px; font-weight: 600; color: #24292f; }
.auditz-keyword-rule-category { font-size: 11px; color: #57606a; margin-top: 4px; }

.auditz-keyword-rule-severity {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid;
}

.auditz-keyword-rule-severity.high { background: #ffebe9; color: #cf222e; border-color: #cf222e; }
.auditz-keyword-rule-severity.medium { background: #fff8c5; color: #9a6700; border-color: #d29922; }
.auditz-keyword-rule-severity.routine { background: #dafbe1; color: #1a7f37; border-color: #1a7f37; }

.auditz-keyword-rule-actions {
  display: flex;
  gap: 8px;
  margin-left: 12px;
}

.auditz-keyword-action-btn {
  padding: 6px 10px;
  border: 1px solid #d0d7de;
  background: white;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auditz-keyword-action-btn:hover { background: #f6f8fa; border-color: #8b949e; }
.auditz-keyword-action-btn.edit { color: #0969da; border-color: #0969da; }
.auditz-keyword-action-btn.edit:hover { background: #0969da; color: white; }
.auditz-keyword-action-btn.delete { color: #cf222e; border-color: #cf222e; }
.auditz-keyword-action-btn.delete:hover { background: #cf222e; color: white; }

/* =========================================
   MODALS
   ========================================= */
.auditz-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: auditz-fadeIn 0.2s ease;
}

@keyframes auditz-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auditz-modal-content {
  background: white;
  border-radius: 12px;
  padding: 32px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: auditz-slideUp 0.3s ease;
}

@keyframes auditz-slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.auditz-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.auditz-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #24292f;
  margin: 0;
}

.auditz-modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #57606a;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.auditz-modal-close-btn:hover {
  background: #f6f8fa;
  color: #24292f;
}

.auditz-modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auditz-modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auditz-modal-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #24292f;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.auditz-modal-form-group input,
.auditz-modal-form-group select {
  padding: 10px 12px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  color: #24292f;
  transition: all 0.2s;
}

.auditz-modal-form-group input:focus,
.auditz-modal-form-group select:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9,105,218,0.1);
}

.auditz-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

.auditz-modal-btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #d0d7de;
}

.auditz-modal-btn-cancel { background: white; color: #24292f; }
.auditz-modal-btn-cancel:hover { background: #f6f8fa; }

.auditz-modal-btn-save { background: #0969da; color: white; border-color: #0969da; }
.auditz-modal-btn-save:hover { background: #0550ae; }
.auditz-modal-btn-save:disabled { background: #8b949e; border-color: #8b949e; cursor: not-allowed; }

.auditz-delete-modal-content {
  background: white;
  border-radius: 12px;
  padding: 32px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: auditz-slideUp 0.3s ease;
  text-align: center;
}

.auditz-delete-modal-icon { font-size: 48px; margin-bottom: 16px; }
.auditz-delete-modal-title { font-size: 18px; font-weight: 700; color: #24292f; margin-bottom: 8px; }
.auditz-delete-modal-message { font-size: 14px; color: #57606a; margin-bottom: 24px; line-height: 1.5; }

.auditz-delete-modal-actions { display: flex; gap: 12px; justify-content: center; }
.auditz-modal-btn-delete { background: #cf222e; color: white; border-color: #cf222e; }
.auditz-modal-btn-delete:hover { background: #a40e26; }

/* =========================================
   STATES & UTILITIES
   ========================================= */
.auditz-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #57606a;
}

.auditz-empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.auditz-empty-state h3 { font-size: 18px; color: #24292f; margin-bottom: 8px; }
.auditz-empty-state p { font-size: 14px; color: #57606a; }

.auditz-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 100px;
  width: 100%;
}

.auditz-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f6f8fa;
  border-top-color: #0969da;
  border-radius: 50%;
  animation: auditz-spin 1s linear infinite;
}

@keyframes auditz-spin { to { transform: rotate(360deg); } }

.auditz-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 14px 20px;
  background: #24292f;
  color: white;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 3000;
  animation: auditz-slideUp 0.3s ease-out;
  font-weight: 600;
  font-size: 14px;
}

.auditz-retry-button {
  padding: 8px 16px;
  background: #0969da;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
}

.auditz-retry-button:hover {
  background: #0550ae;
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 1024px) {
  .auditz-split-view { 
    grid-template-columns: 1fr; 
  }
  .auditz-queue-list { 
    max-height: 400px;
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
  }
  .auditz-review-panel { 
    max-height: none; 
  }
  
  .auditz-analytics-filters-v2 {
    grid-template-columns: 1fr;
  }
  
  .auditz-analytics-summary-v2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .auditz-header-content { padding: 12px 16px; flex-direction: column; gap: 12px; align-items: flex-start; }
  .auditz-title { font-size: 18px; }
  .auditz-tabs-list { padding: 0 16px; }
  .auditz-tab { padding: 12px 16px; font-size: 14px; }
  .auditz-stats-grid { grid-template-columns: 1fr; padding: 16px; }
  .auditz-info-banner { padding: 16px; margin: 0 16px 16px; }
  .auditz-content-wrapper { padding: 0 16px 24px; }
  .auditz-filter-bar { flex-direction: column; gap: 12px; }
  .auditz-filter-item { min-width: 100%; }
  .auditz-action-selector { grid-template-columns: 1fr; }
  .auditz-submit-section { flex-direction: column; gap: 12px; align-items: stretch; }
  .auditz-submit-btn { width: 100%; }
  .auditz-keyword-rules-header { flex-direction: column; gap: 12px; align-items: stretch; }
  .auditz-add-keyword-btn { width: 100%; justify-content: center; }
  .auditz-modal-content { padding: 24px; }
  .auditz-modal-actions { flex-direction: column; }
  .auditz-modal-btn { width: 100%; }
  
  .auditz-analytics-summary-v2 {
    grid-template-columns: 1fr;
  }
  
  .auditz-analytics-panel-v2 {
    padding: 20px;
  }
  
  .auditz-stat-value-v2 {
    font-size: 28px;
  }
}/* Blacklist Management Styles */

.blacklist-container {
    --bl-primary: #2563eb;
    --bl-primary-dark: #1d4ed8;
    --bl-primary-light: #eff6ff;
    --bl-danger: #dc2626;
    --bl-danger-dark: #b91c1c;
    --bl-danger-light: #fef2f2;
    --bl-success: #16a34a;
    --bl-success-light: #f0fdf4;
    --bl-warning: #d97706;
    --bl-warning-light: #fffbeb;
    --bl-text: #111827;
    --bl-text-muted: #6b7280;
    --bl-border: #e5e7eb;
    --bl-surface: #ffffff;
    --bl-bg: #f9fafb;
    --bl-radius: 8px;
    --bl-radius-sm: 6px;
    --bl-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --bl-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
    --bl-shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);

    width: 100%;
    height: 100%;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    padding: 1.25rem clamp(1rem, 3vw, 2rem);
    background: var(--bl-bg);
    color: var(--bl-text);
    font-feature-settings: "tnum";

    /* Firefox scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.blacklist-container *,
.blacklist-container *::before,
.blacklist-container *::after {
    box-sizing: border-box;
}

/* Visible right-hand scrollbar (WebKit/Chromium/Edge) */
.blacklist-container::-webkit-scrollbar {
    width: 10px;
}

.blacklist-container::-webkit-scrollbar-track {
    background: transparent;
}

.blacklist-container::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 8px;
    border: 2px solid var(--bl-bg);
}

.blacklist-container::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* ═══════════════ Compact Single-Line Header Bar ═══════════════ */
.blacklist-header-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    margin-bottom: 1rem;
    padding: 0.625rem 0.875rem;
    background: var(--bl-surface);
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius);
    box-shadow: var(--bl-shadow-sm);
}

.blacklist-title-block {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    line-height: 1.1;
}

.blacklist-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--bl-text);
    margin: 0;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.blacklist-subtitle {
    display: none; /* hidden to keep everything on one line; title says it all */
}

.blacklist-search-box {
    flex: 1 1 auto;
    min-width: 140px;
}

.blacklist-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius-sm);
    font-size: 0.875rem;
    background: var(--bl-bg);
    color: var(--bl-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.blacklist-search-input::placeholder {
    color: #9ca3af;
}

.blacklist-search-input:focus {
    outline: none;
    border-color: var(--bl-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: var(--bl-surface);
}

/* Mini stat chips inline in the header bar */
.blacklist-mini-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.blacklist-stat-chip {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.375rem 0.625rem;
    background: var(--bl-bg);
    border: 1px solid var(--bl-border);
    border-radius: 999px;
    white-space: nowrap;
}

.blacklist-stat-chip .value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--bl-primary);
    line-height: 1;
}

.blacklist-stat-chip .label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--bl-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Alerts */
.blacklist-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--bl-radius-sm);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    border: 1px solid transparent;
    animation: blacklist-slideIn 0.2s ease;
}

@keyframes blacklist-slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.blacklist-alert-error {
    background: var(--bl-danger-light);
    border-color: #fecaca;
    color: var(--bl-danger-dark);
}

.blacklist-alert-success {
    background: var(--bl-success-light);
    border-color: #bbf7d0;
    color: #15803d;
}

.blacklist-close-alert {
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.15s;
    padding: 0;
    margin-left: 1rem;
}

.blacklist-close-alert:hover {
    opacity: 1;
}

/* Buttons */
.blacklist-btn {
    padding: 0.5rem 0.9rem;
    border: 1px solid transparent;
    border-radius: var(--bl-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.blacklist-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.blacklist-btn-primary {
    background: var(--bl-primary);
    color: #fff;
}

.blacklist-btn-primary:hover {
    background: var(--bl-primary-dark);
}

.blacklist-btn-secondary {
    background: var(--bl-surface);
    color: var(--bl-text);
    border-color: var(--bl-border);
}

.blacklist-btn-secondary:hover {
    background: var(--bl-bg);
    border-color: #d1d5db;
}

.blacklist-btn-danger {
    background: var(--bl-surface);
    color: var(--bl-danger);
    border-color: #fecaca;
}

.blacklist-btn-danger:hover {
    background: var(--bl-danger);
    color: #fff;
    border-color: var(--bl-danger);
}

.blacklist-btn-small {
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
}

.blacklist-btn-icon {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
}

/* Loading */
.blacklist-loading {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--bl-text-muted);
}

.blacklist-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bl-border);
    border-top-color: var(--bl-primary);
    border-radius: 50%;
    animation: blacklist-spin 0.7s linear infinite;
    margin: 0 auto 0.75rem;
}

@keyframes blacklist-spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.blacklist-empty {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bl-surface);
    border: 1px dashed var(--bl-border);
    border-radius: var(--bl-radius);
}

.blacklist-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

.blacklist-empty h3 {
    color: var(--bl-text);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.blacklist-empty p {
    color: var(--bl-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* Grid Layout */
.blacklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
    gap: 1rem;
    width: 100%;
    padding-bottom: 1.25rem;
}

/* Card */
.blacklist-card {
    background: var(--bl-surface);
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius);
    overflow: hidden;
    box-shadow: var(--bl-shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s;
    display: flex;
    flex-direction: column;
}

.blacklist-card:hover {
    box-shadow: var(--bl-shadow-md);
    border-color: #d1d5db;
}

.blacklist-card-header {
    padding: 0.75rem 0.875rem;
    background: var(--bl-bg);
    border-bottom: 1px solid var(--bl-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.blacklist-staff-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.blacklist-staff-photo,
.blacklist-staff-photo-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
}

.blacklist-staff-photo {
    object-fit: cover;
    border: 1px solid var(--bl-border);
}

.blacklist-staff-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bl-primary), var(--bl-primary-dark));
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    border: 1px solid var(--bl-border);
}

.blacklist-staff-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.blacklist-staff-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bl-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blacklist-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.blacklist-card-body {
    padding: 0.875rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blacklist-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--bl-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.375rem;
}

.blacklist-client-info {
    background: var(--bl-bg);
    border: 1px solid var(--bl-border);
    padding: 0.625rem 0.75rem;
    border-radius: var(--bl-radius-sm);
    margin-bottom: 0.875rem;
}

.blacklist-client-name {
    font-weight: 600;
    color: var(--bl-text);
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.blacklist-client-phone {
    color: var(--bl-primary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.blacklist-reason-section {
    margin-bottom: 0.875rem;
}

.blacklist-reason-text {
    background: var(--bl-warning-light);
    border-left: 3px solid var(--bl-warning);
    padding: 0.625rem 0.875rem;
    border-radius: 0 var(--bl-radius-sm) var(--bl-radius-sm) 0;
    color: #92400e;
    font-size: 0.8125rem;
    line-height: 1.5;
    margin: 0;
}

.blacklist-footer {
    border-top: 1px solid var(--bl-border);
    padding-top: 0.625rem;
    margin-top: auto;
}

.blacklist-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--bl-text-muted);
}

.blacklist-banned-by {
    font-weight: 500;
    color: var(--bl-text);
}

.blacklist-banned-date {
    color: #9ca3af;
}

/* Modal */
.blacklist-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    animation: blacklist-fadeIn 0.15s ease;
}

@keyframes blacklist-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.blacklist-modal {
    background: var(--bl-surface);
    border-radius: var(--bl-radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    animation: blacklist-slideUp 0.2s ease;
}

@keyframes blacklist-slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.blacklist-modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--bl-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bl-surface);
    z-index: 2;
}

.blacklist-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bl-text);
}

.blacklist-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--bl-text-muted);
    transition: color 0.15s;
    padding: 0.25rem;
}

.blacklist-modal-close:hover {
    color: var(--bl-text);
}

/* Form */
.blacklist-form {
    padding: 1.25rem;
}

.blacklist-form-group {
    margin-bottom: 1rem;
    position: relative;
}

.blacklist-form-label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--bl-text);
}

.blacklist-required {
    color: var(--bl-danger);
}

.blacklist-form-input,
.blacklist-form-select,
.blacklist-form-textarea {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--bl-text);
    background: var(--bl-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.blacklist-form-input:focus,
.blacklist-form-select:focus,
.blacklist-form-textarea:focus {
    outline: none;
    border-color: var(--bl-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.blacklist-form-textarea {
    resize: vertical;
    min-height: 90px;
}

.blacklist-form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bl-border);
}

/* ═══════════════ Custom Searchable / Scrollable Dropdown ═══════════════ */
.blacklist-select-wrapper {
    position: relative;
}

.blacklist-select-trigger {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius-sm);
    font-size: 0.875rem;
    background: var(--bl-surface);
    color: var(--bl-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-align: left;
}

.blacklist-select-trigger.placeholder {
    color: #9ca3af;
}

.blacklist-select-trigger:focus,
.blacklist-select-trigger.open {
    outline: none;
    border-color: var(--bl-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.blacklist-select-caret {
    font-size: 0.7rem;
    color: var(--bl-text-muted);
    transition: transform 0.15s;
    flex-shrink: 0;
}

.blacklist-select-trigger.open .blacklist-select-caret {
    transform: rotate(180deg);
}

.blacklist-select-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bl-surface);
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius-sm);
    box-shadow: var(--bl-shadow-md);
    z-index: 50;
    overflow: hidden;
}

.blacklist-select-search {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: none;
    border-bottom: 1px solid var(--bl-border);
    font-size: 0.8125rem;
    outline: none;
}

/* This is the part that guarantees scrolling works, even inside a
   scrolling modal — a fixed max-height with its own overflow-y. */
.blacklist-select-list {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.blacklist-select-list::-webkit-scrollbar {
    width: 8px;
}

.blacklist-select-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 8px;
}

.blacklist-select-option {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--bl-text);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blacklist-select-option:hover {
    background: var(--bl-primary-light);
}

.blacklist-select-option.selected {
    background: var(--bl-primary-light);
    color: var(--bl-primary-dark);
    font-weight: 600;
}

.blacklist-select-empty {
    padding: 0.75rem;
    font-size: 0.8125rem;
    color: var(--bl-text-muted);
    text-align: center;
}

/* ═══════════════ Toast Notifications (replaces alert()) ═══════════════ */
.blacklist-toast-stack {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 360px;
    width: calc(100% - 2.5rem);
}

.blacklist-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    border-radius: var(--bl-radius-sm);
    box-shadow: var(--bl-shadow-md);
    font-size: 0.8125rem;
    line-height: 1.4;
    background: var(--bl-surface);
    border: 1px solid var(--bl-border);
    animation: blacklist-toastIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes blacklist-toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.blacklist-toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 800;
    color: #fff;
}

.blacklist-toast-success { border-color: #bbf7d0; }
.blacklist-toast-success .blacklist-toast-icon { background: var(--bl-success); }

.blacklist-toast-error { border-color: #fecaca; }
.blacklist-toast-error .blacklist-toast-icon { background: var(--bl-danger); }

.blacklist-toast-warning { border-color: #fde68a; }
.blacklist-toast-warning .blacklist-toast-icon { background: var(--bl-warning); }

.blacklist-toast-info { border-color: #bfdbfe; }
.blacklist-toast-info .blacklist-toast-icon { background: var(--bl-primary); }

.blacklist-toast-message {
    flex: 1;
    color: var(--bl-text);
}

.blacklist-toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--bl-text-muted);
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.blacklist-toast-close:hover {
    color: var(--bl-text);
}

/* ═══════════════ Custom Confirm Modal (replaces window.confirm) ═══════════════ */
.blacklist-confirm-modal {
    background: var(--bl-surface);
    border-radius: var(--bl-radius);
    width: 100%;
    max-width: 400px;
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    animation: blacklist-slideUp 0.2s ease;
    text-align: center;
}

.blacklist-confirm-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bl-danger-light);
    color: var(--bl-danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    font-weight: 800;
    margin: 0 auto 0.875rem;
}

.blacklist-confirm-title {
    margin: 0 0 0.5rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--bl-text);
}

.blacklist-confirm-message {
    margin: 0 0 1.5rem;
    font-size: 0.875rem;
    color: var(--bl-text-muted);
    line-height: 1.5;
}

.blacklist-confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.blacklist-confirm-actions .blacklist-btn {
    flex: 1;
}

.blacklist-btn-danger-solid {
    background: var(--bl-danger);
    color: #fff;
    border-color: var(--bl-danger);
}

.blacklist-btn-danger-solid:hover {
    background: var(--bl-danger-dark);
    border-color: var(--bl-danger-dark);
}

/* Responsive */
@media (max-width: 900px) {
    .blacklist-header-bar {
        flex-wrap: wrap;
    }

    .blacklist-mini-stats {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 1024px) {
    .blacklist-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    }
}

@media (max-width: 768px) {
    .blacklist-container {
        padding: 1rem 0.875rem;
    }

    .blacklist-header-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .blacklist-search-box {
        min-width: 100%;
    }

    .blacklist-header-bar .blacklist-btn {
        width: 100%;
    }

    .blacklist-grid {
        grid-template-columns: 1fr;
    }

    .blacklist-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .blacklist-modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--bl-radius) var(--bl-radius) 0 0;
    }
}

@media (max-width: 480px) {
    .blacklist-title {
        font-size: 0.9375rem;
    }

    .blacklist-card-header {
        flex-wrap: wrap;
    }

    .blacklist-card-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .blacklist-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .blacklist-form {
        padding: 1rem;
    }

    .blacklist-form-actions {
        flex-direction: column-reverse;
    }

    .blacklist-form-actions .blacklist-btn {
        width: 100%;
    }
}/* ═══════════════════════════════════════════════════════════
   Days Off Tracker
   Desktop: sticky-header rota grid with a pinned staff column
   Mobile (< 768px): one card per staff member, two week rows
═══════════════════════════════════════════════════════════ */

.daysOff-container {
  --do-ink: #1d2330;
  --do-text: #344054;
  --do-muted: #667085;
  --do-faint: #98a2b3;
  --do-line: #e4e7ec;
  --do-line-strong: #cfd4dc;
  --do-bg: #f5f6f8;
  --do-surface: #ffffff;
  --do-hover: #f9fafb;

  --do-accent: #9d1f63;
  --do-accent-ink: #7d174e;
  --do-accent-soft: #fbeaf3;

  --do-off-bg: #fdecec;
  --do-off-ink: #b42318;
  --do-off-line: #f4b6b0;

  --do-ot-bg: #fff4e0;
  --do-ot-ink: #a15c07;
  --do-ot-line: #f3d08f;

  --do-ok-bg: #e7f6ee;
  --do-ok-ink: #157347;

  --do-radius: 12px;
  --do-staff-w: 250px;
  --do-cols: var(--do-staff-w) 128px repeat(14, minmax(40px, 1fr)) 120px;

  padding: 24px;
  background: var(--do-bg);
  color: var(--do-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  min-height: 600px;
  box-sizing: border-box;
}

.daysOff-container *,
.daysOff-container *::before,
.daysOff-container *::after { box-sizing: border-box; }

.daysOff-container button { font-family: inherit; }

.daysOff-container button:focus-visible,
.daysOff-container input:focus-visible {
  outline: 2px solid var(--do-accent);
  outline-offset: 2px;
}

/* ── Toolbar (one line on wide screens) ── */
.daysOff-toolbar {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.daysOff-title-block { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.daysOff-icon-wrapper {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--do-accent-soft);
  color: var(--do-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.daysOff-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--do-ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.daysOff-info { display: inline-flex; color: var(--do-faint); cursor: help; border-radius: 50%; }
.daysOff-info:hover, .daysOff-info:focus-visible { color: var(--do-accent); }

/* summary pills */
.daysOff-pills { display: flex; gap: 6px; flex-shrink: 0; }
.daysOff-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  background: var(--do-surface);
  border: 1px solid var(--do-line);
  border-radius: 999px;
  color: var(--do-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}
.daysOff-pill strong { color: var(--do-ink); font-variant-numeric: tabular-nums; }
.daysOff-pill.is-button { cursor: pointer; }
.daysOff-pill.is-button:hover { border-color: var(--do-accent); }
.daysOff-pill.is-warn { border-color: var(--do-ot-line); background: var(--do-ot-bg); color: var(--do-ot-ink); }
.daysOff-pill.is-warn strong { color: var(--do-ot-ink); }
.daysOff-pill.is-active { background: var(--do-ot-ink); border-color: var(--do-ot-ink); color: #fff; }
.daysOff-pill.is-active strong { color: #fff; }

/* search */
.daysOff-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  flex: 0 1 210px;
  min-width: 150px;
  padding: 0 10px;
  background: var(--do-surface);
  border: 1px solid var(--do-line-strong);
  border-radius: 10px;
  color: var(--do-muted);
}
.daysOff-search:focus-within { border-color: var(--do-accent); box-shadow: 0 0 0 3px var(--do-accent-soft); }
.daysOff-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none !important;
  background: transparent;
  font-size: 0.85rem;
  color: var(--do-ink);
}
.daysOff-search input::-webkit-search-cancel-button { display: none; }
.daysOff-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--do-bg);
  color: var(--do-muted);
  cursor: pointer;
}
.daysOff-search-clear:hover { color: var(--do-off-ink); }

/* type chips */
.daysOff-chips { display: flex; gap: 6px; flex-wrap: nowrap; }
.daysOff-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  background: var(--do-surface);
  border: 1px solid var(--do-line-strong);
  border-radius: 999px;
  color: var(--do-text);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.daysOff-chip:hover { border-color: var(--do-accent); }
.daysOff-chip-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--do-bg);
  color: var(--do-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.daysOff-chip.is-active { background: var(--do-ink); border-color: var(--do-ink); color: #fff; }
.daysOff-chip.is-active .daysOff-chip-count { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* week navigation, pushed to the right edge */
.daysOff-week-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }

.daysOff-nav-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--do-surface);
  border: 1px solid var(--do-line-strong);
  border-radius: 10px;
  color: var(--do-text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.daysOff-nav-btn:hover { background: var(--do-hover); border-color: var(--do-accent); color: var(--do-accent); }

.daysOff-range {
  height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  background: var(--do-surface);
  border: 1px solid var(--do-line-strong);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--do-ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.daysOff-today-btn {
  height: 34px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--do-accent);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.daysOff-today-btn:hover:not(:disabled) { background: var(--do-accent-soft); }
.daysOff-today-btn:disabled { color: var(--do-faint); cursor: default; }

/* ── Desktop table ── */
.daysOff-table-wrap {
  background: var(--do-surface);
  border: 1px solid var(--do-line);
  border-radius: var(--do-radius);
  overflow: auto;
  max-height: calc(100vh - 120px);
  min-height: 360px;
  transition: opacity 0.2s;
}
.daysOff-table-wrap.is-refreshing,
.daysOff-cards.is-refreshing { opacity: 0.55; pointer-events: none; }

.daysOff-table { min-width: 1060px; }

.daysOff-thead {
  display: grid;
  grid-template-columns: var(--do-cols);
  grid-template-rows: 30px 44px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--do-surface);
}

.daysOff-th {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  border-bottom: 1px solid var(--do-line-strong);
  color: var(--do-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.daysOff-th-staff,
.daysOff-th-type,
.daysOff-th-summary { grid-row: 1 / span 2; }
.daysOff-th-staff {
  grid-column: 1;
  justify-content: flex-start;
  padding-left: 16px;
  position: sticky;
  left: 0;
  z-index: 2;
  border-right: 1px solid var(--do-line);
}
.daysOff-th-type { grid-column: 2; justify-content: flex-start; padding-left: 8px; }
.daysOff-th-summary { grid-column: 17; }

.daysOff-th-week {
  grid-row: 1;
  color: var(--do-ink);
  border-bottom: 1px solid var(--do-line);
  background: #f3f4f6;
}

.daysOff-th-day {
  grid-row: 2;
  flex-direction: column;
  gap: 1px;
}
.daysOff-th-day .daysOff-day-name { font-size: 0.72rem; color: var(--do-muted); font-weight: 600; }
.daysOff-th-day .daysOff-day-date {
  font-size: 0.95rem;
  color: var(--do-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.daysOff-th-day.is-weekend { background: #f3f4f6; }
.daysOff-th-day.is-today { background: var(--do-accent-soft); }
.daysOff-th-day.is-today .daysOff-day-name,
.daysOff-th-day.is-today .daysOff-day-date { color: var(--do-accent-ink); }

.is-week-start { border-left: 2px solid var(--do-line-strong); }

/* rows */
.daysOff-row {
  display: grid;
  grid-template-columns: var(--do-cols);
  align-items: stretch;
  border-bottom: 1px solid var(--do-line);
}
.daysOff-row:last-child { border-bottom: none; }
.daysOff-row:hover > div { background: var(--do-hover); }
.daysOff-row:hover > .daysOff-cell.is-weekend { background: #f3f4f6; }
.daysOff-row:hover > .daysOff-cell.is-today { background: #f9dcea; }

.daysOff-row > div { background: var(--do-surface); }

.daysOff-staff {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 16px;
  border-right: 1px solid var(--do-line);
  min-width: 0;
}

.daysOff-staff-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.daysOff-staff-name {
  font-weight: 600;
  color: var(--do-ink);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.daysOff-staff-role {
  font-size: 0.78rem;
  color: var(--do-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daysOff-edited-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--do-accent);
  flex-shrink: 0;
}
.daysOff-row.is-modified .daysOff-staff { box-shadow: inset 3px 0 0 var(--do-accent); }

.daysOff-avatar,
.daysOff-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}
.daysOff-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eaecf0;
  color: var(--do-text);
  font-size: 0.78rem;
  font-weight: 700;
}
.daysOff-avatar-img { object-fit: cover; border: 1px solid var(--do-line); background: #eaecf0; }

.daysOff-type-cell { display: flex; align-items: center; padding: 0 8px; }

/* type badges */
.daysOff-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.daysOff-badge:hover { box-shadow: 0 2px 8px rgba(16, 24, 40, 0.14); }
.daysOff-badge-text { overflow: hidden; text-overflow: ellipsis; }
.daysOff-badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.daysOff-badge-edit-icon { opacity: 0.55; flex-shrink: 0; }

.daysOff-badge-fulltime { background: var(--do-ok-bg); color: var(--do-ok-ink); border-color: #b7e2c9; }
.daysOff-badge-parttime { background: #e8f1ff; color: #1d4ed8; border-color: #bcd3fb; }
.daysOff-badge-livein   { background: var(--do-ot-bg); color: var(--do-ot-ink); border-color: var(--do-ot-line); }
.daysOff-badge-special  { background: #f1e9fb; color: #6d28d9; border-color: #d9c6f4; }
.daysOff-badge-custom   { background: #eef0f3; color: #475467; border-color: #d0d5dd; }

/* day cells */
.daysOff-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 3px;
}
.daysOff-cell.is-weekend { background: #fafafb; }
.daysOff-cell.is-today { background: #fdf2f8 !important; }

.daysOff-day {
  width: 100%;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.daysOff-day.is-working { color: var(--do-faint); }
.daysOff-day.is-working:hover {
  background: var(--do-surface);
  border-color: var(--do-off-line);
  color: var(--do-off-ink);
}
.daysOff-day.is-working:hover .daysOff-day-dot { background: var(--do-off-ink); }
.daysOff-day-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d0d5dd;
  transition: background 0.12s;
}

.daysOff-day.is-off {
  background: var(--do-off-bg);
  border-color: var(--do-off-line);
  color: var(--do-off-ink);
}
.daysOff-day.is-off:hover { background: #fbd9d6; }

/* summary */
.daysOff-summary-cell { display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.daysOff-summary { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.daysOff-summary-count { font-weight: 700; color: var(--do-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.daysOff-summary-count.is-short { color: var(--do-ot-ink); }
.daysOff-summary-count.is-met { color: var(--do-ok-ink); }
.daysOff-summary-of { font-weight: 500; color: var(--do-muted); font-size: 0.76rem; }

.daysOff-overtime-badge {
  display: inline-block;
  padding: 1px 8px;
  background: var(--do-ot-bg);
  color: var(--do-ot-ink);
  border: 1px solid var(--do-ot-line);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Mobile cards ── */
.daysOff-cards { display: flex; flex-direction: column; gap: 12px; padding-bottom: 88px; }
.daysOff-cards-period {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--do-muted);
  padding: 0 2px;
}

.daysOff-card {
  background: var(--do-surface);
  border: 1px solid var(--do-line);
  border-radius: var(--do-radius);
  padding: 14px;
}
.daysOff-card.is-modified { border-color: var(--do-accent); box-shadow: 0 0 0 1px var(--do-accent); }

.daysOff-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.daysOff-card-head .daysOff-badge { flex-shrink: 0; }

.daysOff-card-week + .daysOff-card-week { margin-top: 12px; }
.daysOff-card-week-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--do-ink);
}
.daysOff-card-week-label span { font-weight: 500; color: var(--do-muted); }

.daysOff-card-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }

.daysOff-mday {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 58px;
  padding: 6px 0 4px;
  border: 1px solid var(--do-line);
  border-radius: 8px;
  background: var(--do-surface);
  color: var(--do-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.daysOff-mday.is-weekend { background: #f6f7f9; }
.daysOff-mday.is-today { border-color: var(--do-accent); box-shadow: inset 0 0 0 1px var(--do-accent); }
.daysOff-mday-name { font-size: 0.64rem; font-weight: 600; color: var(--do-muted); }
.daysOff-mday-date { font-size: 1rem; font-weight: 700; color: var(--do-ink); font-variant-numeric: tabular-nums; }
.daysOff-mday-state { font-size: 0.62rem; font-weight: 700; min-height: 12px; }
.daysOff-mday.is-off { background: var(--do-off-bg); border-color: var(--do-off-line); }
.daysOff-mday.is-off .daysOff-mday-name,
.daysOff-mday.is-off .daysOff-mday-date,
.daysOff-mday.is-off .daysOff-mday-state { color: var(--do-off-ink); }
.daysOff-mday:active { transform: scale(0.96); }

.daysOff-card-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--do-line);
}
.daysOff-card-foot .daysOff-summary { flex-direction: row; justify-content: space-between; width: 100%; }

/* ── Empty / error / skeleton ── */
.daysOff-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 20px;
  background: var(--do-surface);
  border: 1px dashed var(--do-line-strong);
  border-radius: var(--do-radius);
  text-align: center;
  color: var(--do-muted);
}
.daysOff-state h3 { margin: 0; color: var(--do-ink); font-size: 1rem; }
.daysOff-state p { margin: 0 0 8px; max-width: 360px; }
.daysOff-state.is-error { color: var(--do-off-ink); border-color: var(--do-off-line); }

.daysOff-skeleton {
  background: var(--do-surface);
  border: 1px solid var(--do-line);
  border-radius: var(--do-radius);
  overflow: hidden;
}
.daysOff-skeleton-row {
  height: 62px;
  border-bottom: 1px solid var(--do-line);
  background: linear-gradient(90deg, #f3f4f6 25%, #eceef1 37%, #f3f4f6 63%);
  background-size: 400% 100%;
  animation: daysOff-shimmer 1.4s ease infinite;
}
.daysOff-skeleton-row:last-child { border-bottom: none; }
@keyframes daysOff-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── Legend ── */
.daysOff-legend {
  display: flex;
  align-items: center;
  gap: 8px 22px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--do-muted);
  font-size: 0.8rem;
}
.daysOff-legend-item { display: inline-flex; align-items: center; gap: 8px; }
.daysOff-legend-swatch {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--do-line-strong);
  background: var(--do-surface);
}
.daysOff-legend-swatch.is-off { background: var(--do-off-bg); border-color: var(--do-off-line); }
.daysOff-legend-swatch.is-today { background: #fdf2f8; border-color: var(--do-accent); }

/* ── Floating save bar ── */
.daysOff-savebar {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 10px 10px 10px 18px;
  background: var(--do-ink);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.35);
  animation: daysOff-rise 0.2s ease-out;
  margin-bottom: 20px;
}
@keyframes daysOff-rise {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.daysOff-savebar-text { font-size: 0.85rem; font-weight: 500; margin-right: 6px; white-space: nowrap; }

.daysOff-savebar-discard,
.daysOff-savebar-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: none;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.daysOff-savebar-discard { background: rgba(255, 255, 255, 0.12); color: #fff; }
.daysOff-savebar-discard:hover:not(:disabled) { background: rgba(255, 255, 255, 0.22); }
.daysOff-savebar-save { background: #fff; color: var(--do-ink); }
.daysOff-savebar-save:hover:not(:disabled) { background: var(--do-accent-soft); }
.daysOff-savebar button:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Toast ── */
.daysOff-toast {
  position: fixed;
  top: 200px;
  right: 20px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(380px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--do-surface);
  border: 1px solid var(--do-line);
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.18);
  font-size: 0.88rem;
  color: var(--do-ink);
}
.daysOff-toast.is-success svg { color: var(--do-ok-ink); }
.daysOff-toast.is-error { border-color: var(--do-off-line); }
.daysOff-toast.is-error svg { color: var(--do-off-ink); }

/* ── Buttons shared ── */
.daysOff-btn-primary,
.daysOff-btn-secondary,
.daysOff-btn-danger {
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.daysOff-btn-primary { background: var(--do-accent); color: #fff; }
.daysOff-btn-primary:hover:not(:disabled) { background: var(--do-accent-ink); }
.daysOff-btn-secondary { background: var(--do-surface); color: var(--do-text); border-color: var(--do-line-strong); }
.daysOff-btn-secondary:hover:not(:disabled) { background: var(--do-hover); }
.daysOff-btn-danger { background: var(--do-off-bg); color: var(--do-off-ink); border-color: var(--do-off-line); margin-right: auto; }
.daysOff-btn-danger:hover:not(:disabled) { background: #fbd9d6; }
.daysOff-container button:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Modal ── */
.daysOff-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(16, 24, 40, 0.55);
}
.daysOff-modal {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--do-surface);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.35);
  animation: daysOff-pop 0.15s ease-out;
}
@keyframes daysOff-pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

.daysOff-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--do-line);
}
.daysOff-modal-title { margin: 0; font-size: 1.05rem; color: var(--do-ink); }
.daysOff-modal-sub { margin: 2px 0 0; color: var(--do-muted); font-size: 0.85rem; }
.daysOff-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--do-muted);
  cursor: pointer;
}
.daysOff-icon-btn:hover { background: var(--do-bg); color: var(--do-ink); }

.daysOff-modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 18px; }
.daysOff-modal-status { margin: 0; color: var(--do-muted); font-size: 0.85rem; }

.daysOff-form-label { display: block; margin-bottom: 8px; font-size: 0.82rem; font-weight: 600; color: var(--do-ink); }

.daysOff-type-options { display: flex; flex-wrap: wrap; gap: 8px; }
.daysOff-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 14px;
  background: var(--do-surface);
  border: 1px solid var(--do-line-strong);
  border-radius: 10px;
  color: var(--do-text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
.daysOff-option:hover { border-color: var(--do-accent); }
.daysOff-option.is-selected {
  background: var(--do-accent-soft);
  border-color: var(--do-accent);
  color: var(--do-accent-ink);
  font-weight: 600;
}

.daysOff-form-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--do-line-strong);
  border-radius: 10px;
  font-size: 16px; /* prevents iOS zoom on focus */
  color: var(--do-ink);
  background: var(--do-surface);
}
.daysOff-custom-input { margin-top: 10px; }

.daysOff-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--do-line-strong);
  border-radius: 10px;
  overflow: hidden;
}
.daysOff-stepper button {
  width: 44px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--do-hover);
  color: var(--do-text);
  cursor: pointer;
}
.daysOff-stepper button:hover:not(:disabled) { background: var(--do-accent-soft); color: var(--do-accent); }
.daysOff-stepper output {
  min-width: 52px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--do-ink);
  font-variant-numeric: tabular-nums;
}

.daysOff-helper-text { margin: 10px 0 0; font-size: 0.8rem; color: var(--do-muted); }
.daysOff-helper-text strong { color: var(--do-ink); }

.daysOff-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--do-line);
}

/* ═════════════ Responsive ═════════════ */
@media (max-width: 1200px) {
  .daysOff-container { --do-staff-w: 210px; padding: 16px; }
}

@media (max-width: 1100px) {
  .daysOff-week-nav { margin-left: 0; }
}

@media (max-width: 767px) {
  .daysOff-container { padding: 12px; }

  .daysOff-toolbar { gap: 10px; }
  .daysOff-title-block { order: 1; width: 100%; }
  .daysOff-week-nav { order: 2; width: 100%; margin-left: 0; justify-content: space-between; }
  .daysOff-range { flex: 1; justify-content: center; }
  .daysOff-search { order: 3; flex: 1 1 100%; }
  .daysOff-search input { font-size: 16px; }
  .daysOff-pills { order: 4; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .daysOff-pills::-webkit-scrollbar { display: none; }
  .daysOff-chips {
    order: 5;
    width: calc(100% + 24px);
    margin: 0 -12px;
    padding: 0 12px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .daysOff-chips::-webkit-scrollbar { display: none; }

  .daysOff-savebar {
    left: 12px;
    right: 12px;
    transform: none;
    width: auto;
    max-width: none;
    justify-content: space-between;
    padding: 10px;
    animation: none;
  }
  .daysOff-savebar-text { flex: 1; margin: 0 0 0 6px; font-size: 0.8rem; white-space: normal; }

  .daysOff-toast { top: 12px; right: 12px; left: 12px; max-width: none; }

  .daysOff-modal-overlay { align-items: flex-end; padding: 0; }
  .daysOff-modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .daysOff-modal-footer { flex-direction: column-reverse; }
  .daysOff-modal-footer button { width: 100%; margin: 0; }
}

@media (max-width: 380px) {
  .daysOff-mday-date { font-size: 0.92rem; }
  .daysOff-card { padding: 12px 10px; }
  .daysOff-card-days { gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .daysOff-container *,
  .daysOff-modal,
  .daysOff-savebar { animation: none !important; transition: none !important; }
}

/* ── Print ── */
@media print {
  .daysOff-container { background: #fff; padding: 0; }
  .daysOff-toolbar .daysOff-search,
  .daysOff-chips,
  .daysOff-pills,
  .daysOff-savebar,
  .daysOff-toast,
  .daysOff-edited-dot { display: none !important; }
  .daysOff-table-wrap { max-height: none; overflow: visible; border: 1px solid var(--do-line-strong); }
  .daysOff-thead { position: static; }
  .daysOff-staff, .daysOff-th-staff { position: static; }
  .daysOff-row { break-inside: avoid; }
}
/* ── Marking Modes Toggle ── */
.daysOff-marking-modes {
  display: flex;
  gap: 4px;
  background: var(--do-surface);
  border: 1px solid var(--do-line);
  border-radius: 10px;
  padding: 4px;
  flex-shrink: 0;
}
.daysOff-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--do-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.daysOff-mode-btn:hover { background: var(--do-hover); color: var(--do-ink); }
.daysOff-mode-btn.is-active.is-off { background: var(--do-off-bg); color: var(--do-off-ink); box-shadow: inset 0 0 0 1px var(--do-off-line); }
.daysOff-mode-btn.is-active.is-ot { background: var(--do-ot-bg); color: var(--do-ot-ink); box-shadow: inset 0 0 0 1px var(--do-ot-line); }
.daysOff-mode-btn.is-active.is-clear { background: #f3f4f6; color: var(--do-ink); box-shadow: inset 0 0 0 1px var(--do-line-strong); }

/* ── Overtime Cell States ── */
.daysOff-day.is-ot {
  background: var(--do-ot-bg);
  border-color: var(--do-ot-line);
  color: var(--do-ot-ink);
  font-weight: 800;
}
.daysOff-day.is-ot:hover { background: #f3d08f; }

.daysOff-mday.is-ot { background: var(--do-ot-bg); border-color: var(--do-ot-line); }
.daysOff-mday.is-ot .daysOff-mday-name,
.daysOff-mday.is-ot .daysOff-mday-date,
.daysOff-mday.is-ot .daysOff-mday-state { color: var(--do-ot-ink); font-weight: 800; }

/* ── Summary OT Count Badge ── */
.daysOff-ot-count {
  display: inline-block;
  padding: 1px 8px;
  background: var(--do-ot-bg);
  color: var(--do-ot-ink);
  border: 1px solid var(--do-ot-line);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  margin-left: 4px;
}

/* ── Legend Swatch for OT ── */
.daysOff-legend-swatch.is-ot { 
  background: var(--do-ot-bg); 
  border-color: var(--do-ot-line); 
}/* ==========================================================================
   Carers Staff Management — design tokens
   (kept identical to your existing tokens so other components keep working)
   ========================================================================== */
:root {
  --primary-purple: #a021c4;
  --primary-purple-dark: #7e17a0;
  --secondary-purple: #6b21a8;
  --accent-green: #16a34a;
  --accent-green-dark: #15803d;
  --accent-amber: #d97706;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-page: #f1f5f9;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #16a34a;
  --success-bg: #f0fdf4;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.14);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Layout shell
   Desktop: fixed-height page, the table scrolls inside the panel.
   Mobile / tablet: normal page scroll (see responsive section).
   ========================================================================== */
.csm-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 20px 12px;
  height: calc(100vh - 80px);
  min-width: 0;
  background-color: var(--surface-page);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.csm-page *,
.csm-page *::before,
.csm-page *::after { box-sizing: border-box; }

.csm-page button { font: inherit; cursor: pointer; }

/* ==========================================================================
   Stats cards (horizontal strip, scrolls when it doesn't fit)
   ========================================================================== */
.csm-stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 10px;
  flex-shrink: 0;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.csm-stats::-webkit-scrollbar { height: 6px; }
.csm-stats::-webkit-scrollbar-track { background: transparent; }
.csm-stats::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill); }
.csm-stats::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.csm-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}

.csm-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.csm-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  color: #fff;
}

.csm-tone-blue    { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.csm-tone-green   { background: linear-gradient(135deg, #10b981, #059669); }
.csm-tone-amber   { background: linear-gradient(135deg, #f59e0b, #d97706); }
.csm-tone-cyan    { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.csm-tone-emerald { background: linear-gradient(135deg, #16a34a, #15803d); }
.csm-tone-pink    { background: linear-gradient(135deg, #ec4899, #db2777); }
.csm-tone-violet  { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.csm-tone-red     { background: linear-gradient(135deg, #ef4444, #dc2626); }
.csm-tone-slate   { background: linear-gradient(135deg, #6b7280, #4b5563); }
.csm-tone-teal    { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.csm-tone-gray    { background: linear-gradient(135deg, #64748b, #475569); }

.csm-stat-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }

.csm-stat-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.csm-stat-value {
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Content panel + toolbar
   ========================================================================== */
.csm-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  margin-bottom: 10px;
  padding: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.csm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.csm-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.csm-entries {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.csm-entries select {
  padding: 7px 28px 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 6px center;
  background-repeat: no-repeat;
  background-size: 14px;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.csm-entries select:focus {
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(160, 33, 196, 0.10);
}

.csm-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Buttons ---------- */
.csm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.csm-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.csm-btn--primary { background: #2563eb; color: #fff; }
.csm-btn--primary:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.csm-btn--success { background: var(--accent-green); color: #fff; }
.csm-btn--success:hover:not(:disabled) {
  background: var(--accent-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.3);
}

.csm-btn--outline,
.csm-btn--ghost {
  background: var(--surface-subtle);
  color: var(--text-secondary);
  border-color: var(--border-strong);
  box-shadow: none;
}

.csm-btn--outline:hover:not(:disabled),
.csm-btn--ghost:hover:not(:disabled) { background: var(--border); transform: translateY(-1px); }

.csm-btn--outline.is-active {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: #fff;
}

.csm-btn--brand {
  background: linear-gradient(135deg, var(--primary-purple), var(--secondary-purple));
  color: #fff;
}

.csm-btn--brand:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--secondary-purple), var(--primary-purple));
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(160, 33, 196, 0.35);
}

.csm-btn--icon { padding: 9px 13px; }

/* ---------- Search ---------- */
.csm-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  max-width: 460px;
  min-width: 0;
}

.csm-search input {
  width: 100%;
  padding: 10px 42px 10px 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  color: var(--text-primary);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s var(--ease);
}

.csm-search input::placeholder { color: var(--text-muted); font-size: 13px; }

.csm-search input:focus {
  background: var(--surface);
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 4px rgba(160, 33, 196, 0.10);
}

.csm-search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s var(--ease);
}

.csm-search:focus-within .csm-search-icon { color: var(--primary-purple); }

.csm-search-clear {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-secondary);
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.1s var(--ease);
}

.csm-search-clear:hover { background: var(--border-strong); color: var(--text-primary); transform: scale(1.06); }

/* ==========================================================================
   Table (desktop / tablet)
   ========================================================================== */
.csm-table-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.csm-table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.csm-table-wrap::-webkit-scrollbar-track { background: var(--surface-subtle); border-radius: 4px; }
.csm-table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.csm-table-wrap::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* thin "refreshing" bar that stays pinned while the table scrolls */
.csm-progress {
  position: sticky;
  top: 0;
  z-index: 6;
  height: 3px;
  margin-bottom: -3px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.csm-progress.is-on { opacity: 1; }

.csm-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--primary-purple), transparent);
  animation: csm-slide 1s ease-in-out infinite;
}

.csm-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  table-layout: auto;
}

.csm-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #fff;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.csm-table thead th:not(.is-sortable) { padding: 15px 14px; }

.csm-th-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 15px 14px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: left;
  transition: background-color 0.15s var(--ease);
}

.csm-th-btn:hover { background: rgba(255, 255, 255, 0.08); }

.csm-table tbody td {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
}

.csm-table tbody tr { transition: background-color 0.15s var(--ease); }
.csm-table tbody tr:hover { background: var(--surface-subtle); }
.csm-table tbody tr:last-child td { border-bottom: none; }

.csm-table tbody.is-stale,
.csm-cards.is-stale { opacity: 0.6; transition: opacity 0.15s; }

/* column sizing */
.csm-col-photo    { width: 66px; min-width: 66px; text-align: center; }
.csm-table td.csm-col-photo { padding: 12px 8px; }
.csm-col-empno    { width: 120px; min-width: 110px; }
.csm-col-name     { min-width: 220px; white-space: normal !important; word-break: break-word; }
.csm-col-postcode { width: 110px; min-width: 90px; }
.csm-col-tel      { width: 140px; min-width: 130px; }
.csm-col-email    { min-width: 190px; max-width: 270px; overflow: hidden; text-overflow: ellipsis; }
.csm-col-category { width: 150px; min-width: 120px; }
.csm-col-action   { width: 120px; min-width: 110px; text-align: right; }
.csm-table thead th.csm-col-action { text-align: right; }

.csm-photo-center { display: flex; justify-content: center; }

.csm-empno {
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.csm-name { display: inline-block; font-weight: 600; line-height: 1.5; color: var(--text-primary); }
.csm-muted { color: var(--text-muted); }

.csm-link { color: #2563eb; font-weight: 500; text-decoration: none; transition: color 0.15s var(--ease); }
.csm-link:hover { color: #1d4ed8; text-decoration: underline; }

.csm-email {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.csm-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: #f3e8ff;
  color: var(--secondary-purple);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Avatars ---------- */
.csm-avatar-container { position: relative; display: inline-flex; justify-content: center; align-items: center; }
.csm-avatar-wrap { position: relative; }

.csm-avatar { display: block; border-radius: 50%; border: 2px solid var(--border); }

.csm-avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  user-select: none;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.csm-avatar--initials:hover { transform: scale(1.06); box-shadow: var(--shadow-sm); }
.csm-avatar--img { object-fit: cover; transition: opacity 0.2s var(--ease); }
.csm-avatar-wrap .csm-skeleton { position: absolute; inset: 0; }

.csm-carer-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #06b6d4;
  color: #fff;
  box-shadow: var(--shadow-xs);
}

/* ==========================================================================
   Row options menu (rendered in a portal on <body>, so it uses :root tokens)
   ========================================================================== */
.csm-options-btn { padding: 6px 11px; font-size: 12px; box-shadow: none; }
.csm-options-btn svg { flex: none; }
.csm-options-dots { display: none; }

.csm-menu {
  position: fixed;
  z-index: 10000;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  animation: csm-pop 0.16s var(--ease);
}

.csm-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s var(--ease);
}

.csm-menu-item:hover:not(:disabled) { background: var(--surface-subtle); }
.csm-menu-item:disabled { opacity: 0.5; cursor: not-allowed; }

.csm-menu-item--danger { color: var(--danger); }
.csm-menu-item--danger:hover:not(:disabled) { background: var(--danger-bg); color: #b91c1c; }
.csm-menu-item--success { color: var(--success); }
.csm-menu-item--success:hover:not(:disabled) { background: var(--success-bg); color: #047857; }
.csm-menu-item--brand { color: var(--primary-purple-dark); }
.csm-menu-item--brand:hover:not(:disabled) { background: #faf5ff; }

.csm-menu-divider { height: 1px; margin: 6px 0; background: var(--border); }

.csm-menu button:focus-visible { outline: 2px solid var(--primary-purple); outline-offset: -2px; }

/* ==========================================================================
   Empty / error states
   ========================================================================== */
.csm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.csm-empty svg { color: var(--text-muted); }
.csm-empty p { margin: 0; }

.csm-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  background: var(--danger-bg);
  color: #991b1b;
  font-size: 13.5px;
}

.csm-error span { flex: 1 1 200px; }

/* ==========================================================================
   Skeleton loaders
   ========================================================================== */
.csm-skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #eef1f6 25%, #f8fafc 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: csm-shimmer 1.3s ease infinite;
}

.csm-avatar.csm-skeleton { border-radius: 50%; }
.csm-skeleton--row { width: 100%; height: 40px; }
.csm-skeleton--stat { width: 44px; height: 21px; }
.csm-skeleton--card { height: 132px; border-radius: var(--radius-md); }

/* ==========================================================================
   Mobile cards (hidden on desktop, shown <= 900px)
   ========================================================================== */
.csm-cards { display: none; }

.csm-card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.csm-card-head { display: flex; align-items: center; gap: 12px; }
.csm-card-title { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }

.csm-card-title h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.csm-card-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.csm-card-line { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.csm-card-line svg { flex: none; color: var(--text-muted); }
.csm-card-line .csm-email { max-width: 220px; }

/* ==========================================================================
   Pagination
   ========================================================================== */
.csm-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.csm-pagination-info { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

.csm-archived-tag {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: #fef3c7;
  color: var(--accent-amber);
  font-size: 12px;
  font-weight: 600;
}

.csm-pagination-nav { display: flex; align-items: center; gap: 6px; }
.csm-page-numbers { display: flex; align-items: center; gap: 6px; }
.csm-page-summary { display: none; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.csm-page-ellipsis { padding: 0 4px; color: var(--text-muted); }

.csm-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s var(--ease);
}

.csm-page-btn:hover:not(:disabled):not(.is-active) { background: var(--surface-subtle); color: var(--text-primary); }
.csm-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.csm-page-btn.is-active { background: var(--primary-purple); border-color: var(--primary-purple); color: #fff; font-weight: 600; }

@media (min-width: 640px) {
  .csm-pagination { flex-direction: row; }
}

/* ==========================================================================
   Focus, motion, shared utilities (other components may rely on these)
   ========================================================================== */
.csm-page button:focus-visible,
.csm-page a:focus-visible,
.csm-page select:focus-visible,
.csm-page input:focus-visible {
  outline: 2px solid var(--primary-purple);
  outline-offset: 2px;
}

.csm-spin,
.spinning { animation: csm-spin 1s linear infinite; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.modal-open { overflow: hidden; }

@keyframes csm-spin { to { transform: rotate(360deg); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes csm-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes csm-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
@keyframes csm-pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .csm-spin, .spinning, .csm-skeleton, .csm-progress::after, .csm-menu { animation: none !important; }
  .csm-stat, .csm-btn, .csm-page-btn { transition: none !important; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .csm-search { flex-basis: 100%; max-width: none; order: 2; }
  .csm-col-email { max-width: 220px; }
}

@media (max-width: 1024px) {
  .csm-stat { padding: 10px 12px; }
  .csm-stat-icon { width: 34px; height: 34px; }
  .csm-stat-value { font-size: 18px; }
}

/* Tablet & phone: page scrolls normally, table turns into cards */
@media (max-width: 900px) {
  .csm-page { height: auto; padding: 14px 14px 20px; gap: 12px; }
  .csm-panel { flex: none; overflow: visible; padding: 14px; margin-bottom: 0; }

  .csm-table-wrap { display: none; }
  .csm-cards { display: flex; flex-direction: column; gap: 10px; }

  /* "Options" becomes a compact kebab button */
  .csm-options-label,
  .csm-options-chevron { display: none; }
  .csm-options-dots { display: block; }
  .csm-options-btn { width: 36px; height: 36px; padding: 0; }
}

@media (max-width: 768px) {
  .csm-stat { padding: 9px 10px; }
  .csm-stat-label { font-size: 9px; }
  .csm-stat-value { font-size: 16px; }
  .csm-btn { padding: 8px 12px; font-size: 12px; }
  .csm-search input { padding: 9px 36px; font-size: 13px; }
}

@media (max-width: 640px) {
  .csm-stats { grid-auto-columns: 148px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .csm-stat { scroll-snap-align: start; }

  .csm-toolbar-left { width: 100%; }
  .csm-entries { width: 100%; justify-content: space-between; }

  .csm-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .csm-actions .csm-btn { width: 100%; }
  .csm-actions .csm-btn--primary { grid-column: 1 / -1; }

  .csm-search { max-width: 100%; width: 100%; }

  /* Previous · Page x of y · Next */
  .csm-pagination { align-items: stretch; text-align: center; }
  .csm-pagination-nav { justify-content: space-between; }
  .csm-page-numbers { display: none; }
  .csm-page-summary { display: block; }
}/* ==========================================================================
   Add Staff dialog
   All tokens are scoped to .asd-overlay (the dialog is portalled to <body>),
   so nothing here leaks into or overrides the rest of the app.
   ========================================================================== */

.asd-overlay {
  --asd-brand: #d326c7;
  --asd-brand-dark: #973390;
  --asd-brand-soft: #fdf2fc;
  --asd-green: #16a34a;
  --asd-green-dark: #15803d;
  --asd-focus: #a021c4;
  --asd-ink: #0f172a;
  --asd-ink-2: #475569;
  --asd-muted: #94a3b8;
  --asd-line: #e2e8f0;
  --asd-line-strong: #cbd5e1;
  --asd-surface: #ffffff;
  --asd-subtle: #f8fafc;
  --asd-danger: #dc2626;
  --asd-danger-bg: #fef2f2;
  --asd-radius: 10px;

  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  animation: asd-fade 0.18s ease-out;
}

.asd-overlay *,
.asd-overlay *::before,
.asd-overlay *::after { box-sizing: border-box; }

/* ---------- Dialog shell ---------- */
.asd-dialog {
  display: flex;
  flex-direction: column;
  width: min(100%, 880px);
  max-height: min(92vh, 900px);
  overflow: hidden;
  background: var(--asd-surface);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  animation: asd-rise 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Header ---------- */
.asd-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--asd-brand) 0%, var(--asd-brand-dark) 100%);
  border-bottom: 3px solid var(--asd-green);
  color: #fff;
}

.asd-header-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
}

.asd-header-text { flex: 1; min-width: 0; }

.asd-header-text h2 {
  margin: 0;
  font-size: clamp(17px, 3.6vw, 21px);
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

.asd-header-text p {
  margin: 2px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.asd-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s;
}

.asd-close:hover:not(:disabled) { background: rgba(255, 255, 255, 0.28); }
.asd-close:active:not(:disabled) { transform: scale(0.94); }
.asd-close:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Form layout ---------- */
.asd-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.asd-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 1;
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--asd-line-strong) transparent;
}

.asd-body::-webkit-scrollbar { width: 8px; }
.asd-body::-webkit-scrollbar-thumb { background: var(--asd-line-strong); border-radius: 8px; }

.asd-section {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.asd-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--asd-line);
  font-size: 14px;
  font-weight: 700;
  color: var(--asd-brand-dark);
}

.asd-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px 16px;
}

/* mobile first: every field full width */
.asd-field { grid-column: 1 / -1; display: flex; flex-direction: column; min-width: 0; }
.asd-strength { grid-column: 1 / -1; }

@media (min-width: 720px) {
  .asd-span-2 { grid-column: span 2; }
  .asd-span-3 { grid-column: span 3; }
  .asd-span-6 { grid-column: 1 / -1; }
}

/* ---------- Labels, inputs ---------- */
.asd-label {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--asd-ink);
}

.asd-req { color: var(--asd-danger); }
.asd-optional { font-weight: 400; color: var(--asd-muted); }

.asd-control { position: relative; display: flex; align-items: center; }

.asd-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--asd-line-strong);
  border-radius: var(--asd-radius);
  background: var(--asd-surface);
  color: var(--asd-ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.asd-input::placeholder { color: var(--asd-muted); }
.asd-input:hover:not(:disabled):not(:focus) { border-color: var(--asd-muted); }

.asd-input:focus {
  border-color: var(--asd-focus);
  box-shadow: 0 0 0 4px rgba(160, 33, 196, 0.12);
}

.asd-input:disabled { background: var(--asd-subtle); color: var(--asd-ink-2); cursor: not-allowed; }

.asd-control.has-icon .asd-input { padding-left: 38px; }
.asd-upper { text-transform: uppercase; }
.asd-upper::placeholder { text-transform: none; }

.asd-icon {
  position: absolute;
  left: 13px;
  color: var(--asd-muted);
  pointer-events: none;
  transition: color 0.15s;
}

.asd-control:focus-within .asd-icon { color: var(--asd-focus); }

/* select */
.asd-select { appearance: none; padding-right: 36px; cursor: pointer; }
.asd-select:invalid,
.asd-select option[value=""] { color: var(--asd-muted); }

.asd-chevron {
  position: absolute;
  right: 12px;
  color: var(--asd-ink-2);
  pointer-events: none;
}

/* textarea */
.asd-textarea {
  height: auto;
  min-height: 96px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

/* password toggle */
.asd-has-toggle { padding-right: 46px; }

.asd-toggle {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--asd-ink-2);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.asd-toggle:hover { background: var(--asd-brand-soft); color: var(--asd-brand-dark); }

/* ---------- Validation ---------- */
.asd-control.has-error .asd-input {
  border-color: var(--asd-danger);
  background: var(--asd-danger-bg);
}

.asd-control.has-error .asd-input:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14); }
.asd-control.has-error .asd-icon { color: var(--asd-danger); }

.asd-error {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--asd-danger);
}

.asd-error svg { flex: none; }
.asd-hint { margin: 6px 0 0; font-size: 12px; color: var(--asd-muted); }

/* ---------- Password strength ---------- */
.asd-strength { display: flex; align-items: center; gap: 12px; margin-top: -4px; }

.asd-strength-bars { display: flex; gap: 4px; flex: 0 0 140px; }

.asd-strength-bars span {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--asd-line);
  transition: background-color 0.2s;
}

.asd-strength-bars[data-score="1"] span.on { background: #ef4444; }
.asd-strength-bars[data-score="2"] span.on { background: #f59e0b; }
.asd-strength-bars[data-score="3"] span.on { background: #84cc16; }
.asd-strength-bars[data-score="4"] span.on { background: #16a34a; }

.asd-strength-label { font-size: 12px; color: var(--asd-ink-2); }

/* ---------- Footer ---------- */
.asd-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--asd-line);
  background: var(--asd-subtle);
}

.asd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--asd-radius);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s, transform 0.1s, border-color 0.15s;
}

.asd-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.asd-btn:active:not(:disabled) { transform: translateY(1px); }

.asd-btn--ghost { background: var(--asd-surface); border-color: var(--asd-line-strong); color: var(--asd-ink-2); }
.asd-btn--ghost:hover:not(:disabled) { background: var(--asd-line); }

.asd-btn--primary {
  min-width: 190px;
  background: linear-gradient(135deg, var(--asd-green) 0%, var(--asd-green-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.asd-btn--primary:hover:not(:disabled) { box-shadow: 0 8px 18px rgba(22, 163, 74, 0.38); }

/* ---------- Focus visibility ---------- */
.asd-btn:focus-visible,
.asd-close:focus-visible,
.asd-toggle:focus-visible {
  outline: 2px solid var(--asd-focus);
  outline-offset: 2px;
}

.asd-close:focus-visible { outline-color: #fff; }

/* ---------- Animation ---------- */
.asd-spin { animation: asd-spin 0.9s linear infinite; }

@keyframes asd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes asd-rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes asd-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .asd-overlay, .asd-dialog, .asd-spin { animation: none !important; }
  .asd-input, .asd-btn, .asd-close, .asd-toggle { transition: none !important; }
}

/* ==========================================================================
   Phones: the dialog becomes a full-screen sheet with a sticky footer
   ========================================================================== */
@media (max-width: 640px) {
  .asd-overlay { padding: 0; align-items: stretch; }

  .asd-dialog {
    width: 100%;
    max-height: none;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
  }

  .asd-header { padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
  .asd-body { padding: 16px; gap: 20px; }

  /* 16px stops iOS Safari zooming into focused fields */
  .asd-input { font-size: 16px; height: 46px; }
  .asd-textarea { height: auto; }

  .asd-footer {
    flex-direction: column-reverse;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .asd-btn { width: 100%; height: 48px; }
  .asd-btn--primary { min-width: 0; }
  .asd-strength-bars { flex-basis: 100px; }
}/* ==========================================================================
   Staff Profile Modal — Design System
   A calm, professional "clinical trust" palette suited to care-management
   software: deep slate ink, teal accent, warm neutral surfaces.
   ========================================================================== */

.staff-profile-modal {
  --ink-900: #0f172a;
  --ink-700: #1e293b;
  --muted-500: #64748b;
  --muted-400: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-muted: #f1f5f9;

  --primary: #0e7490;
  --primary-dark: #155e75;
  --primary-light: #ecfeff;
  --primary-ring: rgba(14, 116, 144, 0.16);

  --success: #059669;
  --success-light: #ecfdf5;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --amber: #d97706;
  --amber-light: #fffbeb;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.28);

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
}

/* -------------------------------------------------------------------------
   Overlay / shell
   ------------------------------------------------------------------------- */

.staff-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: staffFadeIn 0.18s ease-out;
}

.staff-profile-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1400px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: staffSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes staffSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* -------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */

.staff-modal-header {
  background: linear-gradient(120deg, var(--ink-900) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}

.staff-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.staff-header-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 2px;
}

.staff-back-button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: white;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.staff-back-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.staff-back-button:active {
  transform: scale(0.97);
}

.staff-toolbar-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: white;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.staff-toolbar-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.staff-toolbar-button:not(:disabled):hover {
  filter: brightness(1.08);
}

.staff-toolbar-button:not(:disabled):active {
  transform: scale(0.97);
}

.staff-toolbar-button-export {
  background: var(--success);
}

.staff-toolbar-button-report {
  background: #2563eb;
}

.staff-header-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.92);
}

.staff-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.staff-employee-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
}

.staff-close-button {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: white;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  transition: background-color 0.15s ease;
}

.staff-close-button:hover {
  background: rgba(220, 38, 38, 0.75);
}

/* Header profile picture */

.staff-profile-picture-header {
  position: relative;
  display: flex;
  align-items: center;
}

.staff-header-profile-picture {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.staff-edit-picture-button {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--primary);
  border: 2px solid var(--ink-900);
  color: white;
  padding: 3px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  transition: transform 0.15s ease;
}

.staff-edit-picture-button:hover {
  transform: scale(1.12);
}

/* -------------------------------------------------------------------------
   Body / layout
   ------------------------------------------------------------------------- */

.staff-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  background: var(--surface-subtle);
}

.staff-sidebar {
  width: 264px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  overflow-y: auto;
}

.staff-tab-navigation {
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.staff-tab-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  color: var(--muted-500);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.staff-tab-button:hover {
  background: var(--surface-muted);
  color: var(--ink-700);
}

.staff-tab-button.staff-active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.staff-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 32px;
  position: relative;
}

.staff-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(1px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  z-index: 5;
}

.staff-inline-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-500);
  font-size: 13px;
  margin-bottom: 16px;
}

.staff-form-section {
  max-width: 1020px;
}

.staff-form-section h3 {
  color: var(--ink-900);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 18px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

/* -------------------------------------------------------------------------
   Error banner
   ------------------------------------------------------------------------- */

.staff-error-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--danger-light);
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 20px;
}

.staff-error-banner svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--danger);
}

.staff-error-banner strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.staff-error-banner ul {
  margin: 0;
  padding-left: 18px;
}

.staff-error-banner li {
  margin-bottom: 2px;
}

.staff-required {
  color: var(--danger);
  font-weight: 700;
}

.staff-field-hint {
  font-size: 11px;
  color: var(--muted-500);
  font-weight: 400;
  margin-left: 8px;
}

/* -------------------------------------------------------------------------
   Form controls
   ------------------------------------------------------------------------- */

.staff-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
  margin-bottom: 20px;
}

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

.staff-form-group.staff-full-width,
.staff-full-width {
  grid-column: 1 / -1;
}

.staff-form-group label {
  font-weight: 600;
  color: var(--ink-700);
  font-size: 13px;
}

.staff-form-input,
.staff-form-textarea {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink-900);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.staff-form-textarea {
  resize: vertical;
}

.staff-form-input:hover,
.staff-form-textarea:hover {
  border-color: var(--border-strong);
}

.staff-form-input:focus,
.staff-form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.staff-form-input:disabled,
.staff-form-textarea:disabled {
  background-color: var(--surface-muted);
  color: var(--muted-400);
  cursor: not-allowed;
}

.staff-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-700);
}

.staff-checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.staff-driver-license-toggle {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-weight: 500;
}

.staff-driver-license-toggle svg {
  color: var(--primary);
}

.staff-radio-group {
  display: flex;
  gap: 18px;
}

.staff-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-700);
}

.staff-radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* -------------------------------------------------------------------------
   Profile picture uploader
   ------------------------------------------------------------------------- */

.staff-profile-picture-section {
  margin-bottom: 32px;
  padding: 22px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
}

.staff-profile-picture-section label {
  font-weight: 700;
  color: var(--ink-900);
  font-size: 15px;
  margin-bottom: 16px;
  display: block;
}

.staff-profile-picture-upload {
  display: flex;
  align-items: center;
  gap: 24px;
}

.staff-profile-picture-preview {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.staff-profile-picture-large {
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease;
}

.staff-avatar-uploading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.staff-profile-picture-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.staff-upload-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
  width: fit-content;
}

.staff-upload-button:hover:not(:disabled) {
  filter: brightness(1.08);
}

.staff-upload-button:active:not(:disabled) {
  transform: scale(0.98);
}

.staff-upload-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.staff-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.staff-upload-note {
  font-size: 12px;
  color: var(--muted-500);
  margin: 0;
}

/* -------------------------------------------------------------------------
   Availability
   ------------------------------------------------------------------------- */

.staff-availability-stats {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.staff-stat-card {
  text-align: center;
  padding: 12px 8px;
  background: var(--surface-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.staff-stat-number {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.staff-stat-blue { color: var(--primary); }
.staff-stat-green { color: var(--success); }
.staff-stat-amber { color: var(--amber); }

.staff-stat-pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-500);
  padding: 3px 0;
}

.staff-stat-pill-active {
  color: var(--success);
}

.staff-stat-label {
  font-size: 11.5px;
  color: var(--muted-500);
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.staff-availability-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.staff-availability-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  align-items: center;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.staff-availability-row.staff-day-active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.staff-day-checkbox .staff-checkbox-label {
  font-weight: 600;
  color: var(--ink-900);
}

.staff-time-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.staff-time-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.staff-time-group label {
  font-size: 11.5px;
  color: var(--muted-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.staff-time-input {
  padding: 8px 10px;
  font-size: 13px;
}

/* -------------------------------------------------------------------------
   Actions / save
   ------------------------------------------------------------------------- */

.staff-form-actions {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.staff-save-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--success);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  min-width: 160px;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.staff-save-button:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.32);
}

.staff-save-button:active:not(:disabled) {
  transform: scale(0.98);
}

.staff-save-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

/* -------------------------------------------------------------------------
   Export / Report picker modals
   ------------------------------------------------------------------------- */

.export-options-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 20px;
  animation: staffFadeIn 0.15s ease-out;
}

.export-options-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  animation: staffSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.export-options-content h3 {
  color: var(--ink-900);
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 6px 0;
}

.export-options-content p {
  color: var(--muted-500);
  margin-bottom: 20px;
  font-size: 13.5px;
}

.export-options-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.export-option-button {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--surface-subtle);
  border: 1.5px solid var(--border);
  color: var(--ink-700);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.export-option-button svg {
  flex-shrink: 0;
  color: var(--primary);
}

.export-option-button span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.export-option-button strong {
  font-weight: 600;
  color: var(--ink-900);
}

.export-option-button small {
  color: var(--muted-500);
  font-size: 12px;
}

.export-option-button:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.export-option-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.export-option-cancel {
  background: none;
  border: none;
  color: var(--muted-500);
  padding: 11px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
  text-align: center;
  margin-top: 4px;
}

.export-option-cancel:hover {
  background: var(--surface-muted);
  color: var(--ink-700);
}

/* -------------------------------------------------------------------------
   Avatars
   ------------------------------------------------------------------------- */

.initials-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  user-select: none;
  flex-shrink: 0;
}

.staff-avatar-frame {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.staff-avatar-loading {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-muted);
  border-radius: 50%;
  border: 2px solid var(--border);
  z-index: 1;
  color: var(--muted-500);
}

.staff-avatar-frame img {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  transition: opacity 0.25s ease;
  display: block;
}

.spinning {
  animation: staffSpin 1s linear infinite;
}

@keyframes staffSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .staff-modal-body {
    flex-direction: column;
  }

  .staff-sidebar {
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .staff-tab-navigation {
    flex-direction: row;
    overflow-x: auto;
    padding: 10px 14px;
  }

  .staff-tab-button {
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .staff-modal-overlay {
    padding: 0;
  }

  .staff-profile-modal {
    height: 100vh;
    border-radius: 0;
    max-width: 100%;
  }

  .staff-content-area {
    padding: 20px 16px 24px;
  }

  .staff-form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .staff-availability-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .staff-time-inputs {
    grid-template-columns: 1fr;
  }

  .staff-header-title,
  .staff-employee-info span {
    display: none;
  }

  .staff-profile-picture-upload {
    flex-direction: column;
    text-align: center;
  }

  .export-options-content {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .staff-toolbar-button span {
    display: none;
  }
}

/* -------------------------------------------------------------------------
   Accessibility
   ------------------------------------------------------------------------- */

.staff-profile-modal button:focus-visible,
.staff-profile-modal input:focus-visible,
.staff-profile-modal select:focus-visible,
.staff-profile-modal textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .staff-profile-modal,
  .staff-modal-overlay,
  .export-options-modal,
  .export-options-content,
  .spinning {
    animation: none !important;
    transition: none !important;
  }
}/* ==========================================================================
   Resignation Modal - Scoped Styles (resig- prefix)
   ========================================================================== */

/* Overlay */
.resig-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: resigFadeIn 0.2s ease-out;
}

@keyframes resigFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal Shell */
.resig-modal {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: min(95vw, 700px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: resigSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes resigSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.resig-header {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px solid #2563eb;
}

.resig-header-title-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.resig-header-icon {
  color: #60a5fa;
  margin-top: 2px;
  flex-shrink: 0;
}

.resig-modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: #ffffff;
}

.resig-modal-subtitle {
  font-size: 13px;
  margin: 0;
  color: #cbd5e1;
}

.resig-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.resig-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: rgba(239, 68, 68, 1);
}

/* Body */
.resig-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

/* Info Cards */
.resig-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.resig-info-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.resig-info-icon {
  color: #64748b;
  flex-shrink: 0;
}

.resig-info-card div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.resig-info-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.resig-info-value {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Form Grid */
.resig-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.resig-full-width {
  grid-column: 1 / -1;
}

.resig-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.resig-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.resig-required {
  color: #dc2626;
  font-weight: 700;
}

/* Inputs */
.resig-input,
.resig-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
  color: #0f172a;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.resig-textarea {
  resize: vertical;
  min-height: 80px;
}

.resig-input:focus,
.resig-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.resig-input:hover,
.resig-textarea:hover {
  border-color: #94a3b8;
}

.resig-input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.resig-input-icon {
  position: absolute;
  left: 12px;
  color: #64748b;
  pointer-events: none;
}

.resig-input-with-icon .resig-input {
  padding-left: 36px;
}

/* Error States */
.resig-error {
  border-color: #dc2626 !important;
  background-color: #fef2f2;
}

.resig-error-msg {
  color: #dc2626;
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}

/* File Upload */
.resig-file-upload {
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.resig-file-upload:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

.resig-file-upload.resig-error {
  border-color: #dc2626;
  background: #fef2f2;
}

.resig-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.resig-file-upload-ui {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  pointer-events: none;
}

.resig-upload-icon {
  color: #64748b;
  flex-shrink: 0;
}

.resig-file-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.resig-file-name {
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
}

.resig-file-hint {
  font-size: 12px;
  color: #64748b;
}

/* Checkbox */
.resig-checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.resig-checkbox-wrapper:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.resig-checkbox-wrapper.resig-error-text {
  border-color: #dc2626;
  background: #fef2f2;
}

.resig-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
}

.resig-checkbox-label {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
}

.resig-timestamp {
  display: block;
  font-size: 11px;
  color: #059669;
  font-weight: 600;
  margin-top: 4px;
}

/* Footer */
.resig-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
}

.resig-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.resig-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.resig-btn-secondary {
  background: #ffffff;
  color: #475569;
  border: 1.5px solid #cbd5e1;
}

.resig-btn-secondary:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.resig-btn-primary {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.resig-btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.resig-spinner {
  animation: resigSpin 1s linear infinite;
}

@keyframes resigSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 640px) {
  .resig-form-grid {
    grid-template-columns: 1fr;
  }
  .resig-modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .resig-overlay {
    padding: 0;
  }
}/* ==========================================================================
   Offboarding Dashboard - Scoped Styles (offboard- prefix)
   ========================================================================== */

.offboard-container {
  padding: 24px;
  background-color: #f8fafc;
  /* FIX: This used to be "min-height: 100%" with no overflow rule, which
     relied on the PARENT page being scrollable. If the parent layout has a
     fixed height (common in dashboards with a sidebar), nothing could
     scroll and the table just got cut off at the bottom.
     Giving the dashboard its own bounded height + scrollbar makes it work
     no matter what the surrounding layout does. */
  height: 100%;
  max-height: 100vh;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  box-sizing: border-box;
}

.offboard-header {
  margin-bottom: 24px;
}

.offboard-header-top {
  display: flex;
  margin-bottom: 12px;
}

.offboard-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.offboard-back-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.offboard-back-btn:active {
  background: #e5e7eb;
}

.offboard-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px 0;
}

.offboard-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

.offboard-loading, .offboard-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #64748b;
  background: #ffffff;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
}

.offboard-empty svg {
  color: #cbd5e1;
  margin-bottom: 16px;
}

/* Table */
.offboard-table-wrapper {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow-x: auto; /* Horizontal scroll for small screens */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.offboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 900px;
}

.offboard-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.offboard-table td {
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.offboard-table tbody tr:hover {
  background-color: #f8fafc;
}

.offboard-emp-info {
  display: flex;
  flex-direction: column;
}

.offboard-emp-name {
  font-weight: 600;
  color: #0f172a;
}

.offboard-emp-no {
  font-size: 12px;
  color: #64748b;
  font-family: monospace;
}

/* Badges */
.offboard-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.offboard-badge-pending { background: #fef3c7; color: #92400e; }
.offboard-badge-warning { background: #dbeafe; color: #1e40af; }
.offboard-badge-success { background: #dcfce7; color: #166534; }

/* Progress Bar */
.offboard-progress-bar {
  position: relative;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  width: 100px;
}

.offboard-progress-fill {
  height: 100%;
  background: #10b981;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.offboard-progress-text {
  position: absolute;
  top: -20px;
  right: 0;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

/* Buttons */
.offboard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  white-space: nowrap;
}

.offboard-btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.offboard-btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.offboard-btn-secondary {
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.offboard-btn-secondary:hover:not(:disabled) {
  background: #f1f5f9;
}

.offboard-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Modal Overlay & Scrolling */
.offboard-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: offboardFadeIn 0.2s ease-out;
}

@keyframes offboardFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.offboard-modal {
  background: #ffffff;
  border-radius: 16px;
  width: min(95vw, 900px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: offboardSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden; /* Prevents modal from overflowing viewport */
}

@keyframes offboardSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.offboard-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: #f8fafc;
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
}

.offboard-modal-header h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.offboard-modal-sub {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.offboard-modal-close {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.offboard-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.offboard-modal-body {
  padding: 24px;
  overflow-y: auto; /* <-- THIS ADDS SCROLLBAR INSIDE THE MODAL */
  flex-grow: 1;
}

.offboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 768px) {
  .offboard-grid { grid-template-columns: 1fr; }
}

.offboard-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}

.offboard-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.offboard-label {
  color: #64748b;
  font-weight: 500;
}

.offboard-value {
  color: #0f172a;
  font-weight: 600;
  text-align: right;
}

.offboard-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 12px;
  background: #eff6ff;
  border-radius: 8px;
  transition: background 0.2s;
}

.offboard-file-link:hover {
  background: #dbeafe;
}

.offboard-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.offboard-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.offboard-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Checklist */
.offboard-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.offboard-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}

.offboard-check-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.offboard-check-item input[type="checkbox"] {
  display: none;
}

.offboard-check-icon {
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.offboard-check-item input[type="checkbox"]:checked + .offboard-check-icon {
  color: #10b981;
}

.offboard-check-label {
  font-size: 14px;
  color: #334155;
  font-weight: 500;
}

.offboard-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
  border-radius: 0 0 16px 16px;
  flex-shrink: 0;
}

.spinning {
  animation: offboardSpin 1s linear infinite;
}

@keyframes offboardSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---------- Summary chips ---------- */
.offboard-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 20px;
}

.offboard-summary-chip {
  flex: 1 1 140px;
  min-width: 130px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #64748b;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.offboard-summary-count {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
}

.offboard-summary-label {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 500;
}

.offboard-summary-chip-pending {
  border-left-color: #d97706;
}
.offboard-summary-chip-pending .offboard-summary-count {
  color: #b45309;
}

.offboard-summary-chip-progress {
  border-left-color: #2563eb;
}
.offboard-summary-chip-progress .offboard-summary-count {
  color: #1d4ed8;
}

.offboard-summary-chip-done {
  border-left-color: #16a34a;
}
.offboard-summary-chip-done .offboard-summary-count {
  color: #15803d;
}

/* ---------- Toolbar: search + filter + refresh ---------- */
.offboard-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.offboard-search-container {
  position: relative;
  flex: 1 1 320px;
  min-width: 240px;
  display: flex;
  align-items: center;
}

.offboard-search-icon {
  position: absolute;
  left: 12px;
  color: #9ca3af;
  pointer-events: none;
}

.offboard-search-input {
  width: 100%;
  padding: 9px 36px 9px 36px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #1f2937;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.offboard-search-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.offboard-clear-search {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
}

.offboard-clear-search:hover {
  color: #4b5563;
  background: #f3f4f6;
}

.offboard-status-select {
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #1f2937;
  background: #ffffff;
  cursor: pointer;
  min-width: 160px;
}

.offboard-status-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.offboard-refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #4b5563;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.offboard-refresh-btn:hover:not(:disabled) {
  background: #f3f4f6;
}

.offboard-refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.offboard-refresh-btn .spinning {
  animation: offboard-spin 1s linear infinite;
}

@keyframes offboard-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---------- Filtered results count ---------- */
.offboard-results-count {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 10px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .offboard-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .offboard-search-container {
    flex: 1 1 auto;
  }

  .offboard-status-select,
  .offboard-refresh-btn {
    width: 100%;
  }

  .offboard-summary-row {
    gap: 8px;
  }

  .offboard-summary-chip {
    min-width: 0;
    flex: 1 1 calc(50% - 8px);
  }
}.case-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.case-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
}

/* Header */
.case-header {
  background: #0f172a;
  color: #fff;
  padding: 20px 26px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}
.case-title { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.case-subtitle { margin: 0; color: #94a3b8; font-size: 13px; }
.case-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
}
.case-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Tabs */
.case-tabs {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.case-tab {
  flex: 1;
  border: none;
  background: none;
  padding: 14px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.case-tab:hover { color: #334155; }
.case-tab.active {
  color: #7e22ce;
  border-bottom-color: #9333ea;
  background: #fff;
}
.case-tab-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #64748b;
  font-size: 11px;
  flex-shrink: 0;
}
.case-tab-num.done { background: #16a34a; color: #fff; }

/* Body */
.case-body {
  padding: 24px 26px;
  overflow-y: auto;
  flex: 1;
}

.case-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.case-info-chip {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.case-info-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.case-info-value { font-size: 14px; font-weight: 600; color: #111827; }

.case-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2563eb;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.case-file-link:hover { text-decoration: underline; }

/* Checklist */
.case-checklist { list-style: none; margin: 0 0 20px; padding: 0; }
.case-checklist li {
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 0;
}
.case-checklist li:last-child { border-bottom: none; }
.case-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #111827;
  cursor: pointer;
}
.case-check-label input { display: none; }
.case-check-icon { display: flex; color: #9333ea; flex-shrink: 0; }
.case-auto-hint {
  display: block;
  margin-left: 28px;
  font-size: 12px;
  color: #94a3b8;
  font-style: italic;
}

.case-field { margin-bottom: 18px; }
.case-field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #111827; }
.case-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #111827; }
.case-textarea,
.case-field textarea {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  color: #111827;
}

/* Exit interview sections */
.case-section { margin-bottom: 26px; }
.case-section:last-child { margin-bottom: 0; }
.case-section-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.case-rating-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}
.case-rating-item label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #111827;
}
.case-stars { display: flex; gap: 2px; }
.case-star {
  background: none;
  border: none;
  cursor: pointer;
  color: #e5e7eb;
  padding: 2px;
}
.case-star.active { color: #f59e0b; }

.case-checkbox-group { display: flex; flex-direction: column; gap: 10px; }
.case-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #111827;
  cursor: pointer;
}

.case-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 0;
  color: #64748b;
}
.spinning { animation: case-spin 1s linear infinite; }
@keyframes case-spin { to { transform: rotate(360deg); } }

/* Footer */
.case-footer {
  padding: 16px 26px;
  border-top: 1px solid #e5e7eb;
  background: #fafbfc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.case-progress-note { font-size: 12.5px; color: #64748b; }
.case-footer-actions { display: flex; gap: 10px; }

.case-btn {
  border: none;
  border-radius: 7px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.case-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.case-btn-secondary { background: #fff; border: 1px solid #e5e7eb; color: #111827; }
.case-btn-ghost { background: #f1f5f9; color: #111827; }
.case-btn-purple { background: #9333ea; color: #fff; }
.case-btn-green { background: #16a34a; color: #fff; }

@media (max-width: 640px) {
  .case-info-grid { grid-template-columns: 1fr; }
  .case-rating-grid { grid-template-columns: 1fr 1fr; }
  .case-tab { font-size: 11.5px; padding: 12px 6px; }
}/* ==========================================================================
   Rehire Modal - Scoped Styles (rehire- prefix)
   ========================================================================== */

/* Overlay */
.rehire-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: rehireFadeIn 0.2s ease-out;
}

@keyframes rehireFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal Shell */
.rehire-modal {
  background: #ffffff;
  border-radius: 16px;
  width: min(95vw, 560px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: rehireSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rehireSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.rehire-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px solid #16a34a;
  border-radius: 16px 16px 0 0;
}

.rehire-header-content {
  flex: 1;
}

.rehire-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: #ffffff;
}

.rehire-subtitle {
  font-size: 14px;
  margin: 0;
  color: #cbd5e1;
}

.rehire-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.rehire-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: rgba(239, 68, 68, 1);
}

/* Body */
.rehire-body {
  padding: 24px;
  overflow-y: auto;
}

/* Info Box */
.rehire-info-box {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.rehire-info-icon {
  color: #16a34a;
  flex-shrink: 0;
  margin-top: 2px;
}

.rehire-info-text {
  font-size: 13px;
  color: #166534;
  margin: 0;
  line-height: 1.5;
}

/* Form Groups */
.rehire-form-group {
  margin-bottom: 20px;
}

.rehire-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.rehire-required {
  color: #dc2626;
  font-weight: 700;
}

.rehire-optional {
  color: #64748b;
  font-weight: 400;
  font-size: 12px;
}

/* Input with Icon */
.rehire-input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.rehire-input-icon {
  position: absolute;
  left: 12px;
  color: #64748b;
  pointer-events: none;
}

/* Inputs */
.rehire-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
  color: #0f172a;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.rehire-input-with-icon .rehire-input {
  padding-left: 38px;
}

.rehire-input:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.rehire-input:hover:not(:focus) {
  border-color: #94a3b8;
}

.rehire-input::placeholder {
  color: #94a3b8;
}

.rehire-input[type="date"] {
  cursor: pointer;
}

/* Error States */
.rehire-error {
  border-color: #dc2626 !important;
  background-color: #fef2f2;
}

.rehire-error-msg {
  color: #dc2626;
  font-size: 12px;
  font-weight: 500;
  margin-top: 6px;
  display: block;
}

/* Footer */
.rehire-footer {
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* Buttons */
.rehire-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.rehire-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.rehire-btn-secondary {
  background: #ffffff;
  color: #475569;
  border: 1.5px solid #cbd5e1;
}

.rehire-btn-secondary:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.rehire-btn-primary {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
}

.rehire-btn-primary:hover:not(:disabled) {
  background: #15803d;
  box-shadow: 0 4px 8px rgba(22, 163, 74, 0.3);
  transform: translateY(-1px);
}

/* Spinner */
.rehire-spinner {
  animation: rehireSpin 1s linear infinite;
}

@keyframes rehireSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 640px) {
  .rehire-modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .rehire-overlay {
    padding: 0;
  }
  
  .rehire-footer {
    flex-direction: column-reverse;
  }
  
  .rehire-btn {
    width: 100%;
  }
}/* ==========================================================================
   Employment History Modal - Scoped Styles (emp-history- prefix)
   ========================================================================== */

/* Overlay */
.emp-history-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: empHistoryFadeIn 0.2s ease-out;
}

@keyframes empHistoryFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal Shell */
.emp-history-modal {
  background: #ffffff;
  border-radius: 16px;
  width: min(95vw, 700px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: empHistorySlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes empHistorySlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.emp-history-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px solid #16a34a;
  border-radius: 16px 16px 0 0;
}

.emp-history-header h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: #ffffff;
}

.emp-history-header p {
  font-size: 14px;
  margin: 0;
  color: #cbd5e1;
}

.emp-history-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.emp-history-close:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: rgba(239, 68, 68, 1);
}

/* Body */
.emp-history-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
  background: #f8fafc;
}

/* Loading State */
.emp-history-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #64748b;
  gap: 12px;
}

.emp-history-loading .spinning {
  color: #16a34a;
}

/* Empty State */
.emp-history-empty {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
  font-size: 14px;
}

/* Timeline */
.emp-history-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.emp-history-item {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.emp-history-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #16a34a, #059669);
}

.emp-history-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* Cycle Badge */
.emp-history-cycle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #f1f5f9;
}

.emp-history-cycle svg {
  color: #16a34a;
}

.emp-history-cycle span {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Dates Section */
.emp-history-dates {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.emp-history-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
}

.emp-history-date svg {
  color: #64748b;
  flex-shrink: 0;
}

.emp-history-date span {
  font-weight: 500;
}

/* Status Badge */
.emp-history-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.emp-history-status svg {
  color: #64748b;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-active {
  background: #dcfce7;
  color: #166534;
}

.status-resigned {
  background: #fee2e2;
  color: #991b1b;
}

.status-terminated {
  background: #fef3c7;
  color: #92400e;
}

.status-rehired {
  background: #dbeafe;
  color: #1e40af;
}

/* Reason Section */
.emp-history-reason {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
}

.emp-history-reason strong {
  color: #0f172a;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

/* Footer */
.emp-history-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
  border-radius: 0 0 16px 16px;
}

/* Buttons */
.emp-history-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.emp-history-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.emp-history-btn-primary {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
}

.emp-history-btn-primary:hover:not(:disabled) {
  background: #15803d;
  box-shadow: 0 4px 8px rgba(22, 163, 74, 0.3);
  transform: translateY(-1px);
}

.emp-history-btn-secondary {
  background: #ffffff;
  color: #475569;
  border: 1.5px solid #cbd5e1;
}

.emp-history-btn-secondary:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* Spinner */
.emp-history-spinner {
  animation: empHistorySpin 1s linear infinite;
}

@keyframes empHistorySpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 640px) {
  .emp-history-modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .emp-history-overlay {
    padding: 0;
  }
  
  .emp-history-item {
    padding: 16px;
  }
  
  .emp-history-footer {
    flex-direction: column-reverse;
  }
  
  .emp-history-btn {
    width: 100%;
  }
}

/* Scrollbar Styling */
.emp-history-body::-webkit-scrollbar {
  width: 8px;
}

.emp-history-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.emp-history-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.emp-history-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .emp-history-overlay,
  .emp-history-modal,
  .emp-history-item,
  .spinning {
    animation: none !important;
    transition: none !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .emp-history-item {
    border-width: 2px;
  }
  
  .status-badge {
    border: 1px solid currentColor;
  }
}/* === Main Container === */
.staffReview-container {
  padding: 10px 20px;
  max-width: 98%;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* === Status Badges (matches Client Review) === */
.p-status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
  text-align: center;
  min-width: 100px;
}
.p-status-upcoming {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.p-status-soon {
  background-color: #ffedd5;
  color: #9a3412;
  border: 1px solid #fdba74;
}
.p-status-today {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.p-status-overdue {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.p-status-completed {
  background-color: #e5e7eb;
  color: #374151;
  border: 1px solid #d1d5db;
}

/* === Top Row (wraps naturally, no horizontal scroll) === */
.staffReview-toprow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 16px;
}
.staffReview-toprow > * {
  flex-shrink: 1;
}

/* === Header === */
.staffReview-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
  padding: 6px 10px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.staffReview-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.staffReview-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  white-space: nowrap;
}

/* === Stats Bar === */
.staffReview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0;
}
.staffReview-stat {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 10px;
  background: white;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #9ca3af;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.staffReview-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.staffReview-stat-value {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1;
}
.staffReview-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.staffReview-stat-total {
  border-left-color: #E820DA;
}
.staffReview-stat-total .staffReview-stat-value {
  color: #E820DA;
}
.staffReview-stat-overdue {
  border-left-color: #dc2626;
  background: #fef7f7;
}
.staffReview-stat-overdue .staffReview-stat-value {
  color: #991b1b;
}
.staffReview-stat-today {
  border-left-color: #d97706;
  background: #fffaf0;
}
.staffReview-stat-today .staffReview-stat-value {
  color: #92400e;
}
.staffReview-stat-soon {
  border-left-color: #ea580c;
  background: #fff8f3;
}
.staffReview-stat-soon .staffReview-stat-value {
  color: #9a3412;
}
.staffReview-stat-upcoming {
  border-left-color: #059669;
  background: #f5fdf9;
}
.staffReview-stat-upcoming .staffReview-stat-value {
  color: #065f46;
}
.staffReview-stat-completed {
  border-left-color: #6b7280;
  background: #f9fafb;
}
.staffReview-stat-completed .staffReview-stat-value {
  color: #374151;
}

/* === Toolbar (search + entries control) === */
.staffReview-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 0;
}
.staffReview-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  gap: 16px;
  flex-wrap: wrap;
}

/* === Primary Add Button === */
.staffReview-btn-primary {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(232, 32, 218, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}
.staffReview-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 32, 218, 0.4);
  background: linear-gradient(135deg, #002060 50%, #E820DA 50%);
}

/* === Export Buttons === */
.staffReview-export-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.staffReview-btn-archived,
.staffReview-btn-excel,
.staffReview-btn-pdf,
.staffReview-btn-print {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0;
  white-space: nowrap;
}
.staffReview-btn-archived {
  background: linear-gradient(135deg, #ff9800 20%, #b45309 100%);
  color: white;
}
.staffReview-btn-excel {
  background: #10b981;
  color: white;
}
.staffReview-btn-pdf {
  background: #ec4899;
  color: white;
}
.staffReview-btn-print {
  background: #8b5cf6;
  color: white;
}
.staffReview-btn-archived:hover,
.staffReview-btn-excel:hover,
.staffReview-btn-pdf:hover,
.staffReview-btn-print:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* === Search & Clear === */
.staffReview-search {
  padding: 8px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  width: 250px;
  transition: all 0.3s ease;
}
.staffReview-search:focus {
  outline: none;
  border-color: #E820DA;
  box-shadow: 0 0 0 3px rgba(232, 32, 218, 0.1);
}
.staffReview-btn-clear-search {
  background: white;
  color: #E820DA;
  border: 2px solid #e5e7eb;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.staffReview-btn-clear-search:hover {
  border-color: #E820DA;
  background: #fdf2fc;
  color: #b018a8;
}

/* === Entries Control === */
.staffReview-entries-control {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.staffReview-entries-control label {
  font-size: 14px;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  white-space: nowrap;
}
.staffReview-entries-select {
  padding: 6px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  background: white;
  transition: all 0.3s ease;
}
.staffReview-entries-select:focus {
  outline: none;
  border-color: #E820DA;
}

/* === Table === */
.staffReview-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 72vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  border: 1px solid #e5e7eb;
}
.staffReview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.staffReview-table thead {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}
.staffReview-table th {
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.staffReview-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}
.staffReview-table th.sortable:hover {
  background: rgba(255, 255, 255, 0.1);
}
.sort-icon {
  margin-left: 5px;
  opacity: 0.6;
  font-size: 12px;
}
.staffReview-table th.sortable:hover .sort-icon {
  opacity: 1;
}
.sort-asc, .sort-desc {
  opacity: 1;
  font-weight: bold;
}
.staffReview-table td {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
}
.staffReview-table tbody tr {
  transition: all 0.2s ease;
}
.staffReview-table tbody tr:hover {
  background-color: #f9fafb;
  transform: scale(1.005);
}
.staffReview-no-data {
  text-align: center;
  padding: 30px;
  color: #6b7280;
  font-style: italic;
}

/* === Row status colors === */
.staffReview-row-completed {
  background-color: #f3f4f6 !important;
}
.staffReview-row-due-today {
  background-color: #fef3c7 !important;
}
.staffReview-row-due-soon {
  background-color: #ffedd5 !important;
}
.staffReview-row-overdue {
  background-color: #fee2e2 !important;
}
.staffReview-row-overdue td,
.staffReview-row-due-soon td,
.staffReview-row-due-today td,
.staffReview-row-completed td {
  background-color: inherit !important;
}

/* === Avatar === */
.staffReview-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}
.staffReview-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e5e7eb;
}
.staffReview-avatar-initials {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* === Action Buttons === */
.staffReview-btn-details {
  background: #fbbf24;
  color: #1a1a1a;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.staffReview-btn-details:hover {
  background: #f59e0b;
  transform: translateY(-1px);
}
.staffReview-btn-edit {
  background: linear-gradient(135deg, #E820DA 20%, #002060 100%);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.staffReview-btn-edit:hover {
  background: #002060;
  transform: translateY(-1px);
}
.staffReview-btn-archive {
  background: linear-gradient(135deg, #ff9800 20%, #b45309 100%);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 6px;
  display: inline-block;
}
.staffReview-btn-archive:hover {
  background: #b45309;
  transform: translateY(-1px);
}
.staffReview-btn-small {
  padding: 5px 10px;
  margin-right: 5px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

/* === Pagination === */
.staffReview-pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 15px;
  background: #f9fafb;
  border-radius: 8px;
}
.staffReview-pagination-info {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}
.staffReview-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.staffReview-pagination-btn {
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}
.staffReview-pagination-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #E820DA;
}
.staffReview-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.staffReview-pagination-active {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: white;
  border-color: #002060;
}

/* === Modals === */
.staffReview-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.staffReview-modal {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.staffReview-modal-large {
  max-width: 900px;
  width: 90%;
}
.staffReview-modal-details {
  max-width: 700px;
}
.staffReview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #E820DA 20%, #002060 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}
.staffReview-modal-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}
.staffReview-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 28px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.staffReview-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* === Forms === */
.staffReview-form {
  padding: 24px;
}
.staffReview-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 10px;
}
.staffReview-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.staffReview-form-group-full {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.staffReview-form-group label,
.staffReview-form-group-full label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}
.staffReview-form-group input,
.staffReview-form-group select,
.staffReview-form-group-full input,
.staffReview-form-group-full textarea {
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
}
.staffReview-form-group input:focus,
.staffReview-form-group select:focus,
.staffReview-form-group-full input:focus,
.staffReview-form-group-full textarea:focus {
  outline: none;
  border-color: #E820DA;
  box-shadow: 0 0 0 3px rgba(232, 32, 218, 0.1);
}
.staffReview-form-group-full textarea {
  resize: vertical;
  font-family: inherit;
}
.staffReview-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.staffReview-btn-cancel {
  padding: 10px 24px;
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.staffReview-btn-cancel:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.staffReview-btn-save {
  padding: 10px 24px;
  border: none;
  background: linear-gradient(135deg, #E820DA 20%, #002060 100%);
  color: white;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(232, 32, 218, 0.3);
}
.staffReview-btn-save:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 32, 218, 0.4);
}
.staffReview-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* === Details Modal === */
.staffReview-details-content {
  padding: 24px;
}
.staffReview-details-photo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.staffReview-details-photo .staffReview-avatar-img,
.staffReview-details-photo .staffReview-avatar-initials {
  width: 80px;
  height: 80px;
  font-size: 28px;
}
.staffReview-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 10px;
}
.staffReview-details-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.staffReview-details-item strong {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
}
.staffReview-details-item span {
  font-size: 15px;
  color: #1a1a1a;
  font-weight: 500;
}
.staffReview-details-notes {
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 4px solid #E820DA;
}
.staffReview-details-notes strong {
  display: block;
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
  font-weight: 600;
}
.staffReview-details-notes p {
  margin: 0;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* === Archived Table === */
.staffReview-archived-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.staffReview-archived-table th,
.staffReview-archived-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}
.staffReview-archived-table th {
  background-color: #ff9800;
  color: white;
  font-weight: 600;
}
.staffReview-archived-table tr:hover {
  background-color: #f5f5f5;
}

/* === Loading & Toast === */
.staffReview-loading {
  text-align: center;
  padding: 40px;
  font-size: 16px;
  color: #6b7280;
}
.staffReview-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(232, 32, 218, 0.3);
  border-radius: 50%;
  border-top-color: #E820DA;
  animation: spin 1s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.staffReview-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
}
.staffReview-toast-show {
  transform: translateY(0);
  opacity: 1;
}
.staffReview-toast-success {
  background: #10b981;
}
.staffReview-toast-error {
  background: #ef4444;
}

/* === Print === */
@media print {
  .staffReview-header,
  .staffReview-controls,
  .staffReview-pagination,
  .staffReview-btn-details,
  .staffReview-btn-edit,
  .staffReview-btn-archive {
    display: none !important;
  }
  .staffReview-table {
    font-size: 10px;
  }
  .staffReview-table th,
  .staffReview-table td {
    padding: 6px;
  }
}

/* === Responsive === */
@media (max-width: 768px) {
  .staffReview-container {
    padding: 10px;
  }
  .staffReview-title {
    font-size: 18px;
  }
  .staffReview-search {
    width: 220px;
  }
  .staffReview-entries-control {
    font-size: 13px;
  }
  .staffReview-pagination-wrapper {
    flex-direction: column;
    align-items: center;
  }
  .staffReview-pagination-info {
    font-size: 13px;
  }
  .staffReview-table-wrapper {
    max-height: 400px;
  }
  .staffReview-table {
    font-size: 12px;
  }
  .staffReview-table th,
  .staffReview-table td {
    padding: 8px 6px;
  }
  .staffReview-avatar-img,
  .staffReview-avatar-initials {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  .staffReview-form-row {
    grid-template-columns: 1fr;
  }
  .staffReview-modal {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
  }
  .staffReview-modal-header {
    border-radius: 0;
  }
  .staffReview-search {
    width: 100%;
    min-width: 160px;
  }
  .staffReview-toolbar {
    width: 100%;
  }
  .staffReview-controls {
    width: 100%;
  }
}
/* Review Types Management Styles */
.staffReview-btn-reviewtypes {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: white;
  margin-right: 10px;
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.staffReview-btn-reviewtypes:hover {
  background: linear-gradient(135deg, #002060 50%, #E820DA 50%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(232, 32, 218, 0.3);
}

.staffReview-modal-large {
  max-width: 900px;
  width: 90%;
}

.staffReview-reviewtypes-list {
  margin-bottom: 20px;
}

.staffReview-btn-add-type {
  background-color: #10b981;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 15px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.staffReview-btn-add-type:hover {
  background-color: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.staffReview-reviewtypes-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.staffReview-reviewtypes-table th,
.staffReview-reviewtypes-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.staffReview-reviewtypes-table th {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: white;
  font-weight: 600;
}

.staffReview-reviewtypes-table tr:hover {
  background-color: #f5f5f5;
}

.staffReview-btn-small {
  padding: 5px 10px;
  margin-right: 5px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.staffReview-btn-delete {
  background-color: #ef4444;
  color: white;
}

.staffReview-btn-delete:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
}

.staffReview-archived-table {
  width: 100%;
  border-collapse: collapse;
}

.staffReview-archived-table th,
.staffReview-archived-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.staffReview-archived-table th {
  background-color: #ff9800;
  color: white;
  font-weight: 600;
}

.staffReview-archived-table tr:hover {
  background-color: #f5f5f5;
}

/* ============================================================
   Custom Confirm Modal — replaces window.confirm()
   ============================================================ */
.staffReview-confirm-overlay {
  z-index: 1100;
}

.staffReview-confirm-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 28px 28px 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: confirmPopIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes confirmPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.staffReview-confirm-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, 'Times New Roman', serif;
}

.staffReview-confirm-warning .staffReview-confirm-icon {
  background: #ffedd5;
  color: #b45309;
}

.staffReview-confirm-danger .staffReview-confirm-icon {
  background: #fee2e2;
  color: #dc2626;
}

.staffReview-confirm-info .staffReview-confirm-icon {
  background: #fce7fb;
  color: #E820DA;
}

.staffReview-confirm-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
}

.staffReview-confirm-message {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.6;
  color: #4b5563;
}

.staffReview-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.staffReview-confirm-actions .staffReview-btn-cancel {
  flex: 1;
  padding: 10px 20px;
}

.staffReview-btn-confirm {
  flex: 1;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
}

.staffReview-btn-confirm-warning {
  background: linear-gradient(135deg, #ff9800 20%, #b45309 100%);
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.3);
}

.staffReview-btn-confirm-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.4);
}

.staffReview-btn-confirm-danger {
  background: linear-gradient(135deg, #f87171 20%, #dc2626 100%);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.staffReview-btn-confirm-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.staffReview-btn-confirm-info {
  background: linear-gradient(135deg, #E820DA 20%, #002060 100%);
  box-shadow: 0 2px 8px rgba(232, 32, 218, 0.3);
}

.staffReview-btn-confirm-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 32, 218, 0.4);
}

@media (max-width: 480px) {
  .staffReview-confirm-modal {
    padding: 24px 20px 20px;
  }
  .staffReview-confirm-actions {
    flex-direction: column;
  }
}/* Birthdays Component Styles */
.birthdays-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
  min-height: 70vh;
  max-height: 90vh;
}

.birthdays-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.birthdays-title-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.birthdays-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a202c;
  margin: 0;
}

.birthdays-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.birthdays-count {
  background: #e2e8f0;
  color: #4a5568;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
}

.birthdays-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.birthdays-search-group,
.birthdays-filter-group,
.birthdays-days-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.birthdays-search-input,
.birthdays-filter-select,
.birthdays-days-select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  transition: border-color 0.2s;
}

.birthdays-search-input {
  width: 200px;
}

.birthdays-search-input:focus,
.birthdays-filter-select:focus,
.birthdays-days-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.birthdays-days-label {
  font-size: 14px;
  color: #4a5568;
  font-weight: 500;
}

.birthdays-refresh-btn {
  padding: 8px 12px;
  background: #f7fafc;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.birthdays-refresh-btn:hover {
  background: #edf2f7;
  transform: rotate(180deg);
}

/* Loading State */
.birthdays-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #6b7280;
}

.birthdays-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: birthdays-spin 1s linear infinite;
  margin-bottom: 16px;
}

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

/* Error State */
.birthdays-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  color: #dc2626;
}

.birthdays-retry-btn {
  margin-top: 12px;
  padding: 8px 16px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.birthdays-retry-btn:hover {
  background: #b91c1c;
}

/* Empty State */
.birthdays-empty {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.birthdays-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.birthdays-empty h3 {
  font-size: 20px;
  color: #374151;
  margin: 0 0 8px 0;
}

.birthdays-empty p {
  font-size: 16px;
  margin: 0;
}

/* Table Styles */
.birthdays-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 60vh;
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.birthdays-table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  margin-bottom: 24px;
  position: relative;
  
}

.birthdays-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
  table-layout: fixed;
}

.birthdays-thead {
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.birthdays-header-row {
  border-bottom: 1px solid #e5e7eb;
}

.birthdays-th {
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  font-size: 13px;
  border-bottom: 1px solid #e5e7eb;
}

.birthdays-tbody {
  background: white;
}

.birthdays-row {
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s;
}

.birthdays-row:hover {
  background: #f9fafb;
}

.birthdays-row-today {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
}

.birthdays-row-today:hover {
  background: #fde68a;
}

.birthdays-row-this-week {
  background: #dbeafe;
  border-left: 4px solid #3b82f6;
}

.birthdays-row-this-week:hover {
  background: #bfdbfe;
}

.birthdays-td {
  padding: 12px 8px;
  font-size: 13px;
  color: #374151;
  vertical-align: middle;
}

/* Cell-specific styles */
.birthdays-date-cell {
  min-width: 70px;
  width: 10%;
}

.birthdays-date-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.birthdays-date-text {
  font-weight: 600;
  color: #1f2937;
  font-size: 14px;
}

.birthdays-year-text {
  font-size: 11px;
  color: #6b7280;
}

.birthdays-name-cell {
  min-width: 150px;
  width: 25%;
}

.birthdays-name-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.birthdays-name-icon {
  font-size: 18px;
}

.birthdays-name-info {
  display: flex;
  flex-direction: column;
}

.birthdays-name-text {
  font-weight: 600;
  color: #1f2937;
  line-height: 1.3;
  word-break: break-word;
}

.birthdays-job-text {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
}

.birthdays-type-badge {
  padding: 3px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.birthdays-age-cell {
  text-align: center;
  font-weight: 600;
  color: #1f2937;
  width: 8%;
  min-width: 50px;
}

.birthdays-days-cell {
  text-align: center;
  width: 12%;
  min-width: 80px;
}

.birthdays-days-badge {
  padding: 3px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.birthdays-contact-cell {
  min-width: 120px;
  width: 20%;
}

.birthdays-contact-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.birthdays-contact-link {
  color: #3b82f6;
  text-decoration: none;
  font-size: 11px;
  transition: color 0.2s;
  word-break: break-all;
}

.birthdays-location-cell {
  text-align: center;
  width: 15%;
  min-width: 80px;
}

.birthdays-postcode {
  background: #f3f4f6;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #4b5563;
}

/* Pagination Control Styles */
.birthdays-pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.birthdays-items-per-page {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #4b5563;
}

.birthdays-items-select {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

.birthdays-showing-info {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

/* Pagination Styles */
.birthdays-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
 
  padding: 16px;
}

.birthdays-pagination-btn {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  min-width: 40px;
  text-align: center;
}

.birthdays-pagination-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.birthdays-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f9fafb;
}

.birthdays-pagination-active {
  background: #3b82f6 !important;
  color: white !important;
  border-color: #3b82f6 !important;
}

.birthdays-pagination-numbers {
  display: flex;
  gap: 4px;
}

.birthdays-pagination-prev,
.birthdays-pagination-next {
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
  .birthdays-container {
    padding: 16px;
    margin-bottom: 80px;
  }

  .birthdays-header {
    flex-direction: column;
    align-items: stretch;
  }

  .birthdays-controls {
    justify-content: space-between;
  }

  .birthdays-search-input {
    width: 150px;
  }

  .birthdays-table-wrapper {
    max-height: 60vh;
    margin: 0 -16px 24px -16px;
    border-radius: 0;
  }

  .birthdays-table-container {
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  .birthdays-table {
    min-width: 600px;
  }

  .birthdays-th,
  .birthdays-td {
    padding: 8px 6px;
    font-size: 12px;
  }

  .birthdays-name-text {
    font-size: 13px;
  }

  .birthdays-date-text {
    font-size: 13px;
  }

  .birthdays-pagination-controls {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .birthdays-pagination {
    flex-wrap: wrap;
    gap: 6px;
  }

  .birthdays-pagination-btn {
    padding: 6px 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .birthdays-title {
    font-size: 24px;
  }

  .birthdays-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .birthdays-search-input {
    width: 100%;
  }

  .birthdays-table {
    min-width: 500px;
  }

  .birthdays-th,
  .birthdays-td {
    padding: 6px 4px;
    font-size: 11px;
  }

  .birthdays-name-text,
  .birthdays-date-text {
    font-size: 12px;
  }

  .birthdays-pagination-numbers {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .birthdays-pagination-btn {
    min-width: 36px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .birthdays-pagination-controls {
    text-align: center;
  }

  .birthdays-items-per-page {
    justify-content: center;
  }
}

/* Smooth Scrolling and Better Spacing */
.birthdays-container * {
  box-sizing: border-box;
}

.birthdays-table-wrapper::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.birthdays-table-wrapper::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.birthdays-table-wrapper::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
  border: 2px solid #f8fafc;
}

.birthdays-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.birthdays-table-wrapper::-webkit-scrollbar-corner {
  background: #f8fafc;
}
.staffnotes-container {
  width: 100%;
  margin: 0;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.staffnotes-consolidated-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.staffnotes-controls-row {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.staffnotes-date-filters-compact {
  display: flex;
  align-items: center;
}

.staffnotes-table-search-compact {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  min-width: 250px;
  max-width: 300px;
}

.staffnotes-action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.staffnotes-search-results-info {
  margin-bottom: 15px;
  padding-left: 5px;
}

.staffnotes-header-section {
  margin-bottom: 15px;
  position: sticky;
  top: 0;
  background: white;
  z-index: 100;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.staffnotes-custom-date-filters {
  display: flex;
  gap: 10px;
  align-items: center;
}

.staffnotes-date-range-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.staffnotes-date-custom {
  background: #f8f9fa;
  color: #495057;
  border: 1px solid #ced4da;
  min-width: 150px;
  text-align: left;
}

.staffnotes-date-custom:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  transform: translateY(-1px);
}

.staffnotes-date-custom.staffnotes-date-active {
  background: #28a745 !important;
  color: white !important;
  border-color: #28a745 !important;
}

.staffnotes-date-picker {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  background: white;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 14px;
}

.staffnotes-date-picker:focus {
  outline: none;
  border-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
}

.staffnotes-date-badge {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.staffnotes-date-active {
  background: #28a745 !important;
  color: white;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.staffnotes-date-clear {
  background: #dc3545;
  color: white;
}

.staffnotes-date-clear:hover {
  background: #c82333;
  transform: translateY(-1px);
}

.staffnotes-main-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  color: #333;
  white-space: nowrap;
}

.staffnotes-export-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

.staffnotes-csv {
  background: #17a2b8;
  color: white;
}

.staffnotes-excel {
  background: #28a745;
  color: white;
}

.staffnotes-print {
  background: #6f42c1;
  color: white;
}

.staffnotes-create-btn {
  background: #007bff;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.staffnotes-table-container {
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex: 1;
  min-height: 400px;
  max-height: calc(100vh - 250px);
  position: relative;
}

.staffnotes-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  min-width: 1000px;
}

.staffnotes-table-header-sticky {
  position: sticky;
  top: 0;
  z-index: 10;
}

.staffnotes-table-header-sticky th {
  background: #28a745 !important;
  color: #ffffff !important;
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  border-right: 1px solid #1e7e34;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.staffnotes-table th {
  background: #28a745 !important;
  color: #ffffff !important;
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  border-right: 1px solid #1e7e34;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.staffnotes-table thead th,
.staffnotes-table-header-sticky > tr > th,
.staffnotes-table > thead > tr > th {
  background: #28a745 !important;
  color: #ffffff !important;
  border-color: #1e7e34 !important;
}

.staffnotes-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #ddd;
  border-right: 1px solid #ddd;
  font-size: 14px;
  vertical-align: top;
  line-height: 1.4;
}

.staffnotes-content-cell {
  max-width: 300px;
  word-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staffnotes-detail-view {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 30px;
  margin: 20px 0;
}

.staffnotes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid #28a745;
}

.staffnotes-staff-name {
  font-size: 28px;
  font-weight: 600;
  color: #28a745;
  margin: 0;
}

.staffnotes-back-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.staffnotes-detail-content {
  line-height: 1.6;
}

.staffnotes-detail-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.staffnotes-label {
  font-weight: 600;
  color: #333;
}

.staffnotes-value {
  color: #666;
}

.staffnotes-date-info {
  color: #666;
  font-size: 14px;
}

.staffnotes-subject {
  font-weight: 600;
  font-size: 16px;
  margin: 20px 0;
  color: #333;
}

.staffnotes-content {
  margin: 20px 0;
  color: #444;
  line-height: 1.7;
}

.staffnotes-content p {
  margin-bottom: 15px;
}

.staffnotes-footer {
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  color: #666;
}

.staffnotes-form-container {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 5px;
  margin: 10px 0;
}

.staffnotes-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 15px;
  border-bottom: 2px solid #28a745;
}

.staffnotes-form-title {
  font-size: 28px;
  font-weight: 500;
  color: #28a745;
  margin: 0;
}

.staffnotes-form {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.staffnotes-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.staffnotes-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.staffnotes-form-group label {
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.staffnotes-input {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.staffnotes-input:focus {
  outline: none;
  border-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
}

.staffnotes-textarea {
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 18px;
  font-family: inherit;
  resize: vertical;
  max-height: 100px;
  transition: border-color 0.2s;
}

.staffnotes-textarea:focus {
  outline: none;
  border-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
}

.staffnotes-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.staffnotes-edit-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 5px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.2s;
  margin-right: 10px;
}

.staffnotes-edit-btn:hover {
  background: #218838;
}

.staffnotes-update-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 5px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.staffnotes-cancel-btn {
  background: #c21515;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.2s;
  margin-right: 10px;
}

.staffnotes-cancel-btn:hover {
  background: #e00a52;
}

.staffnotes-update-btn:hover {
  background: #0056b3;
}

.staffnotes-pagination-container {
  background: white;
  border-top: 1px solid #ddd;
  margin-top: 5px;
  margin-bottom: 5px;
}

.staffnotes-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.staffnotes-pagination-info {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.staffnotes-pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.staffnotes-pagination-number {
  border: 1px solid #ddd;
  background: white !important;
  color: #333 !important;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  min-width: 40px;
  transition: all 0.2s ease;
}

.staffnotes-pagination-number:hover:not(:disabled) {
  background: #f8f9fa !important;
  border-color: #28a745;
  color: #28a745 !important;
}

.staffnotes-pagination-active {
  background: #28a745 !important;
  color: white !important;
  border-color: #28a745;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.staffnotes-pagination-controls button {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: white;
  color: #333;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  min-width: 40px;
  transition: all 0.2s ease;
}

.staffnotes-pagination-controls button:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #28a745;
  color: #28a745;
}

.staffnotes-pagination-controls button:disabled {
  background: #f8f9fa;
  color: #6c757d;
  border-color: #dee2e6;
  cursor: not-allowed;
  opacity: 0.6;
}

.staffnotes-loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}

.staffnotes-error {
  color: #dc3545;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  border-left: 4px solid #dc3545;
}

.staffnotes-staff-dropdown {
  max-height: 200px;
  overflow-y: auto;
}

.staffnotes-staff-dropdown option {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
}

.staffnotes-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.staffnotes-action-btn,
.staffnotes-table .staffnotes-action-btn,
.staffnotes-table td .staffnotes-action-btn,
table .staffnotes-action-btn {
  padding: 6px 10px !important;
  border: 1px solid #ddd !important;
  background: white !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-size: 12px !important;
  transition: all 0.2s ease !important;
  color: #212529 !important;
  font-weight: 500 !important;
  min-width: 32px !important;
  text-align: center !important;
  display: inline-block !important;
}

.staffnotes-read-more,
.staffnotes-table .staffnotes-read-more,
.staffnotes-table td .staffnotes-read-more,
table .staffnotes-read-more {
  background: #ffc107 !important;
  color: #000000 !important;
  border-color: #ffc107 !important;
  font-weight: 600 !important;
}

.staffnotes-read-more:hover,
.staffnotes-table .staffnotes-read-more:hover,
.staffnotes-table td .staffnotes-read-more:hover,
table .staffnotes-read-more:hover {
  background: #e0a800 !important;
  border-color: #d39e00 !important;
  color: #000000 !important;
  transform: translateY(-1px) !important;
}

.staffnotes-edit,
.staffnotes-table .staffnotes-edit,
.staffnotes-table td .staffnotes-edit,
table .staffnotes-edit {
  background: #17a2b8 !important;
  color: #ffffff !important;
  border-color: #17a2b8 !important;
}

.staffnotes-edit:hover,
.staffnotes-table .staffnotes-edit:hover,
.staffnotes-table td .staffnotes-edit:hover,
table .staffnotes-edit:hover {
  background: #138496 !important;
  border-color: #117a8b !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

.staffnotes-delete,
.staffnotes-table .staffnotes-delete,
.staffnotes-table td .staffnotes-delete,
table .staffnotes-delete {
  background: #dc3545 !important;
  color: #ffffff !important;
  border-color: #dc3545 !important;
}

.staffnotes-delete:hover,
.staffnotes-table .staffnotes-delete:hover,
.staffnotes-table td .staffnotes-delete:hover,
table .staffnotes-delete:hover {
  background: #c82333 !important;
  border-color: #bd2130 !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

button[class*="staffnotes-edit"],
button[class*="staffnotes-delete"],
.staffnotes-table button[class*="staffnotes-edit"],
.staffnotes-table button[class*="staffnotes-delete"] {
  font-size: 14px !important;
  line-height: 1 !important;
  padding: 8px !important;
  min-width: 36px !important;
  height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.staffnotes-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease-out;
}

.staffnotes-toast-success {
  background: #28a745;
}

.staffnotes-toast-error {
  background: #dc3545;
}

.staffnotes-toast-warning {
  background: #ffc107;
  color: #000;
}

.staffnotes-toast-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.staffnotes-delete-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.staffnotes-delete-modal {
  background: white;
  border-radius: 8px;
  padding: 0;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.staffnotes-delete-modal-header {
  padding: 20px 24px 0;
  border-bottom: 1px solid #eee;
}

.staffnotes-delete-modal-header h3 {
  margin: 0 0 16px 0;
  color: #dc3545;
  font-size: 18px;
  font-weight: 600;
}

.staffnotes-delete-modal-body {
  padding: 20px 24px;
}

.staffnotes-delete-modal-body p {
  margin: 0 0 12px 0;
  color: #333;
  line-height: 1.5;
}

.staffnotes-delete-warning {
  color: #dc3545 !important;
  font-weight: 500;
  font-size: 14px;
}

.staffnotes-delete-modal-actions {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.staffnotes-delete-cancel-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: white;
  color: #333;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.staffnotes-delete-cancel-btn:hover {
  background: #f8f9fa;
}

.staffnotes-delete-confirm-btn {
  padding: 8px 16px;
  border: none;
  background: #dc3545;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.staffnotes-delete-confirm-btn:hover {
  background: #c82333;
}

.staffnotes-required {
  color: #dc3545;
  font-weight: bold;
}

.staffnotes-detail-actions {
  display: flex;
  gap: 10px;
}

@media (max-width: 1200px) {
  .staffnotes-container {
    padding: 10px;
  }

  .staffnotes-consolidated-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .staffnotes-controls-row {
    width: 100%;
    justify-content: space-between;
  }

  .staffnotes-table-search-compact {
    min-width: 200px;
  }
}

@media (max-width: 768px) {
  .staffnotes-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .staffnotes-date-filters-compact {
    justify-content: center;
  }

  .staffnotes-action-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }

  .staffnotes-table-search-compact {
    min-width: auto;
    width: 100%;
  }
}
/* ============================================================================
   Holiday & Leave Planner — styles
   ========================================================================= */

.holiday-wrapper {
  width: 100%;
  min-height: 100vh;
  background: #f3f4f6;
  padding: 0;
  box-sizing: border-box;
}

.holiday-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

* {
  box-sizing: border-box;
}

/* ============================================================================
   NEW: Sidebar shell layout (replaces the old top role-tabs)
   ========================================================================= */

.holiday-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  width: 100%;
}

/* ---------------------------------- Sidebar -------------------------------- */

.holiday-sidebar {
  width: 260px;
  flex: none;
  background: #002060;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.holiday-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 18px;
}

.holiday-sidebar-brand-text {
  min-width: 0;
}

.holiday-sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.holiday-sidebar-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin: 2px 0 0 0;
}

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

.holiday-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 12px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.holiday-sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.holiday-sidebar-link-active {
  background: rgba(255, 255, 255, 0.14);
  border-left: 3px solid #ffffff;
  color: #ffffff;
}

.holiday-sidebar-link-icon {
  font-size: 17px;
  flex: none;
  width: 22px;
  text-align: center;
}

.holiday-sidebar-link-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.holiday-sidebar-link-label {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

.holiday-sidebar-link-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.holiday-sidebar-link-active .holiday-sidebar-link-sub {
  color: rgba(255, 255, 255, 0.75);
}

.holiday-sidebar-fy {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.holiday-sidebar-fy-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 8px;
  padding-left: 4px;
}

.holiday-fy-selector-sidebar {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  box-shadow: none;
  width: 100%;
  justify-content: center;
}

.holiday-fy-selector-sidebar button {
  color: rgba(255, 255, 255, 0.7);
}

.holiday-fy-selector-sidebar button:hover {
  color: #ffffff;
}

.holiday-sidebar-toggle {
  display: none;
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  font-size: 16px;
  color: #111827;
  cursor: pointer;
  flex: none;
}

.holiday-sidebar-backdrop {
  display: none;
}

/* ---------------------------------- Main area -------------------------------- */

.holiday-main {
  flex: 1;
  min-width: 0;
  padding: 20px;
}

/* ---------------------------------- Header -------------------------------- */

.holiday-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

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

.holiday-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #002060 ;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.holiday-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.holiday-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 2px 0 0 0;
}

.holiday-fy-selector {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border-radius: 999px;
  padding: 8px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 700;
  color: #111827;
}

.holiday-fy-selector button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
  padding: 4px;
}

.holiday-fy-selector button:hover {
  color: #111827;
}

/* The top-bar FY pill is only shown on mobile (sidebar has its own copy) */
.holiday-fy-selector-mobile {
  display: none;
}

/* ------------------------------- Role tabs (legacy, kept for reference) ----- */

.holiday-role-tabs {
  display: inline-flex;
  gap: 4px;
  background: white;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.holiday-role-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}

.holiday-role-tab:hover {
  color: #002060 ;
  background: #f3f4f6;
}

.holiday-role-tab-active {
  background: #002060 ;
  color: white;
}

/* -------------------------------- Content card ----------------------------- */

.holiday-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.holiday-staff-picker-row {
  padding: 16px 24px;
}

.holiday-staff-picker select {
  max-width: 320px;
  font-weight: 600;
}

.holiday-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px 0;
}

.holiday-section-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 16px 0;
}

.holiday-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.holiday-pill {
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.holiday-no-data {
  text-align: center;
  padding: 16px 8px;
  color: #9ca3af;
  font-size: 14px;
}

/* ------------------------------- Stat cards -------------------------------- */

.holiday-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.holiday-simple-stat {
  background: white;
  border-radius: 12px;
  padding: 9px 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.holiday-simple-stat-highlight {
  background: #002060 ;
}

.holiday-simple-stat-highlight .holiday-simple-stat-label,
.holiday-simple-stat-highlight .holiday-simple-stat-sub {
  color: rgba(255, 255, 255, 0.7);
}

.holiday-simple-stat-highlight .holiday-simple-stat-value {
  color: white;
}

.holiday-simple-stat-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.holiday-simple-stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
}

.holiday-simple-stat-sub {
  font-size: 10px;
  color: #9ca3af;
}

/* --------------------------------- Legend ---------------------------------- */

.holiday-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  font-size: 13px;
  color: #374151;
}

.holiday-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.holiday-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  background: white;
  display: inline-block;
}

.holiday-legend-swatch.holiday-day-selected {
  background: #002060 ;
  border-color: #002060 ;
}
.holiday-legend-swatch.holiday-day-mine-approved,
.holiday-legend-swatch.holiday-day-others-approved {
  background: #10b981;
  border-color: #10b981;
}
.holiday-legend-swatch.holiday-day-mine-pending,
.holiday-legend-swatch.holiday-day-others-pending {
  background: #f59e0b;
  border-color: #f59e0b;
}
.holiday-legend-swatch.holiday-day-clash {
  background: #fb923c;
  border-color: #fb923c;
}
.holiday-legend-swatch.holiday-day-bank {
  background: #ede9fe;
  border-color: #c4b5fd;
}
.holiday-legend-swatch.holiday-day-weekend {
  background: #f3f4f6;
  border-color: #e5e7eb;
}

/* ------------------------------- Booking layout ----------------------------- */

.holiday-booking-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.holiday-selection-panel {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.holiday-selection-panel h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.holiday-selection-count {
  font-size: 34px;
  font-weight: 800;
  color: #111827;
  line-height: 1;
}

.holiday-selection-sub {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: #6b7280;
}

.holiday-info-note {
  font-size: 12px;
  color: #6b7280;
  background: #eef2ff;
  border-left: 3px solid #6366f1;
  padding: 10px 12px;
  border-radius: 6px;
  line-height: 1.5;
}

/* ----------------------------- Calendar grid -------------------------------- */

.holiday-calendar-scroll-container {
  max-height: 800px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  -webkit-overflow-scrolling: touch;
}

.holiday-calendar-scroll-container::-webkit-scrollbar {
  width: 8px;
}
.holiday-calendar-scroll-container::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 4px;
}
.holiday-calendar-scroll-container::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 4px;
}

.holiday-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.holiday-month {
  background: #f9fafb;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #e5e7eb;
}

.holiday-month-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 10px 0;
  text-align: center;
}

.holiday-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 6px;
}

.holiday-weekday {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #9ca3af;
}

.holiday-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.holiday-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  background: white;
  border: 1px solid #e5e7eb;
  color: #374151;
  cursor: pointer;
  transition: transform 0.12s;
}

.holiday-day:hover:not(.holiday-day-disabled):not(.holiday-day-empty) {
  transform: scale(1.12);
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.holiday-day-empty {
  background: transparent;
  border: none;
  cursor: default;
}

.holiday-day-weekend {
  background: #f3f4f6;
  color: #d1d5db;
  border-color: #f3f4f6;
}

.holiday-day-bank {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.holiday-day-others-approved {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

.holiday-day-others-pending {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.holiday-day-clash {
  background: #ffedd5;
  color: #c2410c;
  border-color: #fdba74;
  box-shadow: inset 0 0 0 1px #fb923c;
}

.holiday-day-mine-approved {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

.holiday-day-mine-pending {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
}

.holiday-day-selected {
  background: #002060 !important;
  color: white !important;
  border-color: #002060 !important;
}

.holiday-day-disabled {
  cursor: default;
}

.holiday-day-disabled:hover {
  transform: none;
  box-shadow: none;
}

/* --------------------------------- Requests -------------------------------- */

.holiday-request-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.holiday-request-card,
.holiday-review-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 18px;
}

.holiday-request-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.holiday-request-days,
.holiday-request-sub {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.holiday-request-dates {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin: 10px 0 4px 0;
}

.holiday-request-reason {
  font-size: 13px;
  color: #4b5563;
  font-style: italic;
  margin: 6px 0;
}

.holiday-request-hint {
  font-size: 12px;
  color: #9ca3af;
  margin: 4px 0 0 0;
}

.holiday-feedback-box {
  background: #fef2f2;
  color: #991b1b;
  border-left: 3px solid #ef4444;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin: 8px 0;
}

.holiday-clash-warning {
  background: #fff7ed;
  color: #9a3412;
  border-left: 3px solid #fb923c;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin: 8px 0;
}

.holiday-review-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.holiday-btn-approve {
  padding: 9px 18px;
  background: #002060;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.holiday-btn-approve:hover {
  background: #002060 ;
}

.holiday-btn-decline {
  padding: 9px 18px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.holiday-btn-decline:hover {
  background: #dc2626;
}

/* ---------------------------------- Badges ---------------------------------- */

.holiday-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.holiday-badge-approved {
  background: #d1fae5;
  color: #065f46;
}
.holiday-badge-pending {
  background: #fef3c7;
  color: #92400e;
}
.holiday-badge-declined {
  background: #fee2e2;
  color: #991b1b;
}

.holiday-positive {
  color: #10b981;
  font-weight: 700;
}
.holiday-negative {
  color: #ef4444;
  font-weight: 700;
}

/* ---------------------------------- Buttons ---------------------------------- */

.holiday-btn-primary {
  padding: 10px 20px;
  background: #002060 ;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.holiday-btn-primary:hover {
  background: #002060 ;
}
.holiday-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.holiday-btn-secondary {
  padding: 10px 20px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.holiday-btn-secondary:hover {
  background: #e5e7eb;
}

.holiday-btn-small {
  padding: 6px 14px;
  font-size: 12px;
}

.holiday-btn-archive {
  padding: 6px 12px;
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.holiday-btn-archive:hover {
  background: #d97706;
}

.holiday-btn-submit {
  padding: 12px 24px;
  background: #002060;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
.holiday-btn-submit:hover {
  background: #002060 ;
}
.holiday-btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ------------------------------------ Table ----------------------------------- */

.holiday-table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  -webkit-overflow-scrolling: touch;
}

.holiday-table {
  width: 100%;
  border-collapse: collapse;
}

.holiday-table thead {
  background: #f9fafb;
}

.holiday-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}

.holiday-table td {
  padding: 12px 16px;
  font-size: 14px;
  color: #1f2937;
  border-bottom: 1px solid #f3f4f6;
}

.holiday-table tbody tr:hover {
  background: #f9fafb;
}

.holiday-staff-name {
  font-weight: 600;
  color: #111827;
}

.holiday-input-narrow {
  width: 90px;
}

/* --------------------------------- Forms/Modal --------------------------------- */

.holiday-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* background: #002060 ; */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.holiday-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.holiday-modal-small {
  max-width: 400px;
}

.holiday-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.holiday-modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.holiday-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f3f4f6;
  border: none;
  font-size: 22px;
  color: #6b7280;
  cursor: pointer;
}
.holiday-modal-close:hover {
  background: #e5e7eb;
}

.holiday-form {
  padding: 24px;
}

.holiday-form-group {
  margin-bottom: 18px;
}

.holiday-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.holiday-input,
.holiday-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
}

.holiday-input:focus,
.holiday-textarea:focus {
  outline: none;
  border-color: #111827;
}

.holiday-textarea {
  resize: vertical;
}

.holiday-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.holiday-required {
  color: #ef4444;
  margin-left: 2px;
}

/* ----------------------------------- Toasts ------------------------------------- */

.holiday-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.holiday-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  animation: holiday-toast-slide-in 0.3s ease-out;
}

@keyframes holiday-toast-slide-in {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.holiday-toast-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}
.holiday-toast-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}
.holiday-toast-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}
.holiday-toast-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.holiday-toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #002060 ;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
  flex-shrink: 0;
}

.holiday-toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

/* -------------------------------- Confirm dialog --------------------------------- */

.holiday-confirm-dialog {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.holiday-confirm-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.holiday-confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 10px 0;
}

.holiday-confirm-message {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 22px 0;
  line-height: 1.6;
}

.holiday-confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.holiday-btn-cancel {
  padding: 10px 22px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.holiday-btn-cancel:hover {
  background: #e5e7eb;
}

.holiday-btn-confirm {
  padding: 10px 22px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ----------------------------------- Loading -------------------------------------- */

.holiday-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.holiday-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e5e7eb;
  border-top-color: #111827;
  border-radius: 50%;
  animation: holiday-spin 0.8s linear infinite;
}

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

/* ======================================================================
   Responsive
   ===================================================================== */

@media (max-width: 1100px) {
  .holiday-booking-layout {
    grid-template-columns: 1fr;
  }
  .holiday-selection-panel {
    position: static;
  }
}

@media (max-width: 900px) {
  /* Sidebar becomes an off-canvas drawer on smaller screens */
  .holiday-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .holiday-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 18px rgba(0, 0, 0, 0.25);
  }

  .holiday-sidebar-open {
    transform: translateX(0);
  }

  .holiday-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 90;
  }

  .holiday-main {
    padding: 14px;
  }

  .holiday-fy-selector-mobile {
    display: flex;
  }

  .holiday-sidebar-fy {
    display: none;
  }
}

@media (max-width: 768px) {
  .holiday-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .holiday-fy-selector-mobile {
    align-self: stretch;
    justify-content: center;
  }

  .holiday-content {
    padding: 16px;
  }

  .holiday-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .holiday-calendar-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .holiday-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .holiday-review-actions {
    flex-direction: column;
  }

  .holiday-review-actions button {
    width: 100%;
  }

  .holiday-form-actions {
    justify-content: stretch;
  }

  .holiday-form-actions button {
    width: 100%;
  }
}

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

  .holiday-calendar-grid {
    grid-template-columns: 1fr;
  }

  .holiday-day {
    font-size: 12px;
  }

  .holiday-toast-container {
    left: 12px;
    right: 12px;
    top: 12px;
  }

  .holiday-toast {
    min-width: 0;
    max-width: 100%;
  }
}
/* ═══════════ Care worker: profile / identity card ═══════════ */
.holiday-profile-card{display:flex;align-items:center;gap:14px;padding:14px 16px;flex-wrap:wrap}
.holiday-profile-avatar{width:52px;height:52px;border-radius:50%;object-fit:cover;border:2px solid #e2e8f0;flex:none}
.holiday-profile-avatar-fallback{display:flex;align-items:center;justify-content:center;background:#eef2ff;color:#4338ca;font-weight:700;font-size:20px}
.holiday-profile-name{font-weight:700;font-size:16px;color:#0f172a}
.holiday-profile-meta{font-size:12.5px;color:#64748b;margin-top:2px}
.holiday-admin-preview-select{margin-left:auto;max-width:220px}

/* ═══════════ Accordion sections (no more endless scrolling) ═══════════ */
.holiday-accordion{margin:0 0 14px;border:1px solid #e2e8f0;border-radius:12px;background:#fff;overflow:hidden;box-shadow:0 1px 2px rgba(15,23,42,.06)}
.holiday-accordion-header{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;background:#f8fafc;border:0;cursor:pointer;text-align:left;font:inherit;min-height:56px;-webkit-tap-highlight-color:transparent}
.holiday-accordion-header:hover{background:#f1f5f9}
.holiday-accordion-titles{display:flex;flex-direction:column}
.holiday-accordion-title{font-weight:700;color:#1e293b;font-size:15px}
.holiday-accordion-subtitle{font-size:12px;color:#64748b;margin-top:2px}
.holiday-accordion-right{display:flex;align-items:center;gap:10px}
.holiday-accordion-chevron{display:inline-block;transition:transform .2s ease;color:#64748b;font-size:14px}
.holiday-accordion-open .holiday-accordion-chevron{transform:rotate(180deg)}
.holiday-accordion-body{padding:16px;border-top:1px solid #eef2f7}

/* ═══════════ Past days locked ═══════════ */
.holiday-day-past{background:#f1f5f9 !important;color:#b7c3d1 !important;cursor:not-allowed !important}

/* ═══════════ Mobile responsive ═══════════ */
@media (max-width: 820px){
  .holiday-booking-layout{flex-direction:column}
  .holiday-selection-panel{width:100%;max-width:none}
  .holiday-calendar-grid{grid-template-columns:1fr}
  .holiday-stat-grid{grid-template-columns:repeat(2,1fr)}
  .holiday-accordion-body{padding:12px}
  .holiday-profile-card{padding:12px}
  .holiday-admin-preview-select{margin-left:0;width:100%}
}
@media (max-width: 480px){
  .holiday-stat-grid{gap:8px}
  .holiday-simple-stat-value{font-size:12px}
  .holiday-accordion-header{padding:8px}
  .holiday-day{font-size:10px}
}
/* ═══════════ Care worker: profile card ═══════════ */
.holiday-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  flex-wrap: wrap;
}

.holiday-profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  flex: none;
}

.holiday-profile-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 700;
  font-size: 20px;
}

.holiday-profile-info {
  flex: 1;
  min-width: 0;
}

.holiday-profile-name {
  font-weight: 700;
  font-size: 16px;
  color: #0f172a;
}

.holiday-profile-meta {
  font-size: 12.5px;
  color: #64748b;
  margin-top: 2px;
}

.holiday-admin-preview-select {
  max-width: 220px;
  margin-left: auto;
}

/* ═══════════ Accordion sections ═══════════ */
.holiday-accordion {
  margin: 0 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.holiday-accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
}

.holiday-accordion-header:hover {
  background: #f1f5f9;
}

.holiday-accordion-titles {
  display: flex;
  flex-direction: column;
}

.holiday-accordion-title {
  font-weight: 700;
  color: #1e293b;
  font-size: 15px;
}

.holiday-accordion-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.holiday-accordion-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.holiday-accordion-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  color: #64748b;
  font-size: 14px;
}

.holiday-accordion-open .holiday-accordion-chevron {
  transform: rotate(180deg);
}

.holiday-accordion-body {
  padding: 16px;
  border-top: 1px solid #eef2f7;
}

/* ═══════════ Past days locked ═══════════ */
.holiday-day-past {
  background: #f1f5f9 !important;
  color: #b7c3d1 !important;
  cursor: not-allowed !important;
}

/* ═══════════ Mobile responsive ═══════════ */
@media (max-width: 820px) {
  .holiday-booking-layout {
    flex-direction: column;
  }
  
  .holiday-selection-panel {
    width: 100%;
    max-width: none;
  }
  
  .holiday-calendar-grid {
    grid-template-columns: 1fr;
  }
  
  .holiday-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .holiday-accordion-body {
    padding: 12px;
  }
  
  .holiday-profile-card {
    padding: 12px;
  }
  
  .holiday-admin-preview-select {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .holiday-stat-grid {
    gap: 8px;
  }
  
  .holiday-simple-stat-value {
    font-size: 12px;
  }
  
  .holiday-accordion-header {
    padding: 8px;
  }
  
  .holiday-day {
    font-size: 10px;
  }
}
/* ═══════════ Avatars (photo + initials fallback) ═══════════ */
.holiday-avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  background: #fff;
  flex: none;
  display: block;
}
.holiday-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 700;
  border: 2px solid #e2e8f0;
  flex: none;
  letter-spacing: .5px;
}

/* ═══════════ Request card: people row ═══════════ */
.holiday-request-people {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}
.holiday-person {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.holiday-person-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.holiday-person-role {
  font-size: 11px;
  color: #64748b;
}
.holiday-archived-item{border:1px solid #e2e8f0;border-radius:10px;padding:12px;margin-bottom:10px;background:#fbfdff}
.holiday-archived-top{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.holiday-delete-row{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap;align-items:center}
.holiday-delete-row .holiday-input{flex:1;min-width:180px}
.holiday-btn-danger{background:#dc2626;color:#fff;border:none;border-radius:8px;padding:9px 14px;font-weight:600;cursor:pointer}
.holiday-btn-danger:hover{background:#b91c1c}
.holiday-btn-ghost{background:#fff;border:1px solid #cbd5e1;color:#334155;border-radius:8px;padding:9px 14px;cursor:pointer}
@media (max-width:480px){.holiday-delete-row{flex-direction:column;align-items:stretch}}
.holiday-search-row{margin:0 0 12px}
.holiday-search-input{width:100%;max-width:340px}
.holiday-note-box{background:#eef2ff;border:1px solid #c7d2fe;color:#3730a3;border-radius:8px;padding:8px 10px;font-size:12.5px;margin-top:8px}
.holiday-archived-staff-toggle{margin:12px 0 8px}
.holiday-archived-staff-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 10px;border:1px dashed #e2e8f0;border-radius:8px;margin-bottom:8px;background:#fbfdff}
.holiday-badge-declined{background:#fee2e2;color:#b91c1c}
.holiday-simple-stat-warning { background: #fef2f2; }
.holiday-simple-stat-warning .holiday-simple-stat-value { color: #b91c1c; }
.holiday-weekend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  color: #475569;
}
.holiday-weekend-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #4338ca;
}
.holiday-btn-small {
  padding: 6px 10px;
  font-size: 12px;
}
.holiday-accordion-header {
  cursor: pointer;
  user-select: none;
}
.holiday-accordion-header:focus-visible {
  outline: 2px solid #4338ca;
  outline-offset: 2px;
}/* ═══════════ Sidebar dropdown sub-navigation ═══════════ */
.holiday-sidebar-group {
  display: flex;
  flex-direction: column;
}

.holiday-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 12px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  font: inherit;
}

.holiday-sidebar-caret {
  margin-left: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease;
  flex: none;
}

.holiday-sidebar-caret-open {
  transform: rotate(180deg);
}

.holiday-sidebar-sublist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 8px 34px;
}

.holiday-sidebar-sublink {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-left: 2px solid rgba(255, 255, 255, 0.15);
  padding: 8px 10px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  border-radius: 0 6px 6px 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.holiday-sidebar-sublink:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-left-color: rgba(255, 255, 255, 0.5);
}

.holiday-sidebar-sublink:active {
  background: rgba(255, 255, 255, 0.14);
}

@media (max-width: 900px) {
  .holiday-sidebar-sublist {
    padding-left: 28px;
  }
}/* ═══════════ Sidebar dropdown sub-navigation ═══════════ */
.holiday-sidebar-group {
  display: flex;
  flex-direction: column;
}

.holiday-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 12px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  font: inherit;
}

.holiday-sidebar-caret {
  margin-left: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease;
  flex: none;
}

.holiday-sidebar-caret-open {
  transform: rotate(180deg);
}

.holiday-sidebar-sublist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 8px 34px;
}

.holiday-sidebar-sublink {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-left: 2px solid rgba(255, 255, 255, 0.15);
  padding: 8px 10px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  border-radius: 0 6px 6px 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.holiday-sidebar-sublink:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-left-color: rgba(255, 255, 255, 0.5);
}

.holiday-sidebar-sublink-active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-left-color: #ffffff;
  font-weight: 700;
}

/* ═══════════ Isolated-section breadcrumb bar ═══════════ */
.holiday-section-jumpbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}

.holiday-jumpbar-sep {
  color: #818cf8;
  margin: 0 2px;
}

@media (max-width: 900px) {
  .holiday-sidebar-sublist {
    padding-left: 28px;
  }
}/* ═══════════ FY selector inside the isolated-section jumpbar ═══════════ */
.holiday-jumpbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.holiday-fy-selector-jumpbar {
  background: #ffffff;
  padding: 6px 12px;
  gap: 10px;
  font-size: 13px;
  box-shadow: none;
  border: 1px solid #c7d2fe;
}/* Staff Availability System - All classes prefixed with "unavailability-" */

.unavailability-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.unavailability-header {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.unavailability-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 4px 0;
}

.unavailability-subtitle {
  font-size: 14px;
  color: #718096;
  margin: 0;
}

.unavailability-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.unavailability-control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.unavailability-label {
  font-size: 12px;
  font-weight: 600;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.unavailability-input,
.unavailability-select {
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #2d3748;
  background: white;
  transition: all 0.2s;
  min-width: 120px;
}

.unavailability-input:focus,
.unavailability-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.unavailability-btn-add {
  padding: 2px 6px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: auto;
}

.unavailability-btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.unavailability-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 1px;
}

.unavailability-stat-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.unavailability-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.unavailability-stat-content {
  flex: 1;
}

.unavailability-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #1a202c;
  margin: 0;
}

.unavailability-stat-label {
  font-size: 13px;
  color: #718096;
  margin: 0;
}

.unavailability-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  padding: 4px;
}

.unavailability-calendar-grid::-webkit-scrollbar {
  width: 8px;
}

.unavailability-calendar-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.unavailability-calendar-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.unavailability-calendar-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.unavailability-month-card {
  background: white;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.unavailability-month-header {
  font-size: 16px;
  font-weight: 700;
  color: #1a202c;
  text-align: center;
  padding: 8px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
}

.unavailability-month-header.current {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.unavailability-calendar-table {
  width: 100%;
  border-collapse: collapse;
}

.unavailability-calendar-table th {
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #4a5568;
  text-align: center;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
}

.unavailability-calendar-table td {
  padding: 6px 4px;
  text-align: center;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #2d3748;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.unavailability-calendar-table td:hover {
  background: #edf2f7;
}

.unavailability-calendar-table td.empty {
  background: #f7fafc;
  cursor: default;
}

.unavailability-calendar-table td.empty:hover {
  background: #f7fafc;
}

.unavailability-calendar-table td.unavailable {
  background: linear-gradient(135deg, #81fbb8 0%, #28c76f 100%);
  color: white;
  font-weight: 600;
}

.unavailability-calendar-table td.unavailable:hover {
  background: linear-gradient(135deg, #28c76f 0%, #1e9e57 100%);
}

.unavailability-calendar-table td.today {
  border: 2px solid #667eea;
  font-weight: 700;
}

.unavailability-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.unavailability-modal {
  background: white;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: unavailability-modal-slide-in 0.3s ease-out;
}

@keyframes unavailability-modal-slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.unavailability-modal-header {
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.unavailability-modal-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.unavailability-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.unavailability-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.unavailability-modal-body {
  padding: 20px;
}

.unavailability-form-group {
  margin-bottom: 16px;
}

.unavailability-form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 6px;
}

.unavailability-form-input,
.unavailability-form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #2d3748;
  transition: all 0.2s;
  box-sizing: border-box;
}

.unavailability-form-input:focus,
.unavailability-form-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.unavailability-form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.unavailability-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.unavailability-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 20px;
  border-top: 1px solid #e2e8f0;
}

.unavailability-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.unavailability-btn-cancel {
  background: #e2e8f0;
  color: #4a5568;
}

.unavailability-btn-cancel:hover {
  background: #cbd5e0;
}

.unavailability-btn-save {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.unavailability-btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.unavailability-btn-delete {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.unavailability-btn-delete:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.unavailability-list {
  max-height: 300px;
  overflow-y: auto;
  margin-top: 16px;
}

.unavailability-list-item {
  background: #f7fafc;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.unavailability-list-date {
  font-weight: 600;
  color: #2d3748;
  font-size: 14px;
}

.unavailability-list-time {
  font-size: 12px;
  color: #718096;
  margin-top: 2px;
}

.unavailability-list-notes {
  font-size: 12px;
  color: #4a5568;
  margin-top: 4px;
}

.unavailability-btn-delete-small {
  background: #f56565;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.unavailability-btn-delete-small:hover {
  background: #e53e3e;
}

/* Toast Notifications */
.unavailability-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.unavailability-toast {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: unavailability-toast-slide-in 0.3s ease-out;
}

@keyframes unavailability-toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.unavailability-toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.unavailability-toast-success .unavailability-toast-icon {
  background: linear-gradient(135deg, #81fbb8 0%, #28c76f 100%);
  color: white;
}

.unavailability-toast-error .unavailability-toast-icon {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.unavailability-toast-warning .unavailability-toast-icon {
  background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
  color: white;
}

.unavailability-toast-message {
  flex: 1;
  font-size: 14px;
  color: #2d3748;
  font-weight: 500;
}

.unavailability-toast-close {
  background: none;
  border: none;
  color: #a0aec0;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.unavailability-toast-close:hover {
  background: #edf2f7;
  color: #4a5568;
}

.unavailability-loading {
  text-align: center;
  padding: 40px;
  color: white;
  font-size: 16px;
}

.unavailability-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: unavailability-spin 0.8s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .unavailability-container {
    padding: 12px;
  }

  .unavailability-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .unavailability-control-group {
    width: 100%;
  }

  .unavailability-input,
  .unavailability-select {
    width: 100%;
  }

  .unavailability-stats {
    grid-template-columns: 1fr;
  }

  .unavailability-calendar-grid {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 400px);
  }

  .unavailability-form-row {
    grid-template-columns: 1fr;
  }

  .unavailability-toast {
    min-width: 280px;
  }

  .unavailability-toast-container {
    left: 12px;
    right: 12px;
  }
}/* Training.css - Complete Professional Version */
/* ═══════════════════════════════════════════════════
CSS VARIABLES
═══════════════════════════════════════════════════ */
.training-root {
  --training-pink: #e91e8c;
  --training-pink-d: #c0166f;
  --training-pink-l: #f06ab3;
  --training-pink-bg: #fce4f3;
  --training-pink-border: #f4b8e0;
  --training-nav: #2b1850;
  --training-white: #fff;
  --training-page: #f0f2f5;
  --training-border: #e0e0e0;
  --training-text: #1a1a1a;
  --training-muted: #6b7280;
  --training-light: #f9f9fb;
  --training-green: #059669;
  --training-green-bg: #d1fae5;
  --training-green-border: #6ee7b7;
  --training-blue: #2563eb;
  --training-blue-bg: #dbeafe;
  --training-amber: #d97706;
  --training-amber-bg: #fef3c7;
  --training-red: #dc2626;
  --training-red-bg: #fee2e2;
  --training-purple: #7c3aed;
  --training-purple-bg: #ede9fe;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--training-page);
  font-size: 13px;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ═══════════════════════════════════════════════════
TOP NAVIGATION
═══════════════════════════════════════════════════ */
.training-topnav {
  background: var(--training-nav);
  display: flex;
  align-items: stretch;
  height: 44px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.training-brand {
  background: var(--training-white);
  display: flex;
  align-items: center;
  padding: 0 12px;
  min-width: 150px;
}

.training-logo {
  display: flex;
  align-items: center;
  gap: 7px;
}

.training-logo-pink {
  width: 28px;
  height: 28px;
  background: var(--training-pink);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}

.training-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.training-logo-text span:first-child {
  font-size: 10px;
  font-weight: 700;
  color: var(--training-pink);
}

.training-logo-sub {
  font-size: 8px !important;
  color: #999 !important;
  font-weight: 400 !important;
}

.training-nav-pills {
  display: flex;
  align-items: center;
  flex: 1;
  padding: 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.training-nav-pills::-webkit-scrollbar {
  display: none;
}

.training-nav-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  height: 100%;
  font-size: 9px;
  color: #c4a8d8;
  cursor: pointer;
  border: none;
  background: none;
  gap: 1px;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s;
}

.training-nav-pill.active {
  background: var(--training-pink);
  color: var(--training-white);
}

.training-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  margin-left: auto;
  font-size: 11px;
  color: #c4a8d8;
}

.training-nav-time {
  color: var(--training-white);
  font-weight: 700;
}

.training-av {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--training-white);
  font-weight: 700;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
USER TOGGLE
═══════════════════════════════════════════════════ */
.training-user-toggle {
  display: flex;
  align-items: center;
  background: var(--training-white);
  border: 1px solid var(--training-border);
  border-radius: 6px;
  overflow: hidden;
  margin: 12px 14px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.training-toggle-btn {
  flex: 1;
  padding: 10px 8px;
  font-size: 11px;
  border: none;
  background: none;
  color: var(--training-muted);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  transition: all 0.3s;
}

.training-toggle-btn.active {
  background: var(--training-pink);
  color: var(--training-white);
}

/* ═══════════════════════════════════════════════════
SUB-NAVIGATION
═══════════════════════════════════════════════════ */
.training-subnav {
  position: sticky;
  top: 0;
  background: var(--training-white);
  border-bottom: 1px solid var(--training-border);
  display: flex;
  padding: 0 14px;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  z-index: 100;
}

.training-subnav::-webkit-scrollbar {
  display: none;
}

.training-subnav-item {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--training-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  background: none;
  border: none;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.training-subnav-item:hover {
  color: var(--training-pink);
  background: var(--training-pink-bg);
}

.training-subnav-item.active {
  color: var(--training-pink);
  border-bottom-color: var(--training-pink);
  background: var(--training-pink-bg);
}

.training-subnav-icon {
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════
CONTENT AREA
═══════════════════════════════════════════════════ */
.training-content {
  padding: 10px;
  padding-bottom: 100px;
  max-width: 100%;
  margin: 0 auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════
PAGE HEADER
═══════════════════════════════════════════════════ */
.training-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.training-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--training-text);
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.training-page-sub {
  font-size: 13px;
  color: var(--training-muted);
  margin: 0;
  line-height: 1.5;
}

.training-email-link {
  color: var(--training-pink);
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
}

.training-progress-right {
  text-align: right;
  flex-shrink: 0;
}

.training-progress-label {
  font-size: 11px;
  color: var(--training-muted);
  font-weight: 600;
}

.training-progress-pct {
  font-size: 24px;
  font-weight: 700;
  color: var(--training-pink);
}

/* ═══════════════════════════════════════════════════
STAT CARDS
═══════════════════════════════════════════════════ */
.training-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.training-stats-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.training-stat-card {
  background: var(--training-white);
  border: 1px solid var(--training-border);
  border-left: 4px solid var(--training-pink);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: row;
}

.training-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.training-stat-card-green {
  border-left-color: var(--training-green) !important;
}

.training-stat-card-amber {
  border-left-color: var(--training-amber) !important;
}

.training-stat-card-blue {
  border-left-color: var(--training-blue) !important;
}

.training-stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--training-pink);
  line-height: 1;
  margin-bottom: 4px;
}

.training-stat-green {
  color: var(--training-green) !important;
}

.training-stat-amber {
  color: var(--training-amber) !important;
}

.training-stat-blue {
  color: var(--training-blue) !important;
}

.training-stat-pink {
  color: var(--training-pink) !important;
}

.training-stat-label {
  font-size: 11px;
  color: var(--training-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════
NOTIFICATIONS
═══════════════════════════════════════════════════ */
.training-notif {
  background: var(--training-pink-bg);
  border: 1px solid var(--training-pink-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--training-pink-d);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.training-notif-error {
  background: var(--training-red-bg);
  border-color: #fecaca;
  color: #991b1b;
}

.training-anon {
  background: var(--training-green-bg);
  border: 1px solid var(--training-green-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════
CARDS
═══════════════════════════════════════════════════ */
.training-card {
  background: var(--training-white);
  border: 1px solid var(--training-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.training-card-strip {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: var(--training-white);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  margin: -16px -16px 16px;
  border-radius: 8px 8px 0 0;
}

.training-card-strip-green {
  background: var(--training-green) !important;
}

.training-card-strip-purple {
  background: var(--training-purple) !important;
}

/* ═══════════════════════════════════════════════════
FORM ELEMENTS
═══════════════════════════════════════════════════ */
.training-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--training-muted);
  display: block;
  margin-bottom: 6px;
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.training-label:first-of-type {
  margin-top: 0;
}

.training-select,
.training-input,
.training-textarea {
  width: 100%;
  background: var(--training-white);
  border: 1px solid var(--training-border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--training-text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s;
}

.training-select:focus,
.training-input:focus,
.training-textarea:focus {
  border-color: var(--training-pink);
  box-shadow: 0 0 0 3px var(--training-pink-bg);
}

.training-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.training-form-row {
  display: flex;
  gap: 12px;
}

.training-form-row > div {
  flex: 1;
}

/* ═══════════════════════════════════════════════════
RATING BUTTONS
═══════════════════════════════════════════════════ */
.training-rating-group {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.training-rating-btn {
  flex: 1;
  min-width: 80px;
  padding: 10px 8px;
  border: 2px solid var(--training-border);
  border-radius: 6px;
  background: var(--training-white);
  font-size: 12px;
  font-weight: 600;
  color: var(--training-muted);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: all 0.2s;
}

.training-rating-btn:hover {
  border-color: var(--training-pink);
  background: var(--training-pink-bg);
}

.training-rating-btn.active {
  border-color: var(--training-pink);
  background: var(--training-pink);
  color: var(--training-white);
  transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════
BUTTONS
═══════════════════════════════════════════════════ */
.training-btn {
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.training-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.training-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.training-btn-pink {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: var(--training-white);
}

.training-btn-outline {
  background: var(--training-white);
  border: 2px solid var(--training-border);
  color: var(--training-muted);
}

.training-btn-green {
  background: var(--training-green);
  color: var(--training-white);
}

.training-btn-red {
  background: var(--training-red);
  color: var(--training-white);
}

.training-btn-blue {
  background: var(--training-blue);
  color: var(--training-white);
}

.training-btn-sm {
  padding: 8px 14px;
  font-size: 12px;
}

.training-btn-xs {
  padding: 6px 10px;
  font-size: 11px;
}

.training-btn-block {
  width: 100%;
}

.training-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 16px;
}

.training-form-actions .training-btn-block {
  flex: 1;
}

.training-thankyou {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--training-text);
  padding: 10px 0;
}

/* ═══════════════════════════════════════════════════
TRAINING CARDS (Staff Dashboard)
═══════════════════════════════════════════════════ */
.training-t-card {
  background: var(--training-white);
  border: 1px solid var(--training-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.training-t-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.training-t-card-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--training-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.training-t-card-info {
  flex: 1;
  min-width: 0;
}

.training-t-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--training-text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.training-info-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.training-info-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--training-light);
  color: var(--training-muted);
  border: 1px solid var(--training-border);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.training-t-card-body {
  padding: 14px 16px;
  background: var(--training-light);
  display: block;
}

.training-t-card-footer {
  padding: 12px 16px;
  background: var(--training-white);
  border-top: 1px solid var(--training-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.training-enrolled-date {
  font-size: 11px;
  color: var(--training-muted);
  font-weight: 500;
}

.training-check-text {
  font-size: 11px;
  color: var(--training-green);
  margin-top: 6px;
  font-weight: 600;
  display: block;
  line-height: 1.4;
}

.training-check-green {
  color: var(--training-green) !important;
}

.training-check-blue {
  color: var(--training-blue) !important;
}

.training-course-desc {
  font-size: 12px;
  color: var(--training-muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════
PROGRESS BAR
═══════════════════════════════════════════════════ */
.training-progress-bar {
  height: 8px;
  background: #f0e0f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
  display: block;
}

.training-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--training-pink);
  transition: width 0.5s ease;
}

/* ═══════════════════════════════════════════════════
BADGES
═══════════════════════════════════════════════════ */
.training-badge {
  display: inline-block;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.training-badge-green {
  background: var(--training-green-bg);
  color: #065f46;
}

.training-badge-blue {
  background: var(--training-blue-bg);
  color: #1e40af;
}

.training-badge-amber {
  background: var(--training-amber-bg);
  color: #92400e;
}

.training-badge-red {
  background: var(--training-red-bg);
  color: #991b1b;
}

.training-badge-purple {
  background: var(--training-purple-bg);
  color: #5b21b6;
}

.training-badge-grey {
  background: #f3f4f6;
  color: #374151;
}

.training-badge-pink {
  background: var(--training-pink-bg);
  color: var(--training-pink-d);
}

/* ═══════════════════════════════════════════════════
TABLES
═══════════════════════════════════════════════════ */
.training-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  border-radius: 8px;
  border: 1px solid var(--training-border);
}

.training-table-wrap::-webkit-scrollbar {
  height: 6px;
}

.training-table-wrap::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.training-table-wrap::-webkit-scrollbar-thumb {
  background: var(--training-pink-l);
  border-radius: 3px;
}

.training-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 700px;
}

.training-table th {
  text-align: left;
  padding: 12px;
  color: var(--training-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--training-pink-bg);
  background: #fafafa;
  white-space: nowrap;
}

.training-table td {
  padding: 12px;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
}

.training-table tr:last-child td {
  border-bottom: none;
}

.training-table tr:hover td {
  background: #fdf0f8;
}

.training-ifl {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.training-mini-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--training-white);
  flex-shrink: 0;
}

.training-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.training-table-info {
  font-size: 12px;
  color: var(--training-muted);
}

.training-filters-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.training-filters-row .training-input,
.training-filters-row .training-select {
  flex: 1;
  min-width: 150px;
  font-size: 13px;
}

.training-staff-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.training-actions-col {
  width: 1%;
  white-space: nowrap;
}

.training-actions-cell {
  display: flex;
  gap: 6px;
}

.training-mobile-actions {
  display: flex;
  gap: 4px;
  /* flex-wrap: wrap; */
  flex-direction: row;
}

.training-hide-mobile {
  display: table-cell;
}

.training-hide-tablet {
  display: table-cell;
}

/* ═══════════════════════════════════════════════════
BAR CHARTS
═══════════════════════════════════════════════════ */
.training-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.training-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.training-bar-label {
  font-size: 12px;
  color: var(--training-muted);
  font-weight: 600;
  width: 100px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.training-bar-track {
  flex: 1;
  height: 12px;
  background: #f0e0f0;
  border-radius: 6px;
  overflow: hidden;
}

.training-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.training-bar-fill-pink {
  background: var(--training-pink) !important;
}

.training-bar-pct {
  font-size: 12px;
  color: var(--training-muted);
  width: 35px;
  text-align: right;
  font-weight: 700;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
MODALS
═══════════════════════════════════════════════════ */
.training-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  backdrop-filter: blur(4px);
}

.training-modal {
  background: var(--training-white);
  border-radius: 12px;
  width: 600px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overscroll-behavior: contain;
}

.training-modal-sm {
  width: 450px;
  max-height: 95vh;
}

.training-modal-head {
  background: var(--training-pink);
  color: var(--training-white);
  padding: 16px 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1;
}

.training-modal-head-red {
  background: var(--training-red) !important;
}

.training-modal-title {
  font-weight: 700;
  font-size: 16px;
}

.training-modal-close {
  background: none;
  border: none;
  color: var(--training-white);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
}

.training-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.training-modal-body {
  padding: 20px;
  max-height: calc(90vh - 140px);
  overflow-y: auto;
}

.training-modal-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--training-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--training-white);
  border-radius: 0 0 12px 12px;
}

.training-modal-section {
  margin-bottom: 12px;
}

.training-modal-label {
  font-size: 11px;
  color: var(--training-muted);
  text-transform: uppercase;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.training-modal-text {
  font-size: 14px;
  color: var(--training-text);
  margin: 0;
  line-height: 1.6;
}

.training-delete-text {
  font-size: 14px;
  color: var(--training-text);
  margin-bottom: 10px;
  line-height: 1.5;
}

.training-delete-sub {
  font-size: 12px;
  color: var(--training-muted);
}

.training-divider {
  height: 1px;
  background: var(--training-border);
  margin: 16px 0;
}

.training-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.training-pill {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 2px solid var(--training-border);
  color: var(--training-muted);
  cursor: pointer;
  font-weight: 600;
  background: var(--training-white);
  transition: all 0.2s;
  font-family: inherit;
}

.training-pill:hover {
  border-color: var(--training-pink);
  color: var(--training-pink);
}

.training-pill.active {
  border-color: var(--training-pink);
  color: var(--training-pink);
  background: var(--training-pink-bg);
}

.training-staff-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--training-border);
  border-radius: 8px;
  margin-top: 10px;
}

.training-staff-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--training-border);
  cursor: pointer;
  transition: all 0.2s;
}

.training-staff-item:last-child {
  border-bottom: none;
}

.training-staff-item:hover {
  background: var(--training-pink-bg);
}

.training-staff-item.selected {
  background: var(--training-pink-bg);
  border-left: 3px solid var(--training-pink);
}

.training-staff-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.training-staff-item-name {
  flex: 1;
  font-weight: 500;
}

.training-selection-count {
  margin-top: 12px;
  padding: 10px;
  background: var(--training-pink-bg);
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  color: var(--training-pink-d);
}

.training-loading-center {
  text-align: center;
  padding: 20px;
  color: var(--training-muted);
}

/* ═══════════════════════════════════════════════════
STAFF AVATAR (FIXED)
══════════════════════════════════════════════════ */
.training-staff-avatar {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #eee; /* Placeholder background */
}

.training-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.training-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
}

.training-staff-info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--training-border);
}

/* ═══════════════════════════════════════════════════
SCROLL TO TOP BUTTON
═══════════════════════════════════════════════════ */
.training-scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--training-pink);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(233, 30, 140, 0.4);
  transition: all 0.3s;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
}

.training-scroll-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.training-scroll-top:hover {
  background: var(--training-pink-d);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 24px rgba(233, 30, 140, 0.5);
}

/* ═══════════════════════════════════════════════════
BODY SCROLL LOCK
═══════════════════════════════════════════════════ */
body.training-modal-open {
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════
SEARCH BOX
═══════════════════════════════════════════════════ */
.training-search-box {
  position: relative;
  margin-bottom: 16px;
}

.training-search-input {
  width: 100%;
  padding: 12px 45px 12px 16px;
  border: 2px solid var(--training-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s;
}

.training-search-input:focus {
  border-color: var(--training-pink);
  box-shadow: 0 0 0 4px var(--training-pink-bg);
}

.training-search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--training-muted);
  pointer-events: none;
}

.training-search-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  color: var(--training-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.training-search-clear:hover {
  opacity: 1;
}

.training-search-count {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--training-muted);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════
PAGINATION
═══════════════════════════════════════════════════ */
.training-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--training-border);
  flex-wrap: wrap;
  gap: 12px;
}

.training-pagination-info {
  font-size: 13px;
  color: var(--training-muted);
  font-weight: 500;
}

.training-pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.training-pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 2px solid var(--training-border);
  background: var(--training-white);
  color: var(--training-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.training-pagination-btn:hover:not(:disabled) {
  background: var(--training-pink-bg);
  border-color: var(--training-pink);
  color: var(--training-pink);
  transform: translateY(-1px);
}

.training-pagination-btn.active {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: var(--training-white);
  border-color: var(--training-pink);
}

.training-pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.training-pagination-ellipsis {
  padding: 0 8px;
  color: var(--training-muted);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════
SPINNER
═══════════════════════════════════════════════════ */
.training-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--training-pink-bg);
  border-top-color: var(--training-pink);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════════════
RESPONSIVE — TABLET
═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .training-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .training-charts-row {
    grid-template-columns: 1fr;
  }

  .training-hide-tablet {
    display: none;
  }
}

@media (max-width: 768px) {
  .training-content {
    padding: 12px;
    margin-bottom: 65px;
  }

  .training-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .training-page-title {
    font-size: 18px;
  }

  .training-form-row {
    flex-direction: column;
    gap: 0;
  }

  .training-rating-group {
    flex-direction: column;
  }

  .training-rating-btn {
    min-width: auto;
    width: 100%;
  }

  .training-filters-row {
    flex-direction: column;
  }

  .training-filters-row .training-input,
  .training-filters-row .training-select {
    min-width: auto;
    width: 100%;
  }

  .training-modal {
    max-height: 95vh;
    width: 100%;
    margin: 10px;
  }

  .training-modal-body {
    padding: 16px;
    max-height: calc(95vh - 140px);
  }

  .training-bar-label {
    width: 80px;
    font-size: 11px;
  }

  .training-subnav-item {
    padding: 10px 12px;
    font-size: 11px;
  }

  .training-nav-pills {
    display: none;
  }

  .training-brand {
    min-width: 120px;
  }

  .training-logo-text span:first-child {
    font-size: 9px;
  }

  .training-user-toggle {
    margin: 8px 10px 0;
  }

  .training-toggle-btn {
    padding: 8px 4px;
    font-size: 10px;
  }
   .training-rows-per-page{
    margin-bottom: 10px;
    align-items: center;
    justify-content: center;
    gap:10px;
    display: flex;
  }
}

/* ═══════════════════════════════════════════════════
RESPONSIVE — MOBILE (OPTIMIZED FOR SPACE)
═══════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .training-stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .training-stat-card {
    padding: 12px;
  }

  .training-stat-num {
    font-size: 22px;
  }

  .training-stat-label {
    font-size: 10px;
  }

  .training-card {
    padding: 12px;
  }

  .training-card-strip {
    margin: -12px -12px 12px;
    padding: 6px 12px;
    font-size: 10px;
  }

  /* MOBILE CARD LAYOUT - COMPACT GRID */
  .training-t-card-head {
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }

  .training-t-card-name {
    font-size: 14px;
    margin-bottom: 6px;
  }

  /* FIX: Use Grid to utilize unused space side-by-side */
  .training-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 columns side by side */
    gap: 6px;
    width: 100%;
  }
  
  .training-info-row > * {
    width: 100%;
    justify-content: flex-start;
  }

  .training-info-chip {
    width: 100%;
    justify-content: flex-start;
    font-size: 11px;
    padding: 6px 8px;
  }

  .training-t-card-body {
    padding: 10px;
  }

  .training-t-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .training-t-card-footer .training-btn {
    width: 100%;
    justify-content: center;
  }

  .training-enrolled-date {
    text-align: center;
    order: -1;
    margin-bottom: 6px;
  }

  .training-form-actions {
    flex-direction: column;
  }

  .training-table th,
  .training-table td {
    padding: 10px;
    font-size: 12px;
  }

  .training-hide-mobile {
    display: none;
  }

  .training-modal-foot {
    padding: 12px 16px;
    flex-direction: column;
  }

  .training-modal-foot .training-btn {
    width: 100%;
  }

  .training-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .training-pagination-info {
    text-align: center;
  }

  .training-pagination-controls {
    justify-content: center;
    flex-wrap: wrap;
  }

  .training-pagination-btn {
    min-width: 20px;
    height: 20px;
    padding: 0 14px;
  }

  .training-scroll-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }
   .training-rows-per-page{
    margin-bottom: 10px;
    align-items: center;
    justify-content: center;
    gap:10px;
    display: flex;
  }
}

/* ═══════════════════════════════════════════════════
RESPONSIVE — VERY SMALL SCREENS
═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .training-content {
    padding: 10px;
    margin-bottom: 65px;
  }

  .training-stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .training-stat-card {
    padding: 10px;
  }

  .training-stat-num {
    font-size: 20px;
  }

  .training-stat-label {
    font-size: 9px;
  }

  .training-page-title {
    font-size: 16px;
  }

  .training-page-sub {
    font-size: 12px;
  }

  .training-bar-row {
    gap: 6px;
  }

  .training-bar-label {
    width: 60px;
    font-size: 10px;
  }

  .training-bar-pct {
    width: 30px;
    font-size: 11px;
  }

  .training-btn {
    padding: 8px 14px;
    font-size: 12px;
  }

  .training-btn-sm {
    padding: 6px 10px;
    font-size: 11px;
  }

  .training-modal-sm {
    width: 100%;
    margin: 10px;
  }

  .training-search-input {
    padding: 10px 40px 10px 14px;
    font-size: 13px;
  }
  .training-rows-per-page{
    margin-bottom: 10px;
    align-items: center;
    justify-content: center;
    gap:10px;
    display: flex;
  }
}

/* ═══════════════════════════════════════════════════
PRINT STYLES
═══════════════════════════════════════════════════ */
@media print {
  .training-topnav,
  .training-subnav,
  .training-user-toggle,
  .training-scroll-top,
  .training-btn,
  .training-modal-overlay {
    display: none !important;
  }

  .training-content {
    padding: 0;
    max-width: 100%;
    margin-bottom: 50px;
  }

  .training-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}/* Toast.css */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
    min-width: 300px;
    pointer-events: all;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    background: #059669;
}

.toast-error {
    background: #dc2626;
}

.toast-info {
    background: #2563eb;
}

.toast-warning {
    background: #d97706;
}

.toast-icon {
    font-size: 18px;
    font-weight: 700;
}

.toast-message {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    margin-left: 8px;
}

.toast-close:hover {
    opacity: 1;
}

@media (max-width: 480px) {
    .toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .toast {
        min-width: auto;
    }
}/* ════════════════ JOB SHADOW FORM STYLES ════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #9c27b0;
  --primary-dark: #7b1fa2;
  --primary-light: #e91e8c;
  --secondary: #c2185b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 8px;
  --radius-lg: 12px;
}
/* ════════════════ DEBUG PANEL STYLES ════════════════ */
/* ════════════════ NOTIFICATIONS ════════════════ */
.shadowing-notifications {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.shadowing-notification {
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: slideInRight 0.3s ease-out;
  border-left: 4px solid;
  min-width: 300px;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.shadowing-notification-success {
  border-left-color: var(--success, #10b981);
}

.shadowing-notification-error {
  border-left-color: var(--danger, #ef4444);
}

.shadowing-notification-warning {
  border-left-color: var(--warning, #f59e0b);
}

.shadowing-notification-info {
  border-left-color: var(--primary, #d326c7);
}

.shadowing-notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.shadowing-notification-content i {
  font-size: 20px;
}

.shadowing-notification-success .shadowing-notification-content i {
  color: var(--success, #10b981);
}

.shadowing-notification-error .shadowing-notification-content i {
  color: var(--danger, #ef4444);
}

.shadowing-notification-warning .shadowing-notification-content i {
  color: var(--warning, #f59e0b);
}

.shadowing-notification-info .shadowing-notification-content i {
  color: var(--primary, #d326c7);
}

.shadowing-notification-close {
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  transition: color 0.2s;
}

.shadowing-notification-close:hover {
  color: var(--gray-700);
}

/* ════════════════ CONFIRMATION MODAL ════════════════ */
.shadowing-confirm-modal {
  background: white;
  border-radius: 16px;
  padding: 24px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.shadowing-confirm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.shadowing-confirm-header i {
  font-size: 32px;
  color: var(--warning, #f59e0b);
}

.shadowing-confirm-header h3 {
  margin: 0;
  font-size: 20px;
  color: var(--gray-900);
}

.shadowing-confirm-body {
  margin-bottom: 24px;
}

.shadowing-confirm-body p {
  margin: 0;
  color: var(--gray-600);
  line-height: 1.6;
}

.shadowing-confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.shadowing-btn-danger {
  background: var(--danger, #ef4444);
  color: white;
}

.shadowing-btn-danger:hover {
  background: #dc2626;
}

/* ════════════════ VIEW MODAL ENHANCEMENTS ════════════════ */
.shadowing-view-modal {
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

.shadowing-evaluation-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shadowing-eval-item {
  padding: 12px;
  background: var(--gray-50);
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.shadowing-eval-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gray-800);
  font-size: 14px;
}

/* Make modal scrollable */
.shadowing-modal-body {
  max-height: calc(90vh - 140px);
  overflow-y: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .shadowing-notifications {
    left: 20px;
    right: 20px;
    max-width: none;
  }
  
  .shadowing-notification {
    min-width: auto;
  }
  
  .shadowing-view-modal {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    height: 100vh;
    max-height: 100vh;
  }
  
  .shadowing-modal-body {
    max-height: calc(100vh - 140px);
  }
}
.shadowing-debug-panel {
  margin-bottom: 20px;
  border: 2px solid #fbbf24;
  border-radius: 8px;
  overflow: hidden;
  background: #fffbeb;
}

.shadowing-debug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fbbf24;
  color: #78350f;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.shadowing-debug-header:hover {
  background: #f59e0b;
}

.shadowing-debug-content {
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.shadowing-debug-content pre {
  background: #1f2937;
  color: #10b981;
  padding: 16px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Nav badge */
.shadowing-nav-badge {
  background: var(--primary);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
  font-weight: 600;
}

/* Info toast type */
.shadowing-toast.info {
  background: #3b82f6;
  color: white;
}
.shadowing-container {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--gray-100);
  min-height: 100vh;
  color: var(--gray-800);
  width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── SUB NAVIGATION ── */
.shadowing-sub-nav {
  background: #fff;
  border-bottom: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 10px;
  overflow-x: auto;
  flex-shrink: 0;
}

.shadowing-sub-nav-item {
  padding: 7px 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
  font-weight: 500;
}

.shadowing-sub-nav-item:hover {
  color: var(--primary);
  background: var(--gray-50);
}

.shadowing-sub-nav-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
  background: var(--gray-50);
}

.shadowing-sub-nav-item i {
  font-size: 14px;
}

/* ── PAGE CONTENT ── */
.shadowing-page-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  margin-bottom: 100px;
}

.shadowing-page-content {
  padding: 5px;
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.shadowing-page-content::-webkit-scrollbar {
  width: 8px;
}

.shadowing-page-content::-webkit-scrollbar-track {
  background: var(--gray-200);
  border-radius: 4px;
}

/* ── HEADER ─ */
.shadowing-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  flex-wrap: wrap;
  gap: 16px;
}

.shadowing-page-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 12px;
}

.shadowing-page-title i {
  color: var(--primary);
  font-size: 20px;
}

.shadowing-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── BUTTONS ── */
.shadowing-btn {
  padding: 5px 10px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 20px;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.shadowing-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.shadowing-btn:active {
  transform: translateY(0);
}

.shadowing-btn-purple {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
}

.shadowing-btn-green {
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: #fff;
}

.shadowing-btn-gray {
  background: var(--gray-200);
  color: var(--gray-800);
}

.shadowing-btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff;
}

.shadowing-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.shadowing-btn-lg {
  padding: 12px 28px;
  font-size: 15px;
}

/* ── PROGRESS STEPS ── */
.shadowing-progress-bar {
  display: flex;
  flex-direction: row;
  gap: 0;
  margin-bottom: 5px;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.shadowing-step {
  flex: 1;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  border-right: 1px solid var(--gray-200);
  cursor: pointer;
  transition: all 0.3s;
  background: #fff;
  min-width: 150px;
}

.shadowing-step:last-child {
  border-right: none;
}

.shadowing-step:hover {
  background: var(--gray-50);
}

.shadowing-step .shadowing-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.3s;
}

.shadowing-step.active {
  background: linear-gradient(135deg, #f3e5f5, #fce4ec);
  color: var(--primary);
}

.shadowing-step.active .shadowing-step-num {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(156, 39, 176, 0.2);
}

.shadowing-step.done {
  color: var(--success);
}

.shadowing-step.done .shadowing-step-num {
  background: var(--success);
  color: #fff;
}

/* ── CARDS ── */
.shadowing-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 10px;
  overflow: hidden;
}

.shadowing-card-header {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: #fff;
  padding: 7px 10px;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.3px;
}

.shadowing-card-header i {
  font-size: 18px;
  opacity: 0.95;
}

.shadowing-card-body {
  padding: 14px;
}

/* ── INFO BOX ── */
.shadowing-info-box {
  background: linear-gradient(135deg, #f3e5f5, #fce4ec);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--gray-800);
}

.shadowing-info-box strong {
  color: var(--primary-dark);
}

.shadowing-info-box ul {
  padding-left: 22px;
  margin-top: 10px;
}

.shadowing-info-box ul li {
  margin-bottom: 6px;
  position: relative;
}

.shadowing-info-box ul li::marker {
  color: var(--primary);
}

/* ── FORM GRID ── */
.shadowing-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 16px;
}

.shadowing-form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.shadowing-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shadowing-form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shadowing-form-group input,
.shadowing-form-group select,
.shadowing-form-group textarea {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--gray-800);
  outline: none;
  transition: all 0.2s;
  background: var(--gray-50);
  font-family: inherit;
}

.shadowing-form-group input:focus,
.shadowing-form-group select:focus,
.shadowing-form-group textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(156, 39, 176, 0.1);
}

.shadowing-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.shadowing-full-width {
  grid-column: 1 / -1;
}

/* ── TABLE FORM ── */
.shadowing-form-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: var(--radius);
}

.shadowing-form-table thead {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: #fff;
}

.shadowing-form-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.shadowing-form-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
  background: #fff;
}

.shadowing-form-table tbody tr:hover td {
  background: var(--gray-50);
}

.shadowing-form-table tbody tr:nth-child(even) td {
  background: #faf5ff;
}

.shadowing-form-table .shadowing-question-cell {
  width: 45%;
  font-weight: 600;
  color: var(--gray-800);
}

.shadowing-form-table .shadowing-radio-cell {
  width: 30%;
}

.shadowing-form-table .shadowing-comment-cell {
  width: 25%;
}

.shadowing-section-header {
  background: linear-gradient(135deg, #f3e5f5, #e1bee7) !important;
  font-weight: 700;
  font-size: 13px;
  color: var(--primary-dark);
  padding: 10px 16px !important;
  letter-spacing: 0.5px;
}

/* ── RADIO BUTTONS ── */
.shadowing-radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.shadowing-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  padding: 6px 12px;
  border-radius: var(--radius);
  background: var(--gray-50);
  border: 2px solid transparent;
  transition: all 0.2s;
}

.shadowing-radio-label:hover {
  background: #f3e5f5;
  border-color: var(--primary-light);
}

.shadowing-radio-label input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.shadowing-radio-label input[type="radio"]:checked + span {
  font-weight: 600;
  color: var(--primary);
}

/* ── CHECKBOX GRID ── */
.shadowing-observed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.shadowing-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.shadowing-check-item:hover {
  border-color: var(--primary);
  background: #f3e5f5;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.shadowing-check-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.shadowing-check-item label {
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-800);
  flex: 1;
}

.shadowing-check-item i {
  color: var(--primary);
  font-size: 16px;
}

/* ── FEEDBACK HEADER ── */
.shadowing-feedback-header {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: #fff;
  padding: 5px 6px;
  border-radius: var(--radius-lg);
  margin-bottom: 5px;
  display: flex;
  flex-direction: row;
    gap: 30px;
}

.shadowing-feedback-header h3 {
  font-size: 18px;
  font-weight: 700;
  
}

.shadowing-feedback-header p {
  font-size: 13.5px;
  opacity: 0.95;
  line-height: 1.6;
}

/* ── SIGNATURE AREA ── */
.shadowing-sig-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 20px;
}

.shadowing-sig-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shadowing-sig-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.shadowing-sig-canvas {
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--gray-50);
  width: 100%;
  height: 100px;
  cursor: crosshair;
  touch-action: none;
}

.shadowing-sig-canvas.has-signature {
  border-color: var(--success);
  background: #f0fdf4;
}

.shadowing-sig-clear {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  margin-top: 6px;
  text-decoration: underline;
  font-weight: 600;
  align-self: flex-start;
}

.shadowing-sig-clear:hover {
  color: var(--primary-dark);
}

/* ── SUCCESS BOX ── */
.shadowing-success-box {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 2px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-top: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.shadowing-success-box i {
  color: var(--success);
  font-size: 22px;
  margin-top: 2px;
}

.shadowing-success-box-content {
  flex: 1;
}

.shadowing-success-box-title {
  font-size: 14px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 4px;
}

.shadowing-success-box-text {
  font-size: 13px;
  color: #166534;
  line-height: 1.6;
}

/* ── FORM FOOTER ── */
.shadowing-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 0 4px;
  margin-top: 20px;
  border-top: 2px solid var(--gray-200);
}

/* ── STATUS BADGE ── */
.shadowing-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.shadowing-status-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.shadowing-status-badge.complete {
  background: #dcfce7;
  color: #166534;
}

.shadowing-status-badge.draft {
  background: #e0e7ff;
  color: #3730a3;
}

.shadowing-status-badge.deleted {
  background: #fee2e2;
  color: #991b1b;
}

/* ── VIEW SECTION ── */
.shadowing-view-section {
  margin-top: 5px;
}

.shadowing-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  flex-wrap: wrap;
  gap: 16px;
}

.shadowing-view-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 10px;
}

.shadowing-view-title i {
  color: var(--primary);
}

.shadowing-view-tabs {
  display: flex;
  gap: 8px;
  background: #fff;
  padding: 6px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.shadowing-view-tab {
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-600);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shadowing-view-tab:hover {
  background: var(--gray-100);
}

.shadowing-view-tab.active {
  background:linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: #fff;
}

.shadowing-view-tab .shadowing-count {
  background: rgba(255, 255, 255, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.shadowing-view-tab.active .shadowing-count {
  background: rgba(255, 255, 255, 0.2);
}

/* ── SEARCH AND EXPORT BAR ── */
.shadowing-search-export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.shadowing-search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
  display: flex;
  align-items: center;
}

.shadowing-search-box i {
  position: absolute;
  left: 12px;
  color: var(--gray-600);
  font-size: 14px;
  pointer-events: none;
}

.shadowing-search-input {
  width: 100%;
  padding: 8px 40px 8px 38px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--gray-800);
  outline: none;
  transition: all 0.2s;
  background: var(--gray-50);
}

.shadowing-search-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.1);
}

.shadowing-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.shadowing-search-clear:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

.shadowing-export-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.shadowing-search-indicator {
  color: var(--primary);
  font-weight: 600;
  margin-left: 4px;
}

/* ── TABLE LIST ── */
.shadowing-table-list {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.shadowing-table-list-header {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr 180px;
  gap: 16px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shadowing-table-list-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr 180px;
  gap: 14px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gray-200);
  align-items: center;
  transition: all 0.2s;
}

.shadowing-table-list-row:hover {
  background: var(--gray-50);
}

.shadowing-table-list-row:last-child {
  border-bottom: none;
}

.shadowing-cell {
  font-size: 13.5px;
  color: var(--gray-800);
}

.shadowing-cell-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.shadowing-cell-value {
  font-weight: 500;
}

.shadowing-action-btns {
  display: flex;
  gap: 5px;
  /* flex-wrap: wrap; */
  flex-direction: row;
}

.shadowing-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.shadowing-action-btn i {
  font-size: 13px;
}

.shadowing-btn-view {
  background: #dbeafe;
  color: #1d4ed8;
}
.shadowing-btn-view:hover {
  background: #3b82f6;
  color: #fff;
  transform: translateY(-1px);
}

.shadowing-btn-edit {
  background: #fef3c7;
  color: #d97706;
}
.shadowing-btn-edit:hover {
  background: #f59e0b;
  color: #fff;
  transform: translateY(-1px);
}

.shadowing-btn-delete {
  background: #fee2e2;
  color: #dc2626;
}
.shadowing-btn-delete:hover {
  background: #ef4444;
  color: #fff;
  transform: translateY(-1px);
}

.shadowing-btn-restore {
  background: #d1fae5;
  color: #059669;
}
.shadowing-btn-restore:hover {
  background: #10b981;
  color: #fff;
  transform: translateY(-1px);
}

.shadowing-btn-delete-permanent {
  background: #fee2e2;
  color: #dc2626;
}
.shadowing-btn-delete-permanent:hover {
  background: #dc2626;
  color: #fff;
  transform: translateY(-1px);
}

/* ── EMPTY STATE ── */
.shadowing-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-600);
}

.shadowing-empty-state i {
  font-size: 64px;
  color: var(--gray-300);
  margin-bottom: 16px;
}

.shadowing-empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gray-800);
}

.shadowing-empty-state p {
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── PAGINATION ── */
.shadowing-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.shadowing-pagination-info {
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 500;
}

.shadowing-pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.shadowing-items-per-page {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-600);
}

.shadowing-items-per-page label {
  font-weight: 500;
}

.shadowing-select {
  padding: 4px 10px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}
.shadowing-select:hover {
  border-color: var(--primary);
}
.shadowing-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.1);
}

.shadowing-page-numbers {
  display: flex;
  align-items: center;
  gap: 3px;
}

.shadowing-page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gray-200);
  background: #fff;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray-600);
  font-size: 13px;
}
.shadowing-page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--gray-50);
}
.shadowing-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.shadowing-page-number {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gray-200);
  background: #fff;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 600;
  padding: 0 6px;
}
.shadowing-page-number:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--gray-50);
}
.shadowing-page-number.active {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.shadowing-page-ellipsis {
  padding: 0 6px;
  color: var(--gray-400);
  font-weight: 600;
  display: flex;
  align-items: center;
}

.shadowing-page-info {
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 500;
  white-space: nowrap;
}

/* ── MODAL ── */
.shadowing-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
  overflow-y: auto;
}

.shadowing-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
}

.shadowing-modal-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.shadowing-modal-title {
  font-size: 18px;
  font-weight: 700;
}

.shadowing-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.shadowing-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.shadowing-modal-body {
  padding: 24px;
}

.shadowing-view-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.shadowing-detail-item {
  background: var(--gray-50);
  padding: 14px 16px;
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
}

.shadowing-detail-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.shadowing-detail-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}
/* ── DROPDOWN & MULTI-SELECT STYLES ── */
.shadowing-dropdown-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shadowing-dropdown-search,
.shadowing-form-select,
.shadowing-form-input,
.shadowing-form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--gray-800);
  background: var(--gray-50);
  transition: all 0.2s;
  font-family: inherit;
}

.shadowing-form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 32px;
}

.shadowing-form-input:focus,
.shadowing-form-select:focus,
.shadowing-form-textarea:focus,
.shadowing-dropdown-search:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.1);
  outline: none;
}

.shadowing-form-input:disabled,
.shadowing-form-select:disabled {
  background: var(--gray-100);
  cursor: not-allowed;
  opacity: 0.7;
}

.shadowing-input-valid {
  border-color: var(--success) !important;
  background: #f0fdf4 !important;
}

.shadowing-dropdown-loading {
  padding: 10px;
  text-align: center;
  color: var(--gray-600);
  font-size: 13px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 2px dashed var(--gray-300);
}

/* Multi-select checkboxes */
.shadowing-multiselect-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shadowing-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
}

.shadowing-checkbox-grid::-webkit-scrollbar {
  width: 6px;
}

.shadowing-checkbox-grid::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

.shadowing-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
}

.shadowing-check-item:hover {
  border-color: var(--primary);
  background: #f3e5f5;
}

.shadowing-check-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.shadowing-check-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--gray-100);
}

.shadowing-check-item.disabled:hover {
  border-color: var(--gray-200);
  background: var(--gray-100);
}

.shadowing-client-label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  min-width: 0;
}

.shadowing-client-label .shadowing-badge-mini {
  flex-shrink: 0;
}

.shadowing-badge-mini {
  background: var(--warning);
  color: #fff;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.shadowing-selected-count {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  padding: 4px 8px;
  background: #f3e5f5;
  border-radius: var(--radius);
  align-self: flex-start;
}

/* Avatar styles */
.shadowing-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gray-200);
  flex-shrink: 0;
}

.shadowing-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

/* Search box inside dropdowns */
.shadowing-search-box {
  position: relative;
}

.shadowing-search-box i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  font-size: 13px;
  pointer-events: none;
  z-index: 1;
}

.shadowing-dropdown-search {
  padding-left: 32px !important;
  padding-right: 32px !important;
}

.shadowing-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}

.shadowing-search-clear:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .shadowing-checkbox-grid {
    grid-template-columns: 1fr;
    max-height: 150px;
  }
  
  .shadowing-action-btn span {
    display: none;
  }
  
  .shadowing-action-btn {
    padding: 6px;
    width: 36px;
    height: 36px;
    justify-content: center;
  }
}

/* ── ANIMATIONS ── */
@keyframes shadowing-fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shadowing-tab-content {
  animation: shadowing-fadeIn 0.3s ease-out;
}

/* ── TOAST NOTIFICATION ── */
.shadowing-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--gray-800);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  animation: shadowing-slideIn 0.3s ease-out;
}

.shadowing-toast.success {
  background: var(--success);
}

.shadowing-toast.error {
  background: var(--danger);
}

@keyframes shadowing-slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ── RESPONSIVE ── */
@media (max-width: 968px) {
  .shadowing-form-grid,
  .shadowing-form-grid-3 {
    grid-template-columns: 1fr;
  }

  .shadowing-sig-row {
    grid-template-columns: 1fr;
  }

  .shadowing-table-list-header,
  .shadowing-table-list-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .shadowing-table-list-header {
    display: none;
  }

  .shadowing-table-list-row {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 16px;
  }

  .shadowing-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .shadowing-cell::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--gray-600);
    font-size: 12px;
    text-transform: uppercase;
  }

  .shadowing-action-btns {
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--gray-200);
  }

  .shadowing-progress-bar {
    flex-direction: column;
  }

  .shadowing-step {
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
  }

  .shadowing-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .shadowing-header-actions {
    width: 100%;
  }

  .shadowing-header-actions .shadowing-btn {
    flex: 1;
    justify-content: center;
  }

  .shadowing-search-export-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .shadowing-search-box {
    min-width: 100%;
  }

  .shadowing-export-buttons {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .shadowing-page-content {
    padding: 16px;
  }

  .shadowing-card-body {
    padding: 16px;
  }

  .shadowing-form-table {
    font-size: 13px;
  }

  .shadowing-form-table th,
  .shadowing-form-table td {
    padding: 10px 12px;
  }

  .shadowing-observed-grid {
    grid-template-columns: 1fr;
  }

  .shadowing-view-tabs {
    flex-wrap: wrap;
  }

  .shadowing-view-tab {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .shadowing-btn {
    width: 100%;
    justify-content: center;
  }

  .shadowing-form-footer {
    flex-direction: column;
  }

  .shadowing-form-footer .shadowing-btn {
    width: 100%;
  }

  .shadowing-action-btn span {
    display: none;
  }
  
  .shadowing-action-btn {
    padding: 6px;
    width: 36px;
    height: 36px;
    justify-content: center;
  }

  .shadowing-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .shadowing-pagination-controls {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .shadowing-items-per-page {
    width: 100%;
    justify-content: center;
  }

  .shadowing-page-numbers {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .shadowing-page-info {
    order: -1;
    width: 100%;
    text-align: center;
    margin-bottom: 6px;
  }
}/* Disciplinary Tracker Styles - All classes prefixed with 'disciplinary-' */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.disciplinary-container {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f3f4f6;
  color: #222;
  min-height: 100vh;
}

/* Top Navigation */
.disciplinary-top-nav {
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 52px;
  border-bottom: 1px solid #e5e7eb;
  gap: 2px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
}

.disciplinary-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #c2185b;
  border-radius: 8px;
  padding: 5px 10px;
  margin-right: 6px;
}

.disciplinary-brand-text {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.disciplinary-brand-text span {
  display: block;
  font-weight: 400;
  font-size: 10px;
  opacity: 0.85;
}

.disciplinary-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
  color: #555;
  gap: 2px;
  min-width: 60px;
  border: none;
  background: transparent;
  transition: background 0.15s;
}

.disciplinary-nav-btn i {
  font-size: 16px;
  color: #888;
}

.disciplinary-nav-btn:hover {
  background: #fce4ec;
}

.disciplinary-nav-btn.active {
  background: #e91e8c;
  color: #fff;
}

.disciplinary-nav-btn.active i {
  color: #fff;
}

.disciplinary-nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.disciplinary-nav-time {
  font-size: 13px;
  font-weight: 600;
  color: #555;
}

.disciplinary-nav-user {
  background: #9c27b0;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.disciplinary-nav-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  font-size: 18px;
  position: relative;
}

.disciplinary-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e91e8c;
  color: #fff;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sub Navigation */
.disciplinary-sub-nav {
  background: #fff;
  border-bottom: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  padding: 0 20px;
  overflow-x: auto;
}

.disciplinary-sub-nav-item {
  padding: 12px 18px;
  font-size: 13px;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  white-space: nowrap;
}

.disciplinary-sub-nav-item:hover {
  color: #9c27b0;
}

.disciplinary-sub-nav-item.active {
  color: #9c27b0;
  border-bottom-color: #9c27b0;
  font-weight: 600;
}

.disciplinary-sub-nav-item i {
  font-size: 14px;
}

/* Page Content */
.disciplinary-page-content {
  padding: 20px 24px;
  max-width: 1300px;
  margin: 0 auto;
}

/* Header */
.disciplinary-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.disciplinary-page-title {
  font-size: 20px;
  font-weight: 700;
  color: #222;
  display: flex;
  align-items: center;
  gap: 8px;
}

.disciplinary-page-title i {
  color: #9c27b0;
}

.disciplinary-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.disciplinary-btn {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s;
}

.disciplinary-btn:hover {
  opacity: 0.88;
}

.disciplinary-btn-purple {
  background: #9c27b0;
  color: #fff;
}

.disciplinary-btn-green {
  background: #22c55e;
  color: #fff;
}

.disciplinary-btn-pink {
  background: #e91e8c;
  color: #fff;
}

.disciplinary-btn-gray {
  background: #e5e7eb;
  color: #444;
}

.disciplinary-btn-red {
  background: #ef4444;
  color: #fff;
}

.disciplinary-btn-full {
  width: 100%;
  justify-content: center;
}

/* Stats Cards */
.disciplinary-stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.disciplinary-stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 3px solid #9c27b0;
}

.disciplinary-stat-card-red {
  border-top-color: #ef4444;
}

.disciplinary-stat-card-orange {
  border-top-color: #f97316;
}

.disciplinary-stat-card-green {
  border-top-color: #22c55e;
}

.disciplinary-stat-card-blue {
  border-top-color: #3b82f6;
}

.disciplinary-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.disciplinary-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: #222;
}

.disciplinary-stat-sub {
  font-size: 11px;
  color: #aaa;
}

/* Notice Box */
.disciplinary-notice-box {
  background: #fff;
  border-left: 4px solid #9c27b0;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
}

.disciplinary-notice-title {
  font-size: 14px;
  font-weight: 700;
  color: #9c27b0;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.disciplinary-notice-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.disciplinary-notice-section-title {
  font-size: 12px;
  color: #555;
  display: block;
  margin-bottom: 5px;
}

.disciplinary-notice-box ul {
  padding-left: 18px;
}

.disciplinary-notice-box ul li {
  font-size: 12.5px;
  color: #555;
  margin-bottom: 5px;
  line-height: 1.5;
}

/* Card */
.disciplinary-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  margin-bottom: 18px;
  overflow: hidden;
}

.disciplinary-card-header {
  background: #9c27b0;
  color: #fff;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.disciplinary-card-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.disciplinary-card-body {
  padding: 16px 18px;
}

/* Toolbar */
.disciplinary-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.disciplinary-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  padding: 6px 12px;
  flex: 1;
  min-width: 200px;
}

.disciplinary-search-box i {
  color: #aaa;
  font-size: 13px;
}

.disciplinary-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: #333;
  width: 100%;
}

.disciplinary-filter-select {
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 13px;
  color: #444;
  background: #f9fafb;
  outline: none;
}

.disciplinary-show-select {
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 13px;
  color: #444;
  background: #f9fafb;
  outline: none;
}

/* Table */
.disciplinary-tbl-wrap {
  overflow-x: auto;
}

.disciplinary-disc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 900px;
}

.disciplinary-disc-table thead tr {
  background: #9c27b0;
}

.disciplinary-disc-table thead th {
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.disciplinary-disc-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.1s;
}

.disciplinary-disc-table tbody tr:hover {
  background: #fdf4ff;
}

.disciplinary-disc-table tbody tr.disciplinary-overdue {
  background: #fff5f5;
}

.disciplinary-disc-table tbody tr.disciplinary-overdue:hover {
  background: #fee2e2;
}

.disciplinary-disc-table td {
  padding: 9px 12px;
  vertical-align: middle;
  color: #333;
}

/* Avatar */
.disciplinary-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* Badges */
.disciplinary-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.disciplinary-badge-red {
  background: #fee2e2;
  color: #991b1b;
}

.disciplinary-badge-orange {
  background: #ffedd5;
  color: #9a3412;
}

.disciplinary-badge-yellow {
  background: #fef9c3;
  color: #854d0e;
}

.disciplinary-badge-green {
  background: #dcfce7;
  color: #166534;
}

.disciplinary-badge-purple {
  background: #f3e8ff;
  color: #6b21a8;
}

.disciplinary-badge-blue {
  background: #dbeafe;
  color: #1e40af;
}

.disciplinary-badge-gray {
  background: #f3f4f6;
  color: #374151;
}

.disciplinary-badge-pink {
  background: #fce7f3;
  color: #9d174d;
}

.disciplinary-emp-id {
  font-size: 11px;
  color: #888;
}

/* Action Buttons */
.disciplinary-action-btns {
  display: flex;
  gap: 5px;
}

.disciplinary-icon-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: #666;
  transition: all 0.15s;
}

.disciplinary-icon-btn:hover {
  background: #9c27b0;
  color: #fff;
  border-color: #9c27b0;
}

.disciplinary-icon-btn.disciplinary-del:hover {
  background: #ef4444;
  border-color: #ef4444;
}

/* Pagination */
.disciplinary-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 0;
  font-size: 12.5px;
  color: #666;
  flex-wrap: wrap;
  gap: 8px;
}

.disciplinary-page-info {
  font-size: 12.5px;
  color: #666;
}

.disciplinary-page-btns {
  display: flex;
  gap: 4px;
}

.disciplinary-page-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.disciplinary-page-btn:hover:not(:disabled) {
  border-color: #9c27b0;
  color: #9c27b0;
}

.disciplinary-page-btn.disciplinary-active {
  background: #9c27b0;
  color: #fff;
  border-color: #9c27b0;
}

.disciplinary-page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Checklist Card */
.disciplinary-checklist-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  margin-bottom: 18px;
  overflow: hidden;
}

.disciplinary-checklist-header {
  background: linear-gradient(135deg, #9c27b0, #e91e8c);
  color: #fff;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.disciplinary-checklist-body {
  padding: 16px 18px;
}

.disciplinary-progress-wrap {
  margin-bottom: 14px;
}

.disciplinary-progress-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
}

.disciplinary-progress-bar-outer {
  background: #f0f0f0;
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
}

.disciplinary-progress-bar-inner {
  background: linear-gradient(90deg, #9c27b0, #e91e8c);
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s;
}

.disciplinary-checklist-section {
  margin-bottom: 18px;
}

.disciplinary-checklist-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #9c27b0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #f3e5f5;
}

.disciplinary-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}

.disciplinary-checklist-item:hover {
  background: #f3e5f5;
  border-color: #e5e7eb;
}

.disciplinary-checklist-item.disciplinary-checked {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.disciplinary-checklist-item input[type="checkbox"] {
  accent-color: #9c27b0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.disciplinary-ci-text {
  font-size: 12.5px;
  color: #444;
  line-height: 1.5;
}

.disciplinary-checklist-item.disciplinary-checked .disciplinary-ci-text {
  color: #166534;
}

/* Main Grid */
.disciplinary-main-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}

/* Modal */
.disciplinary-modal-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.disciplinary-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.disciplinary-modal-header {
  background: #9c27b0;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px 12px 0 0;
}

.disciplinary-modal-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.disciplinary-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.8;
}

.disciplinary-modal-close:hover {
  opacity: 1;
}

.disciplinary-modal-body {
  padding: 20px;
}

.disciplinary-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}

.disciplinary-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.disciplinary-form-group label {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.disciplinary-form-group input,
.disciplinary-form-group select,
.disciplinary-form-group textarea {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  color: #222;
  outline: none;
  background: #fafafa;
  transition: border-color 0.15s;
}

.disciplinary-form-group input:focus,
.disciplinary-form-group select:focus,
.disciplinary-form-group textarea:focus {
  border-color: #9c27b0;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(156, 39, 176, 0.1);
}

.disciplinary-form-group textarea {
  resize: vertical;
  min-height: 70px;
}

.disciplinary-full {
  grid-column: 1 / -1;
}

.disciplinary-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Detail Panel */
.disciplinary-detail-panel {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  padding: 18px;
  margin-bottom: 18px;
}

.disciplinary-detail-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.disciplinary-detail-label {
  font-weight: 600;
  color: #888;
  min-width: 130px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.disciplinary-detail-value {
  color: #222;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .disciplinary-main-grid {
    grid-template-columns: 1fr;
  }
  
  .disciplinary-checklist-card {
    order: 2;
  }
  
  .disciplinary-card {
    order: 1;
  }
}

@media (max-width: 900px) {
  .disciplinary-stats-row {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .disciplinary-notice-cols {
    grid-template-columns: 1fr;
  }
  
  .disciplinary-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .disciplinary-stats-row {
    grid-template-columns: 1fr 1fr;
  }
  
  .disciplinary-page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .disciplinary-header-actions {
    width: 100%;
    justify-content: stretch;
  }
  
  .disciplinary-header-actions .disciplinary-btn {
    flex: 1;
    justify-content: center;
  }
  
  .disciplinary-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .disciplinary-search-box {
    min-width: 100%;
  }
  
  .disciplinary-filter-select,
  .disciplinary-show-select {
    width: 100%;
  }
  
  .disciplinary-pagination {
    flex-direction: column;
    align-items: stretch;
  }
  
  .disciplinary-page-btns {
    justify-content: center;
  }
  
  .disciplinary-nav-btn span {
    display: none;
  }
  
  .disciplinary-nav-btn {
    min-width: 40px;
  }
  
  .disciplinary-nav-time {
    display: none;
  }
}

@media (max-width: 480px) {
  .disciplinary-stats-row {
    grid-template-columns: 1fr;
  }
  
  .disciplinary-page-content {
    padding: 12px;
  }
  
  .disciplinary-card-body {
    padding: 12px;
  }
  
  .disciplinary-modal {
    max-height: 95vh;
  }
  
  .disciplinary-modal-body {
    padding: 12px;
  }
}
/* Custom filter dropdown */
.clients-filter-dropdown {
    position: relative;
    display: inline-block;
}

.clients-filter-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    background: #fff;
}

.clients-filter-chevron {
    transition: transform 0.15s ease;
}

.clients-filter-chevron.rotated {
    transform: rotate(180deg);
}

.clients-filter-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    min-width: 100%;
    margin: 4px 0 0;
    padding: 4px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    list-style: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.clients-filter-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
}

.clients-filter-option:hover,
.clients-filter-option.active {
    background: #f0f0f0;
}

.clients-filter-option.selected {
    background: #e8f0fe;
    color: #1a73e8;
}

.clients-filter-check {
    color: #1a73e8;
    flex-shrink: 0;
}
.clients-container {
    padding: 20px;
    background-color: #f9fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.clients-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.new-client-indicator {
    margin-right: 2px;
    font-size: 1em;
    vertical-align: middle;
    color: #28a745;
    /* A nice green color */
}

.clients-table th,
.clients-table td {
    border-right: 1px solid #e5e7eb;
    /* vertical lines */
}

.clients-table th:last-child,
.clients-table td:last-child {
    border-right: none;
    /* remove last column double border */
}

.clients-table {
    border: 1px solid #e5e7eb;
}

.sortable:hover {
    background: #171426;
    cursor: pointer;
}

.sort-icons {
    font-size: 11px;
    margin-left: 1px;
    color: #bbb;
}

.sort-icons.active {
    color: #fcd702;
    font-weight: bold;
}

/* Body Map List Styles */
.bodymap-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bodymap-list-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bodymap-list-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.bodymap-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.bodymap-item-header h3 {
    margin: 0;
    color: #2c3e50;
}

.entry-date {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.bodymap-item-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bodymap-item-preview p {
    margin: 0;
    flex: 1;
    padding-right: 15px;
}

.image-preview {
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Body Map Detail View Styles */
.bodymap-detail-view {
    max-width: 800px;
    margin: 0 auto;
}

.back-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 14px;
}

.back-btn:hover {
    background-color: #2980b9;
}

.bodymap-detail-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bodymap-detail-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.bodymap-detail-header h2 {
    margin: 0;
    color: #2c3e50;
}

.entry-id {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.bodymap-detail-content {
    padding: 20px;
}

.detail-row {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.detail-label {
    font-weight: bold;
    width: 150px;
    color: #2c3e50;
}

.detail-value {
    flex: 1;
}

.detail-image-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
}

.bodymap-detail-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
    margin-top: 10px;
    border: 1px solid #ddd;
}

.clients-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    margin-bottom: 10px;
}

.name-title {
    font-size: 20px;
    font-weight: 700;
    color: #091724;
    margin: 0;
    margin-bottom: 2px;
}

.clients-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.clients-row {
    display: flex;
    gap: 40px;
}

.clients-list-btn {
    padding: 4px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    height: 25px;
    width: 120px;
}

.clients-export-btn {
    padding: 4px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    height: 25px;
    width: 45px;
}

.active-btn {
    background-color: #23ad237d;
    color: white;
}

.active-btn:hover {
    background-color: #2b792bde;
    transform: translateY(-1px);
}

.archived-btn {
    background-color: #3743457d;
    color: white;
}

.archived-btn:hover {
    background-color: #24393d;
    transform: translateY(-1px);
}


.clients-excel-btn {
    background-color: #28a745;
    color: white;
    height: 25px;
    width: 45px;
}

.clients-excel-btn:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.clients-pdf-btn {
    background-color: #e91e63;
    color: white;
}

.clients-pdf-btn:hover {
    background-color: #c2185b;
    transform: translateY(-1px);
}

.clients-print-btn {
    background-color: #6c5ce7;
    color: white;
}

.clients-print-btn:hover {
    background-color: #5a4fcf;
    transform: translateY(-1px);
}

.txtbox {
    padding: 8px !important;
    border: 1px solid rgb(235, 192, 255) !important;
    color: #074a96;
}

.txtlabel {
    font-size: 14px;
    padding: 10px;
}

.clients-error {
    color: rgb(255, 75, 75);
    font-size: 12px;
}

.clients-record-btn {
    background-color: #074a96;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    width: 150px;
}

.clients-record-btn:hover {
    background-color: #1976d2;
    transform: translateY(-1px);
}

.clients-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.clients-search-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.clients-search-label {
    font-weight: 500;
    color: #555;
}

.clients-search-input {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    min-width: 200px;
}

.clients-search-input:focus {
    outline: none;
    border-color: #c3bfff;
}

.clients-nok-heading {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    box-shadow: 0 2px 8px rgba(9, 7, 25, 0.5);
}

.clients-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    margin-top: 25px;
    margin-bottom: 30px;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
}

.rota-table-container {
    background: rgba(205, 205, 205, 0.365);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    margin-top: 25px;
    margin: 20px;
    max-height: 67vh;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
}


.scroll-y {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
}


.clients-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.clients-table-header {
    background: linear-gradient(135deg, #4c4651, #455568);
    color: white;
    position: sticky;
    top: 0;
    z-index: 5;
}

.p-top-bottom {
    padding-top: 5px;
    padding-bottom: 5px;
}

.clients-sort-indicator {
    margin-left: 5px;
    font-size: 12px;
}

.clients-table-body tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.clients-table-body tr:nth-child(even) {
    background-color: #e9fafa;
}

.clients-table-body tr:hover {
    background-color: #fffac2;
    cursor: pointer;
}

.clients-table-body tr:hover {
    color: #206ad8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.clients-table-body td {
    padding: 5px;
    vertical-align: left;
    border-bottom: 1px solid #bebebeca;
}

.clients-more-details-btn {
    background-color: #8fc5ed;
    color: #333;
    border: none;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clients-more-details-btn:hover {
    background-color: #ffb300;
    transform: translateY(-1px);
}

.clients-edit-btn {
    background-color: transparent;
    color: #11667d;
    border: 1px solid #1ea2e9;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clients-edit-btn:hover {
    background-color: #1e7de9;
    color: white;
    transform: translateY(-1px);
}

.clients-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 8px;
    position: relative;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
    position: sticky;
    bottom: 0;
}

.clients-pagination-info {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.clients-pagination-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.clients-pagination-btn {
    padding: 5px 8px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.clients-pagination-btn:hover:not(:disabled) {
    background-color: #f8f9fa;
    border-color: #2196f3;
    color: #2196f3;
    transform: translateY(-1px);
}

.clients-pagination-btn.active {
    background-color: #2196f3;
    color: white;
    border-color: #2196f3;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.clients-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #999;
}

.clients-no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}


/* Responsive Design */
@media (max-width: 1200px) {
    .clients-table-container {
        overflow-x: auto;
        overflow-y: auto;
        max-height: 55vh;
    }

    .rota-table-container {
        overflow-x: auto;
        overflow-y: auto;
        max-height: 65vh;
    }

    .clients-table {
        min-width: 1000px;
    }
}

@media (max-width: 768px) {
    .clients-container {
        padding: 10px;
    }

    .clients-title {
        font-size: 20px;
    }

    .clients-header {
        flex-direction: column;
        align-items: stretch;
    }

    .clients-actions {
        justify-content: center;
    }

    .clients-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .clients-search-container {
        justify-content: center;
    }

    .clients-search-input {
        min-width: 250px;
    }

    .clients-pagination {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .clients-table {
        font-size: 12px;
    }

    .clients-table-header th,
    .clients-table-body td {
        padding: 8px 6px;
    }

    .clients-table-container {
        max-height: 45vh;
    }

    .rota-table-container {
        max-height: 55vh;
    }
}

@media (max-width: 480px) {

    .clients-export-btn,
    .clients-record-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .clients-search-input {
        min-width: 200px;
    }

    .clients-pagination-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 35px;
    }
}

/* clients.css additions for Modal */

.clients-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(13, 13, 14, 0.553);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
    /* Ensure it's on top of everything */
}

.clients-modal-content {
    background: rgb(244, 251, 255);
    padding: 20px;
    border-radius: 8px;
    position: relative;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.clients-modal-close-btn {
    position: absolute;
    top: 1px;
    right: 1px;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #555;
}

/* New class for a larger modal */
.clients-modal-content.modal-lg {
    max-width: 1150px;
}

.clients-modal-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #ffffff;
    background-color: #3c5157;
    padding: 2px;
    padding-left: 30px;
    font-weight: 700;
    border-radius: 2px;
}

.clients-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Two columns for a cleaner form */
    gap: 20px;
    margin-bottom: 20px;
}

.clients-form-group {
    display: flex;
    flex-direction: column;
}

.clients-form-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #444;
}

.clients-form-group input,
.clients-form-group select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.clients-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.clients-submit-btn {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

/* Media query for smaller screens */
@media (max-width: 650px) {
    .clients-form-grid {
        grid-template-columns: 1fr;
        /* Single column on small screens */
    }
}

/* --- Modal Form Styling for 3 Columns (REQUIRED CHANGE) --- */
.clients-modal-content {
    /* Increased max-width for the 3-column layout */
    max-width: 900px;
    width: 95%;
}

.clients-form-grid-three-col {
    display: grid;
    /* Defines the 3 equal columns */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 15px;
    /* Adjust gap for 3 columns */
    margin-bottom: 20px;
}

/* Make specific fields span all 3 columns as per screenshot */
.clients-form-group .span-3 {
    grid-column: 1 / -1;
    /* Start at first column line, end at last column line */
}

/* Style for textareas to grow as needed and look cleaner */
.clients-form-group textarea {
    min-height: 40px;
    resize: vertical;
}

/* Custom styling for the radio buttons */
.clients-radio-group {
    display: flex;
    gap: 15px;
    align-items: center;
    height: 100%;
    /* Ensures alignment with other inputs */
    padding-top: 5px;
}

.clients-radio-group label {
    font-weight: 400;
    /* Lighter font for radio labels */
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.clients-radio-group input[type="radio"] {
    margin-right: 5px;
    transform: scale(1.1);
}


/* Layout for the bottom row (Assessment & Funding) */
.clients-form-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    /* 3 columns */
    gap: 20px 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Ensures the final submit button row only contains the button and is right-aligned */
.clients-form-actions-submit-only {
    justify-content: flex-end;
    border-top: none;
    /* Remove border if it's visually confusing at the bottom */
    padding-top: 0;
}

/* Style the final "Submit" button to match the screenshot's color */
.clients-submit-blue {
    background-color: #007bff !important;
    /* Blue color */
    color: white !important;
    padding: 10px 30px !important;
    font-weight: bold;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.clients-submit-blue:hover {
    background-color: #003989 !important;
}

/* Hide the unused cancel button from the original form's clients-form-actions */
.clients-form-actions .clients-cancel-btn {
    display: none;
}

/* Responsive adjustment for small screens */
@media (max-width: 950px) {

    .clients-form-grid-three-col,
    .clients-form-bottom-row {
        /* Revert to 2 columns on smaller screens */
        grid-template-columns: 1fr 1fr;
    }

    /* Ensure elements that spanned 3 columns now span 2 */
    .clients-form-group .span-3 {
        grid-column: 1 / -1;
    }

    /* Make the last placeholder in the bottom row disappear for clean 2-column look */
    .clients-form-group-placeholder {
        display: none;
    }
}

@media (max-width: 600px) {

    .clients-form-grid-three-col,
    .clients-form-bottom-row {
        /* Revert to single column on very small screens */
        grid-template-columns: 1fr;
    }
}



/* HEADER STYLES */
.clients-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 20px;
    border-bottom: 1px solid #2e5175;
    background: linear-gradient(135deg, #e859ea, #e102ff, #8902ff);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.clients-modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f0623;
}

/* FOOTER STYLES */
.clients-modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 5px 20px;
    border-top: 1px solid #a6aaad;
    background-color: #dad7da;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* BODY STYLES */
.clients-modal-body {
    padding: 20px;
    max-height: 80vh;
    /* Allow content to scroll if too long */
    overflow-y: auto;
    /* Enable vertical scrolling */
}

/* Button Styles for the Footer (Example) */

.clients-cancel-btn {
    background-color: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    float: lleft;
}

.clients-cancel-btn:hover {
    background-color: #575e65;
}

/* Update Modal Content borders to remove them from inside the header/footer */
.clients-modal-content {
    /* ... existing styles ... */
    /* Remove padding and border-radius from the content wrapper itself */
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    /* Important for containing children borders/radii */
}

/* Remove the redundant close button from the content div */
.clients-modal-content>.clients-modal-close-btn {
    display: none;
}


/* * Base style for all notification messages 
 */
.notification {
    /* Positioning & Layout */
    position: fixed;
    /* Keep it in place even when scrolling */
    top: 20px;
    /* Distance from the top of the viewport */
    right: 20px;
    /* Distance from the right of the viewport */
    z-index: 1000;
    /* Ensure it floats above other content */

    /* Appearance */
    padding: 15px 25px;
    border-radius: 8px;
    /* Rounded corners */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    /* Soft shadow */
    font-size: 16px;
    font-weight: 500;
    opacity: 0;
    /* Start hidden */
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    transform: translateX(100%);
    /* Start off-screen to the right */
    pointer-events: none;
    /* Allows clicks to pass through when hidden */
}

/* * Active state: used when the notification state is not null 
 * You'll dynamically add this class (e.g., .notification.show)
 */
.notification.show {
    opacity: 1;
    transform: translateX(0);
    /* Slide into view */
    pointer-events: auto;
    /* Enable clicks when visible */
}

/*
 * Modifier Styles for different message types
 */

/* Success Message (e.g., green for positive feedback) */
.notification.success {
    background-color: #4CAF50;
    /* Green */
    color: white;
    border-left: 5px solid #388E3C;
    /* Darker green border */
}

/* Error Message (e.g., red for critical issues) */
.notification.error {
    background-color: #f44336;
    /* Red */
    color: white;
    border-left: 5px solid #D32F2F;
    /* Darker red border */
}

/* Warning Message (e.g., yellow/orange for caution) */
.notification.warning {
    background-color: #ff9800;
    /* Orange */
    color: #333;
    border-left: 5px solid #F57C00;
    /* Darker orange border */
}

/* Info Message (e.g., blue for general information) */
.notification.info {
    background-color: #2196F3;
    /* Blue */
    color: white;
    border-left: 5px solid #1976D2;
    /* Darker blue border */
}

/* ------------------------------------- */
/* --- Notification (Toast Message) --- */
/* ------------------------------------- */

/* Base style for the notification box */
.clients-notification {
    /* Positioning & Layering */
    position: fixed;
    /* Fixed position relative to the viewport */
    top: 20px;
    /* Distance from the top */
    right: 20px;
    /* Distance from the right */
    z-index: 9000;
    /* Ensure it's above everything else */

    /* Appearance */
    padding: 15px 30px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    min-width: 350px;
    max-width: 500px;

    /* Default (Success/Info) Style */
    background-color: #28a745;
    /* Green for success */
    border-left: 5px solid #1e7e34;

    /* Animation Setup: Start hidden and move off-screen */
    opacity: 0;
    transform: translateY(-50px);
    animation: slideInFadeOut 3.5s ease-in-out forwards;
}

/* Modifier for Error Messages */
.clients-notification.error {
    background-color: #dc3545;
    /* Red for error */
    border-left: 5px solid #c82333;
}

/* Keyframes for Slide-in and Fade-out Animation */
@keyframes slideInFadeOut {

    /* Step 1: Slide in quickly */
    0% {
        opacity: 0;
        transform: translateY(-50px);
    }

    5% {
        opacity: 1;
        transform: translateY(0);
    }

    /* Step 2: Hold steady */
    90% {
        opacity: 1;
        transform: translateY(0);
    }

    /* Step 3: Fade out */
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}

.clients-select-dropdown {
    padding: 2px 4px;
    font-size: 12px;
    max-height: 30px !important;
    font-weight: 800;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #b2b2b2;
    color: #333;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.2s ease-in-out;
}

.clients-select-dropdown:focus {
    outline: none;
    border-color: #007bff;
    background: #fff;
}

.clients-select-dropdown:hover {
    border-color: #007bff;
}

.clients-select-dropdown option {
    padding: 2px;
    font-size: 14px;
}



/* --- 2 COLUMN FORM GRID --- */
.col-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Two equal columns */
    gap: 20px 15px;
}

/* --- 2 COLUMN FORM GRID --- */
.clients-form-grid-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Two equal columns */
    gap: 20px 15px;
    /* space between columns and rows */
    margin-bottom: 20px;
}

/* Make a field span across both columns (useful for long text areas, notes, etc.) */
.clients-form-group.span-2 {
    grid-column: 1 / -1;
    /* span both columns */
}

/* Adjust to 1 column on smaller screens */
@media (max-width: 650px) {
    .clients-form-grid-two-col {
        grid-template-columns: 1fr;
    }
}

/* --- 4 COLUMN GRID --- */
.clients-form-grid-four-col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 equal columns */
    gap: 20px 15px;
    /* spacing between columns and rows */
    margin-bottom: 20px;
}

/* Make a field span across all columns */
.clients-form-group.span-4 {
    grid-column: 1 / -1;
}

/* On medium screens (tablets), show 2 columns */
@media (max-width: 1024px) {
    .clients-form-grid-four-col {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* On small screens (phones), show 1 column */
@media (max-width: 650px) {
    .clients-form-grid-four-col {
        grid-template-columns: 1fr;
    }
}/* Client Details Page Styles - Integrated within Client Management */

.client-details-wrapper {
    padding: 20px;
    background-color: #f9fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
}

.client-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.client-details-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    flex: 1;
    text-align: center;
}

.back-to-list-btn {
    background-color: #b6c6ee;
    color: rgb(0, 0, 14);
    padding: 2px 8px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.back-to-list-btn:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.edit-client-btn {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.edit-client-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.client-details-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #060510;
    background: linear-gradient(135deg, #b3c1c5, #cddae0);
    padding: 2px 20px;
    margin: -20px -10px 15px -10px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 2px solid #c1c4c9;
}

.profile-title {
    font-size: 18px;
    font-weight: 700;
    color: #060510;
    background: linear-gradient(135deg, #b3c1c5, #cddae0);
    padding: 2px 20px;
    margin: -20px -10px 15px -10px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 2px solid #c1c4c9;
}

.clients-loading-details,
.clients-error-message {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px;
}

.clients-loading-details {
    font-size: 18px;
    color: #666;
}

.clients-loading-details i {
    font-size: 24px;
    margin-right: 10px;
}

.clients-error-message {
    color: #dc3545;
}

.clients-error-message button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 15px;
}

.clients-error-message button:hover {
    background-color: #0056b3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .client-details-wrapper {
        padding: 15px;
    }

    .client-details-header {
        flex-direction: column;
        align-items: stretch;
    }

    .client-details-title {
        font-size: 22px;
        text-align: left;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .client-details-section {
        padding: 20px;
    }

    .section-title {
        margin: -20px -20px 15px -20px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {

    .back-to-list-btn,
    .edit-client-btn {
        width: 100%;
        text-align: center;
    }
}/* ==========================================================================
   clients-modern.css
   Redesigned Clients page. Every class is prefixed "cm-" so it cannot clash
   with clients.css / client-details.css (which other pages still use).
   Import it AFTER those two files:
       import "./css/clients.css"
       import "./css/client-details.css"
       import "./css/clients-modern.css"
   ========================================================================== */

:root {
    --cm-ink: #0f172a;
    --cm-text: #1e293b;
    --cm-muted: #64748b;
    --cm-faint: #94a3b8;
    --cm-line: #e2e8f0;
    --cm-line-strong: #cbd5e1;

    --cm-bg: #f4f6fa;
    --cm-surface: #ffffff;
    --cm-row-alt: #f8fafc;
    --cm-row-hover: #eaf2fb;

    --cm-primary: #074a96;
    --cm-primary-hover: #053a78;
    --cm-primary-soft: #e7f0fb;
    --cm-focus: rgba(7, 74, 150, 0.18);

    --cm-danger: #b42318;
    --cm-danger-hover: #912018;
    --cm-danger-soft: #fee4e2;
    --cm-success: #067647;
    --cm-success-hover: #05603a;
    --cm-success-soft: #dcfae6;
    --cm-warn: #b54708;
    --cm-warn-soft: #fef0c7;

    --cm-radius: 12px;
    --cm-radius-sm: 8px;
    --cm-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --cm-shadow-md: 0 10px 30px rgba(15, 23, 42, 0.18);
    --cm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Page shell ---------- */

.cm-page {
    box-sizing: border-box;
    padding: 16px 24px 28px;
    background: var(--cm-bg);
    color: var(--cm-text);
    font-family: var(--cm-font);
    font-size: 14px;
    line-height: 1.45;
    min-height: 100%;
}

.cm-page *,
.cm-page *::before,
.cm-page *::after {
    box-sizing: border-box;
}

.cm-page :is(button, input, select, textarea, a, [tabindex]):focus-visible {
    outline: 2px solid var(--cm-primary);
    outline-offset: 2px;
}

.cm-muted {
    color: var(--cm-muted);
}

.cm-faint {
    color: var(--cm-faint);
}

/* ---------- Top bar: title | 4 summary chips | buttons  (ONE line) ---------- */

.cm-pagehead {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.cm-pagehead-title {
    flex-shrink: 0;
}

.cm-page .cm-title {
    margin: 0;
    padding: 0;
    font-size: 24px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--cm-ink);
    white-space: nowrap;
}

.cm-page .cm-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--cm-muted);
}

.cm-pagehead-actions {
    display: flex;
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 10px;
}

/* ---------- Buttons ---------- */

.cm-page .cm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    height: 38px;
    min-height: 38px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--cm-radius-sm);
    font: 600 14px/1 var(--cm-font);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.cm-page .cm-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.cm-page .cm-btn-primary {
    background: var(--cm-primary);
    color: #fff;
    box-shadow: var(--cm-shadow-sm);
}

.cm-page .cm-btn-primary:hover:not(:disabled) {
    background: var(--cm-primary-hover);
}

.cm-page .cm-btn-secondary {
    background: #fff;
    color: var(--cm-ink);
    border-color: var(--cm-line-strong);
}

.cm-page .cm-btn-secondary:hover:not(:disabled) {
    background: #f8fafc;
    border-color: var(--cm-faint);
}

.cm-page .cm-btn-danger {
    background: var(--cm-danger);
    color: #fff;
}

.cm-page .cm-btn-danger:hover:not(:disabled) {
    background: var(--cm-danger-hover);
}

.cm-page .cm-btn-success {
    background: var(--cm-success);
    color: #fff;
}

.cm-page .cm-btn-success:hover:not(:disabled) {
    background: var(--cm-success-hover);
}

.cm-page .cm-btn-ghost {
    background: transparent;
    color: var(--cm-text);
    border-color: var(--cm-line);
    padding: 0 12px;
}

.cm-page .cm-btn-ghost:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: var(--cm-line-strong);
}

.cm-export-group {
    display: flex;
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 8px;
}

.cm-spin {
    animation: cm-spin 0.9s linear infinite;
}

@keyframes cm-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Summary chips (now live inside the top bar) ---------- */

.cm-stats {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 10px;
    min-width: 0;
    margin: 0;
}

.cm-stat {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 7px 12px;
    background: var(--cm-surface);
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow-sm);
}

.cm-stat > div {
    min-width: 0;
}

.cm-stat-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--tone-soft, #eef2f7);
    color: var(--tone, #475569);
}

.cm-stat.is-blue {
    --tone: #074a96;
    --tone-soft: #e7f0fb;
}

.cm-stat.is-green {
    --tone: #067647;
    --tone-soft: #dcfae6;
}

.cm-stat.is-amber {
    --tone: #b54708;
    --tone-soft: #fef0c7;
}

.cm-stat.is-slate {
    --tone: #475569;
    --tone-soft: #eef2f7;
}

.cm-stat-value {
    font-size: 18px;
    line-height: 1.1;
    font-weight: 700;
    color: var(--cm-ink);
}

.cm-stat-label {
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--cm-muted);
}

/* ---------- Main card (toolbar + table + pager) ---------- */

.cm-card {
    background: var(--cm-surface);
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow-sm);
    overflow: hidden;
}

/* Toolbar: dropdowns + search + export buttons on ONE line */
.cm-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--cm-line);
}

/* Dropdowns and buttons keep their size; only the search box may shrink */
.cm-toolbar > * {
    flex-shrink: 0;
}

.cm-toolbar-spacer {
    flex: 1 1 0;
    min-width: 0;
}

/* Search */

.cm-search {
    position: relative;
    flex: 1 1 240px;
    flex-shrink: 1;
    min-width: 120px;
    max-width: 340px;
}

.cm-page .cm-search input {
    width: 100%;
    height: 38px;
    min-height: 38px;
    margin: 0;
    padding: 0 34px 0 36px;
    border: 1px solid var(--cm-line-strong);
    border-radius: var(--cm-radius-sm);
    background: #fff;
    color: var(--cm-ink);
    font: 14px/1.2 var(--cm-font);
}

.cm-page .cm-search input::placeholder {
    color: var(--cm-faint);
}

.cm-page .cm-search input:focus {
    outline: none;
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px var(--cm-focus);
}

.cm-search-icon {
    position: absolute;
    top: 50%;
    left: 11px;
    transform: translateY(-50%);
    color: var(--cm-faint);
    pointer-events: none;
}

.cm-page .cm-search-clear {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--cm-muted);
    cursor: pointer;
}

.cm-page .cm-search-clear:hover {
    background: #f1f5f9;
    color: var(--cm-ink);
}

/* Dropdown (trigger lives in the page, menu is portalled to <body>) */

.cm-menu-wrap {
    position: relative;
    display: inline-block;
}

.cm-page .cm-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 38px;
    min-height: 38px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--cm-line-strong);
    border-radius: var(--cm-radius-sm);
    background: #fff;
    color: var(--cm-ink);
    font: 600 14px/1 var(--cm-font);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cm-page .cm-menu-trigger:hover {
    border-color: var(--cm-faint);
}

.cm-page .cm-menu-trigger[aria-expanded="true"] {
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px var(--cm-focus);
}

.cm-menu-trigger-icon {
    display: inline-flex;
    align-items: center;
    color: var(--cm-primary);
}

.cm-menu-trigger-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cm-menu-chevron {
    flex-shrink: 0;
    color: var(--cm-muted);
    transition: transform 0.15s ease;
}

.cm-menu-chevron.is-open {
    transform: rotate(180deg);
}

.cm-menu {
    position: fixed;
    z-index: 99999;
    margin: 0;
    padding: 4px;
    list-style: none;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--cm-line);
    border-radius: 10px;
    box-shadow: var(--cm-shadow-md);
    font-family: var(--cm-font);
}

.cm-menu-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--cm-text);
    cursor: pointer;
}

.cm-menu-option.is-active {
    background: #f1f5f9;
}

.cm-menu-option.is-selected {
    background: var(--cm-primary-soft);
    color: var(--cm-primary);
    font-weight: 600;
}

.cm-menu-option-icon {
    display: inline-flex;
    align-items: center;
}

.cm-menu-check {
    margin-left: auto;
}

/* ---------- Table ---------- */

/* The header is now one row shorter, so the table gets more room */
.cm-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 350px);
    min-height: 320px;
}

.cm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}

.cm-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 0;
    background: #f1f5f9;
    border-bottom: 1px solid var(--cm-line-strong);
    color: #475569;
    font-size: 12.5px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.cm-table thead th.cm-th-static {
    padding: 11px 12px;
}

.cm-page .cm-th-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin: 0;
    padding: 11px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cm-page .cm-th-btn:hover {
    background: #e6edf4;
    color: var(--cm-ink);
}

.cm-sort {
    flex-shrink: 0;
    color: var(--cm-faint);
}

.cm-sort.is-active {
    color: var(--cm-primary);
}

.cm-table tbody tr {
    background: #fff;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.cm-table tbody tr:nth-child(even) {
    background: var(--cm-row-alt);
}

.cm-table tbody tr:hover {
    background: var(--cm-row-hover);
}

.cm-table tbody tr:focus-visible {
    outline: 2px solid var(--cm-primary);
    outline-offset: -2px;
}

.cm-table tbody td {
    padding: 9px 12px;
    background: inherit;
    border-bottom: 1px solid #eef2f6;
    color: var(--cm-text);
    vertical-align: middle;
    white-space: nowrap;
}

/* Sticky first and last columns so they stay visible while scrolling sideways */

.cm-table .cm-col-left {
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 1px 0 0 var(--cm-line);
}

.cm-table .cm-col-right {
    position: sticky;
    right: 0;
    z-index: 2;
    box-shadow: -1px 0 0 var(--cm-line);
}

.cm-table thead th.cm-col-left,
.cm-table thead th.cm-col-right {
    z-index: 4;
}

/* Extra room on the Borough column so its text is not hidden under the sticky Actions column */
.cm-table tbody td:nth-last-child(2),
.cm-table thead th:nth-last-child(2) {
    padding-right: 24px;
}

.cm-client {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.cm-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.cm-client-name {
    font-weight: 700;
    color: var(--cm-ink);
}

.cm-pill-new {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 20px;
    margin-left: 8px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--cm-warn-soft);
    color: var(--cm-warn);
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

.cm-link {
    color: var(--cm-primary);
    text-decoration: none;
}

.cm-link:hover {
    text-decoration: underline;
}

/* Condition chips */

.cm-chips {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 60px;
}

.cm-cond-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.cm-cond-level {
    position: absolute;
    right: -4px;
    bottom: -4px;
    display: grid;
    place-items: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid currentColor;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

.cm-cond-more {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #eef2f7;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

/* Category badges */

.cm-badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef2f7;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
}

.cm-badge.is-blue {
    background: #e0efff;
    color: #0b4f9e;
}

.cm-badge.is-violet {
    background: #ede9fe;
    color: #5b21b6;
}

.cm-badge.is-green {
    background: #dcfae6;
    color: #067647;
}

.cm-badge.is-teal {
    background: #d5f5f1;
    color: #0f766e;
}

.cm-badge.is-amber {
    background: #fef0c7;
    color: #b54708;
}

.cm-badge.is-rose {
    background: #ffe4ec;
    color: #be185d;
}

/* Row actions */

.cm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.cm-page .cm-icon-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius-sm);
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cm-page .cm-icon-btn:hover {
    background: var(--cm-primary-soft);
    border-color: #b9d3ef;
    color: var(--cm-primary);
}

.cm-page .cm-icon-btn.is-danger:hover {
    background: var(--cm-danger-soft);
    border-color: #fda29b;
    color: var(--cm-danger);
}

.cm-page .cm-icon-btn.is-success:hover {
    background: var(--cm-success-soft);
    border-color: #86d9a8;
    color: var(--cm-success);
}

/* Empty / loading / error */

.cm-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 56px 20px;
    text-align: center;
    color: var(--cm-muted);
    white-space: normal;
}

.cm-state-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #eef2f7;
    color: var(--cm-muted);
}

.cm-state.is-error .cm-state-icon {
    background: var(--cm-danger-soft);
    color: var(--cm-danger);
}

.cm-state-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--cm-ink);
}

.cm-state-text {
    margin: 0;
    max-width: 360px;
    font-size: 13px;
}

.cm-loading-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* ---------- Pager (footer bar) ---------- */

.cm-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-top: 1px solid var(--cm-line);
    background: #fff;
}

/* "Showing 1-43 of 43 clients" + "Rows per page" stay on ONE line */
.cm-pager-left {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--cm-muted);
    white-space: nowrap;
}

.cm-pager-size {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.cm-pager-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.cm-page .cm-page-btn {
    min-width: 34px;
    height: 34px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--cm-line-strong);
    border-radius: var(--cm-radius-sm);
    background: #fff;
    color: var(--cm-text);
    font: 600 13px/1 var(--cm-font);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cm-page .cm-page-btn:hover:not(:disabled):not(.is-active) {
    background: #f1f5f9;
    border-color: var(--cm-faint);
}

.cm-page .cm-page-btn.is-active {
    background: var(--cm-primary);
    border-color: var(--cm-primary);
    color: #fff;
}

.cm-page .cm-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.cm-page-gap {
    padding: 0 2px;
    color: var(--cm-faint);
}

/* ---------- Toast ---------- */

.cm-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 300px;
    max-width: 440px;
    padding: 12px 12px 12px 14px;
    background: #fff;
    border: 1px solid var(--cm-line);
    border-left: 4px solid var(--cm-success);
    border-radius: 10px;
    box-shadow: var(--cm-shadow-md);
    color: var(--cm-ink);
    font: 500 14px/1.4 var(--cm-font);
    animation: cm-toast-in 0.25s ease-out;
}

.cm-toast.is-error {
    border-left-color: var(--cm-danger);
}

.cm-toast-icon {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--cm-success);
}

.cm-toast.is-error .cm-toast-icon {
    color: var(--cm-danger);
}

.cm-toast-text {
    flex: 1;
}

.cm-toast-close {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--cm-muted);
    cursor: pointer;
}

.cm-toast-close:hover {
    background: #f1f5f9;
    color: var(--cm-ink);
}

@keyframes cm-toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Modal ---------- */

.cm-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.cm-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1120px;
    height: min(900px, calc(100vh - 40px));
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--cm-shadow-md);
    overflow: hidden;
    font-family: var(--cm-font);
    color: var(--cm-text);
}

/* Small confirm dialogs (archive / restore) size to their content */
.cm-modal.is-sm {
    max-width: 520px;
    height: auto;
    max-height: calc(100vh - 40px);
}

.cm-modal *,
.cm-modal *::before,
.cm-modal *::after {
    box-sizing: border-box;
}

.cm-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--cm-line);
    background: #fff;
}

.cm-modal-headtext {
    min-width: 0;
}

.cm-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cm-ink);
}

.cm-modal-sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--cm-muted);
}

.cm-modal-body {
    flex: 1;
    min-height: 0;
    padding: 20px 24px 28px;
    overflow-y: auto;
    background: var(--cm-bg);
    scroll-behavior: smooth;
}

.cm-modal.is-sm .cm-modal-body {
    background: #fff;
}

.cm-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 24px;
    border-top: 1px solid var(--cm-line);
    background: #fff;
}

.cm-modal-text {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--cm-text);
}

/* ---------- Form: side navigation + section cards ---------- */

.cm-form-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

/* Section jump list: stays in view while the form scrolls */
.cm-form-nav {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow-sm);
}

.cm-form-nav-title {
    margin: 4px 10px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cm-faint);
}

.cm-modal .cm-form-nav button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 9px 10px;
    border: 0;
    border-radius: var(--cm-radius-sm);
    background: transparent;
    color: #475569;
    font: 600 13px/1.2 var(--cm-font);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.cm-modal .cm-form-nav button svg {
    flex-shrink: 0;
    color: var(--cm-faint);
}

.cm-modal .cm-form-nav button:hover {
    background: #f1f5f9;
    color: var(--cm-ink);
}

.cm-modal .cm-form-nav button.is-active {
    background: var(--cm-primary-soft);
    color: var(--cm-primary);
}

.cm-modal .cm-form-nav button.is-active svg {
    color: var(--cm-primary);
}

.cm-form-main {
    min-width: 0;
}

.cm-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid #fda29b;
    border-radius: var(--cm-radius-sm);
    background: var(--cm-danger-soft);
    color: var(--cm-danger);
    font-size: 13.5px;
    font-weight: 600;
}

/* Section card = tinted header band + body */

.cm-section {
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow-sm);
    overflow: hidden;
}

.cm-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--cm-line);
}

.cm-section-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--cm-primary-soft);
    color: var(--cm-primary);
}

.cm-section-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--cm-ink);
}

.cm-section-hint {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--cm-muted);
}

.cm-section-body {
    padding: 18px;
}

.cm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.cm-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cm-field.span-2 {
    grid-column: span 2;
}

.cm-field.span-3 {
    grid-column: 1 / -1;
}

.cm-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

.cm-req {
    color: var(--cm-danger);
}

.cm-modal .cm-input {
    display: block;
    width: 100%;
    height: 40px;
    min-height: 40px;
    max-height: none;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--cm-line-strong);
    border-radius: 9px;
    background: #fff;
    color: var(--cm-ink);
    font: 14px/1.3 var(--cm-font);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.cm-modal .cm-input:hover:not(:focus) {
    border-color: var(--cm-faint);
}

.cm-modal .cm-input::placeholder {
    color: var(--cm-faint);
}

.cm-modal textarea.cm-input {
    height: auto;
    min-height: 80px;
    padding: 10px 12px;
    resize: vertical;
}

.cm-modal .cm-input:focus {
    outline: none;
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px var(--cm-focus);
}

.cm-modal .cm-input.is-invalid {
    border-color: var(--cm-danger);
    background: #fffafa;
}

.cm-modal .cm-input.is-sm {
    width: auto;
    height: 32px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 13px;
}

.cm-field-error {
    font-size: 12px;
    color: var(--cm-danger);
}

/* Condition picker */

.cm-cond-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cm-cond {
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--cm-line-strong);
    border-radius: 10px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cm-cond:hover {
    border-color: var(--cm-faint);
}

.cm-cond.is-on {
    border-color: var(--cond-color, var(--cm-primary));
    background: var(--cond-soft, var(--cm-primary-soft));
}

.cm-cond.has-error {
    border-color: var(--cm-danger);
}

.cm-cond-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
}

.cm-cond-head input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--cm-primary);
}

.cm-cond-inactive {
    font-size: 12px;
    font-weight: 400;
    color: var(--cm-muted);
}

.cm-cond-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.cm-seg {
    display: inline-flex;
    width: max-content;
    border: 1px solid var(--cm-line-strong);
    border-radius: var(--cm-radius-sm);
    overflow: hidden;
    background: #fff;
}

.cm-modal .cm-seg button {
    height: 30px;
    margin: 0;
    padding: 0 14px;
    border: 0;
    border-right: 1px solid var(--cm-line);
    background: #fff;
    color: #475569;
    font: 600 13px/1 var(--cm-font);
    cursor: pointer;
}

.cm-modal .cm-seg button:last-child {
    border-right: 0;
}

.cm-modal .cm-seg button:hover:not(.is-on) {
    background: #f1f5f9;
}

.cm-modal .cm-seg button.is-on {
    background: var(--cm-primary);
    color: #fff;
}

.cm-empty-inline {
    margin: 0;
    padding: 14px;
    border: 1px dashed var(--cm-line-strong);
    border-radius: var(--cm-radius-sm);
    color: var(--cm-muted);
    font-size: 13.5px;
    text-align: center;
}

/* Modal buttons (modal sits inside .cm-page, so the .cm-btn rules above apply) */

.cm-modal .cm-icon-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--cm-radius-sm);
    background: transparent;
    color: var(--cm-muted);
    cursor: pointer;
}

.cm-modal .cm-icon-btn:hover {
    background: #f1f5f9;
    color: var(--cm-ink);
}

/* ---------- Responsive ---------- */

/* Small laptops: the 4 summary chips drop to their own row under the title + buttons */
@media (max-width: 1200px) {
    .cm-pagehead {
        flex-wrap: wrap;
    }

    .cm-pagehead-title {
        flex: 1 1 auto;
    }

    .cm-stats {
        order: 3;
        flex: 1 1 100%;
    }

    .cm-table-wrap {
        max-height: calc(100vh - 400px);
    }

    .cm-page .cm-btn-ghost {
        padding: 0 10px;
    }
}

@media (max-width: 1100px) {
    .cm-form-layout {
        grid-template-columns: 180px minmax(0, 1fr);
        gap: 16px;
    }

    .cm-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cm-field.span-2 {
        grid-column: 1 / -1;
    }
}

/* Below 900px there is physically no room for one line, so allow wrapping */
@media (max-width: 900px) {

    .cm-toolbar,
    .cm-pagehead-actions,
    .cm-pager-left {
        flex-wrap: wrap;
    }

    .cm-search {
        flex-basis: 100%;
        max-width: none;
    }

    .cm-toolbar-spacer {
        display: none;
    }

    .cm-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Phone / tablet: hide the side list, sections just stack */
    .cm-form-layout {
        grid-template-columns: 1fr;
    }

    .cm-form-nav {
        display: none;
    }
}

@media (max-width: 720px) {
    .cm-page {
        padding: 14px 12px 24px;
    }

    .cm-page .cm-title {
        font-size: 22px;
    }

    .cm-pagehead-actions {
        flex: 1 1 100%;
    }

    .cm-pagehead-actions .cm-btn {
        flex: 1;
    }

    .cm-grid,
    .cm-cond-list {
        grid-template-columns: 1fr;
    }

    .cm-modal-body {
        padding: 14px;
    }

    .cm-section-body {
        padding: 14px;
    }

    .cm-overlay {
        padding: 8px;
    }

    .cm-modal {
        height: calc(100vh - 16px);
    }

    .cm-toast {
        left: 12px;
        right: 12px;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    .cm-toast,
    .cm-spin {
        animation: none;
    }

    .cm-modal-body {
        scroll-behavior: auto;
    }

    .cm-menu-chevron,
    .cm-page .cm-btn,
    .cm-table tbody tr {
        transition: none;
    }
}/* ==========================================================================
   clients-fit.css
   Import AFTER clients-modern.css.

   1. Fit-to-screen: when useFitHeight sets data-fit on .cm-page, the page has
      a fixed height, the header/summary/toolbar/pager stay put, and ONLY the
      table scrolls. No more outer page scrollbar.
   2. Slim, rounded scrollbars for the table, dropdown menus and modal forms.
   ========================================================================== */

/* Breathing room between the summary chips and the table card */
.cm-stats {
    margin-bottom: 12px;
}

/* ---------- 1. Fit-to-screen layout (desktop / large tablet) ---------- */

.cm-page[data-fit] {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 12px;
}

.cm-page[data-fit] > .cm-pagehead,
.cm-page[data-fit] > .cm-stats {
    flex: 0 0 auto;
}

.cm-page[data-fit] > .cm-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.cm-page[data-fit] .cm-toolbar,
.cm-page[data-fit] .cm-pager {
    flex: 0 0 auto;
}

/* The table takes whatever height is left and scrolls inside itself */
.cm-page[data-fit] .cm-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

/* ---------- 2. Slim scrollbars ---------- */

:root {
    --cm-scroll-thumb: #c3d1e3;
    --cm-scroll-thumb-hover: #8fa9c9;
}

/* Modern browsers / current Electron: thin bar, no arrow buttons */
@supports (scrollbar-color: auto) {

    .cm-table-wrap,
    .cm-menu,
    .cm-modal-body {
        scrollbar-width: thin;
        scrollbar-color: var(--cm-scroll-thumb) transparent;
    }
}

/* Older Chromium / Safari fallback */
@supports not (scrollbar-color: auto) {

    .cm-table-wrap::-webkit-scrollbar,
    .cm-menu::-webkit-scrollbar,
    .cm-modal-body::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    .cm-table-wrap::-webkit-scrollbar-track,
    .cm-menu::-webkit-scrollbar-track,
    .cm-modal-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .cm-table-wrap::-webkit-scrollbar-thumb,
    .cm-menu::-webkit-scrollbar-thumb,
    .cm-modal-body::-webkit-scrollbar-thumb {
        background: var(--cm-scroll-thumb);
        border: 2px solid transparent;
        background-clip: content-box;
        border-radius: 999px;
    }

    .cm-table-wrap::-webkit-scrollbar-thumb:hover,
    .cm-menu::-webkit-scrollbar-thumb:hover,
    .cm-modal-body::-webkit-scrollbar-thumb:hover {
        background: var(--cm-scroll-thumb-hover);
        background-clip: content-box;
    }

    .cm-table-wrap::-webkit-scrollbar-button,
    .cm-menu::-webkit-scrollbar-button,
    .cm-modal-body::-webkit-scrollbar-button {
        display: none;
    }

    .cm-table-wrap::-webkit-scrollbar-corner {
        background: transparent;
    }
}/* Client Profile Tabs Styles */
.medication-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.medication-details {
    font-size: 0.9em;
    color: #555;
    margin-left: 20px;
    margin-top: 4px;
}

.not-administered-item {
    color: #d32f2f;
}

.client-profile-tabs-wrapper {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.client-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 20px;
    border-top: 2px solid rgb(22, 8, 43);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    background: linear-gradient(135deg, #4c4651, #455568);
    color: white;
    flex-wrap: wrap;
    gap: 15px;
}

.client-profile-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    color: rgb(213, 226, 229) !important;
    min-width: 250px;
}

.client-profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.edit-client-btn,
.archive-client-btn {
    padding: 1px 5px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-client-btn {
    background: #fff;
    color: #667eea;
}

.edit-client-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.archive-client-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.archive-client-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Tabs Navigation */
.tabs-navigation {
    display: flex;
    background: #ebeff4;
    border-bottom: 2px solid #bababa;
    overflow-x: auto;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 25px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #333;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

/* Export Actions */
.tab-export-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.export-btn {
    padding: 1px 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #333;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.excel-btn {
    background: #1d6f42;
    color: white;
    border-color: #454a47;
}

.pdf-btn {
    background: #b04744;
    color: white;
    border-color: #403d45;
}

.print-btn {
    background: #1d2a35;
    color: white;
    border-color: #6c757d;
}

.add-btn {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #203da7;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;

}

.add-btn:hover {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

/* Tab Content */
.tab-content {
    padding: 30px;
    min-height: 400px;
    border-color: #152f45 !important;
    max-height: 70vh;
    overflow-y: auto;
}

.tab-loading,
.tab-error,
.no-data {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #666;
}

.tab-error {
    color: #dc3545;
}

.client-details-section {
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 10px;
    margin-left: 0px;
    margin-right: 0px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(65, 36, 62, 0.2);

}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    padding-top: 8px;
    padding-bottom: 1px;
    margin-bottom: 5px;
    border-bottom: 1px solid #c4c9cf;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    letter-spacing: 0.5px;
}


.detail-item span {
    color: #3e4c6c;
    font-size: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
}


/* Logbook Tab */
.logbook-cards {
    display: grid;
    gap: 20px;
}

/* Added styles for logbook header with date filter */
.logbook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.date-filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.date-filter-container label {
    font-size: 14px;
    font-weight: 600;
    color: #5c65ae;
}

.date-filter-input {
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    color: #333;
    font-weight: bold;
    border-color: #b73ab9;
    background-color: #eaaffa50;
    cursor: pointer;
    transition: all 0.3s ease;
}

.date-filter-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.date-filter-input:hover {
    background: #3551dc8e;
    color: white;
    box-shadow: 0 2px 8px rgba(53, 117, 220, 0.3);
}

.clear-date-btn {
    padding: 4px 16px;
    border: 1px solid #dc3545;
    border-radius: 5px;
    background: white;
    color: #dc3545;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-date-btn:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.logbook-card {
    margin-top: 10px;
    background: #ffffff;
    border-top: 1px solid #cac8ce;
    border-left: 4px solid deepPink;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px;
    padding-bottom: 0px;
    transition: all 0.3s ease;
}

.logbook-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: translateX(5px);
    background: rgb(246, 244, 244);
}

.logbook-card-header {
    display: flex;
    background: #81a2b98f;
    border-radius: 4px;
    font-weight: bold;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 4px;
    flex-wrap: wrap;
    gap: 10px;
}

.card-date {
    font-weight: 600;
    color: #14256f;
    font-size: 14px;
}

.card-author {
    font-size: 14px;
    padding: 4px;
    color: #0065ca;
}

.card-footer {
    display: flex;
    background: none;
    border-radius: 4px;
    justify-content: space-between;
    margin-bottom: 5px;
    padding: 2px;
    flex-wrap: wrap;
    gap: 10px;
}

.card-content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    padding-top: 5px;
    padding-bottom: 10px;
}

/* Medication Tab */
.medication-table-wrapper {
    overflow-x: auto;
}

.medication-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.medication-table thead {
    background: #667eea;
    color: white;
}

.medication-table th,
.medication-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.medication-table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.missed {
    background: #f8d7da;
    color: #721c24;
}

/* Body Map Tab */
.bodymap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.bodymap-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.bodymap-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.bodymap-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.bodymap-card-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.severity-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge.minor {
    background: #d4edda;
    color: #155724;
}

.severity-badge.moderate {
    background: #fff3cd;
    color: #856404;
}

.severity-badge.severe {
    background: #f8d7da;
    color: #721c24;
}

.bodymap-card-body {
    padding: 15px;
}

.bodymap-card-body p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.5;
}

.bodymap-image {
    width: 100%;
    height: auto;
    margin-top: 15px;
    border-radius: 5px;
}

/* Visits Tab */
.visits-table-wrapper {
    overflow-x: auto;
}

.visits-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.visits-table thead {
    background: #667eea;
    color: white;
}

.visits-table th,
.visits-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.visits-table tbody tr:hover {
    background: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .client-profile-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .client-profile-title {
        font-size: 20px;
    }

    .tabs-navigation {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .tab-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .tab-content {
        padding: 20px 15px;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .medication-table,
    .visits-table {
        font-size: 13px;
    }

    .medication-table th,
    .medication-table td,
    .visits-table th,
    .visits-table td {
        padding: 8px 10px;
    }

    .bodymap-grid {
        grid-template-columns: 1fr;
    }
}


.rota-container {
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background-color: #f9fafc;
    padding: 0px;
    border-radius: 6px;
}

.rota-header {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.no-visits,
.loading,
.error {
    text-align: center;
    padding: 15px;
    color: #666;
}

.error {
    color: #d32f2f;
}

.rota-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rota-item {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    border: 1px solid #ddd;
    background: #fff;
    padding: 5px 15px;
    border-radius: 5px;
    transition: box-shadow 0.3s;
}

.rota-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.rota-info {
    flex: 1;
    min-width: 240px;
    margin-bottom: 2px !important;
}

.rota-call-type {
    font-weight: 600;
    color: #3257a6;
    margin-bottom: 4px;
}

.rota-activity-type {
    color: #555;
    font-size: 14px;
    margin-bottom: 6px;
}

.rota-days {
    font-size: 14px;
    color: #444;
    margin-bottom: 6px;
}

.rota-time {
    font-size: 14px;
    color: #222;
}

.rota-extra {
    text-align: right;
    min-width: 180px;
    align-self: center;
}

.rota-hours,
.rota-price {
    font-size: 14px;
    color: #333;
}

.rota-totals {
    margin-top: 15px;
    display: flex;
    justify-content: space-around;
    background: #c2c4c8;
    border: 1px solid #dcdde3;
    padding: 10px;
    border-radius: 5px;
    font-weight: 500;
    color: #222;
}

@media (max-width: 768px) {
    .rota-item {
        flex-direction: column;
    }

    .rota-extra {
        text-align: left;
        margin-top: 10px;
    }
}





.medications-container {
    padding: 5px;
    font-family: Arial, Helvetica, sans-serif;
}

.medications-title {
    font-size: 18px;
    font-weight: 600;
    border-bottom: 4px solid #84763084;
    color: teal;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.no-records {
    text-align: center;
    color: #6b7280;
    /* gray */
    padding: 32px 0;
}

.medications-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .medications-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .medications-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.medication-card {
    border: 1px solid #4783b0;
    /* primary */
    border-radius: 8px;
    padding: 16px;
    background-color: #f9fafc;
    /* card bg */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.2s ease;
}

.medication-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.medication-section {
    margin-bottom: 18px;
    margin-top: 18px;
    border-bottom: 1px solid #90969f49;
}

.medication-date {
    font-size: 14px;
    font-weight: 500;
    color: #3b82f6;
    margin-bottom: 4px;
}

.medication-info {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    margin-bottom: 14px;
}

.medication-detail {
    font-size: 14px;
    margin-left: 10px;
    white-space: pre-wrap;
    margin-bottom: 14px;
    color: #515252;
}



/* Notes Tab Styles */
.notes-tab-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.notes-table-container {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
}

.notes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.notes-table thead {
    background-color: #607d8b;
    color: white;
}

.notes-table thead th {
    padding: 4px;
    text-align: left;
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.626);
}

.notes-table thead th:last-child {
    border-right: none;
}

.notes-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
}

.notes-table tbody tr:hover {
    background-color: #f9fafb;
}

.notes-table tbody tr:last-child {
    border-bottom: none;
}

.notes-table tbody td {
    padding: 6px;
    vertical-align: top;
    border-right: 1px solid #f5f5f5;
}

.notes-table tbody td:last-child {
    border-right: none;
}

.notes-cell {
    max-width: 400px;
}

.note-subject {
    margin-bottom: 0.5rem;
    color: #111827;
}

.note-preview,
.note-full-text {
    color: #374151;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
}

.read-more-btn {
    padding: 0.25rem 0.75rem;
    background-color: #fef3c7;
    color: #92400e;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.read-more-btn:hover {
    background-color: #fde68a;
}


.clients-restore-btn {
    background-color: #276990;
    color: #fff;
    border: none;
    padding: 1px 10px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #f5f5f521;
    font-size: 12px;
    transition: background 0.3s;
}

.clients-restore-btn:hover {
    background-color: #218838;
}

/* Loading and Error States */
.tab-loading,
.tab-error {
    text-align: center;
    padding: 2rem;
    font-size: 1rem;
}

.tab-error {
    color: #ef4444;
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .notes-table {
        font-size: 12px;
    }

    .notes-table thead th,
    .notes-table tbody td {
        padding: 8px;
    }

    .notes-cell {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .client-profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .client-profile-actions {
        width: 100%;
        flex-direction: column;
    }

    .tab-export-actions {
        width: 100%;
    }

    .export-btn {
        flex: 1;
    }

    .tabs-navigation {
        overflow-x: auto;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .date-filter-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .notes-table-container {
        border: none;
    }

    .notes-table {
        display: block;
        font-size: 13px;
    }

    .notes-table thead {
        display: none;
    }

    .notes-table tbody {
        display: block;
    }

    .notes-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 1rem;
    }

    .notes-table tbody td {
        display: block;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid #f5f5f5;
    }

    .notes-table tbody td:last-child {
        border-bottom: none;
    }

    .notes-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        display: block;
        margin-bottom: 0.25rem;
    }

    .notes-cell {
        max-width: 100%;
    }
}/* =========================
   Client Rota Management CSS - Enhanced & Mobile Responsive
   ========================= */

/* --------
   Theme variables
   -------- */
:root {
    --blue-50: #eff6ff;
    --blue-200: #bfdbfe;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    --blue-900: #1e3a8a;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --green-500: #10b981;
    --green-600: #059669;
    --yellow-100: #fef9c3;
    --yellow-500: #f59e0b;
    --yellow-600: #d97706;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --red-800: #991b1b;
    --purple-600: #7c3aed;
    --white: #ffffff;
    --black: #000000;
    --border-color: var(--gray-300);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-full: 9999px;
    --shadow-md: 0 4px 8px rgba(15, 23, 42, 0.16);
    --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 12px 40px rgba(15, 23, 42, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    font-size: 14px;
    color: var(--gray-800);
    background-color: var(--gray-50);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.rota-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.padding {
    margin-left: 20px;
    margin-right: 20px;
    margin-top: 20px;
}

.clients-form-grid-three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.clients-form-grid-two-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.clients-table-container {
    width: 100%;
    overflow-x: auto;
}

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.border-left {
    border-left: 5px solid #7c3aed;
    border-top: 2px solid #b3b3b3;
    padding-top: 10px;
    padding-bottom: 10px;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.top-0 {
    top: 0;
}

.top-4 {
    top: 1rem;
}

.right-4 {
    right: 1rem;
}

.z-10 {
    z-index: 10;
}

.z-50 {
    z-index: 999;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.hidden {
    display: none;
}

.pdng {
    padding: 6px;
    padding-bottom: 2px;
    border-top: 1px solid rgb(210, 209, 209);
    border-radius: 5px;
    border-left: 5px solid rgba(49, 117, 185, 0.776);
}

.bg-th {
    background: #e0e3ef;
}

.text-xs {
    font-size: 0.65rem;
    line-height: 0.9rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.5rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-white {
    color: var(--white);
}

.text-gray-400 {
    color: var(--gray-400);
}

.text-gray-500 {
    color: var(--gray-500);
}

.text-gray-600 {
    color: var(--gray-600);
}

.text-gray-700 {
    color: var(--gray-700);
}

.text-gray-800 {
    color: var(--gray-800);
}

.text-blue-600 {
    color: var(--blue-600);
}

.text-blue-700 {
    color: var(--blue-700);
}

.text-blue-800 {
    color: var(--blue-800);
}

.text-blue-900 {
    color: var(--blue-900);
}

.text-red-600 {
    color: var(--red-600);
}

.text-red-800 {
    color: var(--red-800);
}

.bg-white {
    background-color: var(--white);
}

.bg-gray-50 {
    background-color: var(--gray-50);
}

.bg-gray-100 {
    background-color: var(--gray-100);
}

.bg-gray-500 {
    background-color: var(--gray-500);
}

.bg-teal-500 {
    background-color: var(--green-500);
}

.bg-blue-50 {
    background-color: var(--blue-50);
}

.bg-blue-500 {
    background-color: var(--blue-500);
}

.bg-blue-600 {
    background-color: var(--blue-600);
}

.bg-blue-700 {
    background-color: var(--blue-700);
}

.bg-green-500 {
    background-color: var(--green-500);
}

.bg-green-600 {
    background-color: var(--green-600);
}

.bg-yellow-100 {
    background-color: var(--yellow-50);
}

.bg-yellow-500 {
    background-color: var(--yellow-500);
}

.bg-yellow-600 {
    background-color: var(--yellow-600);
}

.bg-red-500 {
    background-color: var(--red-500);
}

.bg-red-600 {
    background-color: var(--red-600);
}

.bg-purple-600 {
    background-color: var(--purple-600);
}

.bg-black {
    background-color: var(--black);
}

.bg-opacity-50 {
    opacity: 0.5;
}

.p-2 {
    padding: 0.5rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-01 {
    padding-left: 0.4rem;
    padding-right: 0.2rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mr-1 {
    margin-right: 0.25rem;
}

.mr-3 {
    margin-right: 0.75rem;
}

.border {
    border: 1px solid var(--border-color);
}

.border-b {
    border-bottom: 1px solid var(--border-color);
}

.border-b-2 {
    border-bottom: 2px solid var(--border-color);
}

.border-gray-100 {
    border-color: var(--gray-100);
}

.border-gray-200 {
    border-color: var(--gray-200);
}

.border-gray-300 {
    border-color: var(--gray-300);
}

.border-blue-200 {
    border-color: var(--blue-200);
}

.border-blue-600 {
    border-color: var(--blue-600);
}

.border-collapse {
    border-collapse: collapse;
}

.rounded {
    border-radius: var(--radius-sm);
}

.rounded-lg {
    border-radius: var(--radius-md);
}

.rounded-full {
    border-radius: var(--radius-full);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

.sticky {
    position: sticky;
}

.hover\:bg-gray-50:hover {
    background-color: var(--gray-50);
}

.hover\:bg-gray-100:hover {
    background-color: var(--gray-100);
}

.hover\:bg-blue-50:hover {
    background-color: var(--blue-50);
}

.hover\:bg-blue-600:hover {
    background-color: var(--blue-600);
}

.hover\:bg-blue-700:hover {
    background-color: var(--blue-700);
}

.hover\:bg-green-600:hover {
    background-color: var(--green-600);
}

.hover\:bg-yellow-600:hover {
    background-color: var(--yellow-600);
}

.hover\:bg-red-600:hover {
    background-color: var(--red-600);
}

.hover\:bg-red-800:hover {
    background-color: var(--red-800);
}

.hover\:text-blue-800:hover {
    color: var(--blue-800);
}

.hover\:text-red-800:hover {
    color: var(--red-800);
}

.cursor-pointer {
    cursor: pointer;
}

.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.focus\:ring-blue-500:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.focus\:border-transparent:focus {
    border-color: transparent;
    outline: none;
}

.disabled\:opacity-50[disabled],
.disabled\:opacity-50[aria-disabled="true"] {
    opacity: 0.5;
    pointer-events: none;
}

.overflow-x-auto {
    overflow-x: auto;
}

.w-full {
    width: 100%;
}

.w-fulx {
    min-width: 80px;
}

.w-full_tb {
    min-width: 180px;
}

.w-half {
    max-width: 65px;
}

.w-bg {
    max-width: 220px;
}

.w-bigger {
    max-width: 90px;
}

.w-small {
    max-width: 50px;
}

.w-big {
    max-width: 120px;
}

.h-8 {
    height: 2rem;
}

.w-8 {
    width: 2rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

.table th,
.table td {
    border: 1px solid var(--gray-300);
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.95rem;
}

.table th {
    font-weight: 600;
    background: var(--gray-100);
}

.table tr:hover {
    background: var(--gray-50);
}

.export-btn {
    transition: all 0.2s ease;
    font-weight: 600;
}

.export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    font-size: 0.95rem;
    font-weight: 500;
    animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-in 4.7s;
    border-left: 4px solid #fff;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    display: inline-block;
    border-radius: 50%;
    height: 2rem;
    width: 2rem;
    border-bottom: 2px solid var(--blue-600);
    animation: spin 1s linear infinite;
}

.max-w-2xl {
    max-width: 42rem;
}

.max-h-60 {
    max-height: 15rem;
}

.max-h-96 {
    max-height: 24rem;
}

.max-h-80vh {
    max-height: 80vh;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

.underline {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .rota-container {
        padding: 0.75rem;
    }

    .clients-form-grid-three-col {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .clients-form-grid-two-col {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .px-8 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .text-2xl {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    .text-xl {
        font-size: 1.125rem;
        line-height: 1.5rem;
    }

    .table {
        font-size: 0.75rem;
    }

    .table th,
    .table td {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }

    .flex.gap-2 {
        flex-direction: column;
        width: 100%;
    }

    .flex.gap-2 button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .rota-container {
        padding: 0.5rem;
    }

    .text-2xl {
        font-size: 1.125rem;
        line-height: 1.5rem;
    }

    .text-xl {
        font-size: 1rem;
        line-height: 1.375rem;
    }

    .table {
        font-size: 0.7rem;
    }

    .table th,
    .table td {
        padding: 0.25rem 0.375rem;
        font-size: 0.7rem;
    }

    .notification {
        left: 0.5rem;
        right: 0.5rem;
        top: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-width: auto;
    }
}

@media (min-width: 1200px) {
    .rota-container {
        max-width: 1600px;
    }

    .clients-form-grid-three-col {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media print {

    .export-btn,
    .notification {
        display: none;
    }

    .table {
        font-size: 10pt;
    }

    .rota-container {
        padding: 0;
    }
}/* =====================================================================
   Clients Rota – professional, responsive styles
   Everything is scoped under .rt-root so it cannot clash with the
   global rota.css / w3.css used by the rest of the system.
   ===================================================================== */

.rt-root {
    --rt-ink: #0f172a;
    --rt-text: #1e293b;
    --rt-muted: #64748b;
    --rt-line: #e2e8f0;
    --rt-line-strong: #cbd5e1;
    --rt-surface: #ffffff;
    --rt-bg: #f8fafc;
    --rt-soft: #f1f5f9;
    --rt-accent: #6d28d9;
    --rt-accent-hover: #5b21b6;
    --rt-accent-soft: #f3effe;
    --rt-blue: #2563eb;
    --rt-green: #047857;
    --rt-green-soft: #d1fae5;
    --rt-amber: #b45309;
    --rt-amber-soft: #fef3c7;
    --rt-red: #b91c1c;
    --rt-red-soft: #fee2e2;
    --rt-radius: 10px;
    --rt-radius-sm: 6px;
    --rt-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
    --rt-shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.25);

    box-sizing: border-box;
    padding: 16px 20px 40px;
    color: var(--rt-text);
    font-size: 14px;
    line-height: 1.45;
}

.rt-root *,
.rt-root *::before,
.rt-root *::after {
    box-sizing: border-box;
}

.rt-root button {
    font-family: inherit;
}

.rt-root :focus-visible {
    outline: 2px solid var(--rt-accent);
    outline-offset: 2px;
}

/* ------------------------------ Icons ------------------------------ */

.rt-icon {
    width: 16px;
    height: 16px;
    flex: none;
}

/* ------------------------------ Cards ------------------------------ */

.rt-card {
    background: var(--rt-surface);
    border: 1px solid var(--rt-line);
    border-radius: var(--rt-radius);
    box-shadow: var(--rt-shadow);
    margin-bottom: 20px;
}

.rt-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--rt-line);
}

.rt-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
    color: var(--rt-ink);
}

.rt-card-sub {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--rt-muted);
}

.rt-card-body {
    padding: 18px;
}

/* ------------------------------ Page header ------------------------------ */

.rt-header {
    display: grid;
    grid-template-columns: auto minmax(260px, 560px) 1fr;
    align-items: center;
    gap: 16px 24px;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: var(--rt-surface);
    border: 1px solid var(--rt-line);
    border-left: 5px solid var(--rt-accent);
    border-radius: var(--rt-radius);
    box-shadow: var(--rt-shadow);
}

.rt-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--rt-ink);
    white-space: nowrap;
}

.rt-client-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
    padding: 6px 12px;
    background: var(--rt-accent-soft);
    border-radius: 999px;
    font-weight: 600;
    color: var(--rt-accent);
}

.rt-client-chip small {
    font-weight: 500;
    color: var(--rt-muted);
}

/* ------------------------------ Search ------------------------------ */

.rt-search {
    position: relative;
}

.rt-search-input {
    width: 100%;
    height: 40px;
    padding: 0 40px 0 38px;
    background: var(--rt-bg);
    border: 1px solid var(--rt-line-strong);
    border-radius: var(--rt-radius-sm);
    font-size: 14px;
    color: var(--rt-ink);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.rt-search-input:focus {
    outline: none;
    background: var(--rt-surface);
    border-color: var(--rt-accent);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}

.rt-search > .rt-icon {
    position: absolute;
    left: 12px;
    top: 12px;
    color: var(--rt-muted);
    pointer-events: none;
}

.rt-search-clear {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--rt-muted);
    cursor: pointer;
}

.rt-search-clear:hover {
    background: var(--rt-soft);
    color: var(--rt-red);
}

.rt-dropdown {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--rt-surface);
    border: 1px solid var(--rt-line);
    border-radius: var(--rt-radius);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

.rt-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--rt-radius-sm);
    cursor: pointer;
}

.rt-option[aria-selected="true"],
.rt-option:hover {
    background: var(--rt-accent-soft);
}

.rt-option-name {
    font-weight: 600;
    color: var(--rt-ink);
}

.rt-option-meta {
    font-size: 12.5px;
    color: var(--rt-muted);
}

.rt-dropdown-note {
    padding: 14px;
    text-align: center;
    color: var(--rt-muted);
}

/* ------------------------------ Buttons ------------------------------ */

.rt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--rt-radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, transform 0.05s;
}

.rt-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.rt-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.rt-btn-primary {
    background: var(--rt-accent);
    color: #fff;
}

.rt-btn-primary:hover:not(:disabled) {
    background: var(--rt-accent-hover);
}

.rt-btn-ghost {
    background: var(--rt-surface);
    border-color: var(--rt-line-strong);
    color: var(--rt-text);
}

.rt-btn-ghost:hover:not(:disabled) {
    background: var(--rt-soft);
}

.rt-btn-danger {
    background: var(--rt-red);
    color: #fff;
}

.rt-btn-danger:hover:not(:disabled) {
    background: #991b1b;
}

.rt-btn-sm {
    height: 30px;
    padding: 0 10px;
    font-size: 12.5px;
}

.rt-btn-tone-blue {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--rt-blue);
}

.rt-btn-tone-teal {
    background: #f0fdfa;
    border-color: #99f6e4;
    color: #0f766e;
}

.rt-btn-tone-amber {
    background: var(--rt-amber-soft);
    border-color: #fde68a;
    color: var(--rt-amber);
}

.rt-btn-tone-green {
    background: var(--rt-green-soft);
    border-color: #6ee7b7;
    color: var(--rt-green);
}

.rt-btn-tone-red {
    background: var(--rt-red-soft);
    border-color: #fecaca;
    color: var(--rt-red);
}

.rt-btn-tone-blue:hover:not(:disabled),
.rt-btn-tone-teal:hover:not(:disabled),
.rt-btn-tone-amber:hover:not(:disabled),
.rt-btn-tone-green:hover:not(:disabled),
.rt-btn-tone-red:hover:not(:disabled) {
    filter: brightness(0.96);
}

.rt-icon-btn {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--rt-line);
    border-radius: var(--rt-radius-sm);
    background: var(--rt-surface);
    color: var(--rt-muted);
    cursor: pointer;
}

.rt-icon-btn:hover {
    background: var(--rt-red-soft);
    color: var(--rt-red);
    border-color: #fecaca;
}

/* ------------------------------ Forms ------------------------------ */

.rt-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.rt-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--rt-muted);
}

.rt-input,
.rt-select,
.rt-textarea {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    background: var(--rt-surface);
    border: 1px solid var(--rt-line-strong);
    border-radius: var(--rt-radius-sm);
    font-size: 13.5px;
    color: var(--rt-ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rt-textarea {
    height: auto;
    padding: 9px 10px;
    resize: vertical;
}

.rt-input:focus,
.rt-select:focus,
.rt-textarea:focus {
    outline: none;
    border-color: var(--rt-accent);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}

.rt-input[readonly],
.rt-input:disabled {
    background: var(--rt-soft);
    color: var(--rt-muted);
}

.rt-period {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px));
    gap: 14px;
    margin-bottom: 16px;
}

.rt-row {
    padding: 14px;
    margin-bottom: 12px;
    background: var(--rt-bg);
    border: 1px solid var(--rt-line);
    border-radius: var(--rt-radius);
}

.rt-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 650;
    color: var(--rt-ink);
}

.rt-row-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.rt-days {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.rt-day {
    min-width: 46px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--rt-line-strong);
    border-radius: 999px;
    background: var(--rt-surface);
    color: var(--rt-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
}

.rt-day[aria-pressed="true"] {
    background: var(--rt-accent);
    border-color: var(--rt-accent);
    color: #fff;
}

.rt-link {
    border: 0;
    background: none;
    padding: 4px 6px;
    color: var(--rt-accent);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.rt-link:hover {
    text-decoration: underline;
}

.rt-form-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

/* ------------------------------ Summary chips ------------------------------ */

.rt-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rt-stat {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--rt-soft);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--rt-muted);
}

.rt-stat b {
    color: var(--rt-ink);
}

/* ------------------------------ Table ------------------------------ */

.rt-table-wrap {
    overflow-x: auto;
}

.rt-table {
    width: 100%;
    border-collapse: collapse;
}

.rt-table th {
    padding: 10px 14px;
    text-align: left;
    background: var(--rt-soft);
    border-bottom: 1px solid var(--rt-line);
    font-size: 12px;
    font-weight: 650;
    color: var(--rt-muted);
    white-space: nowrap;
}

.rt-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--rt-line);
    vertical-align: middle;
}

.rt-table tbody tr:hover {
    background: #fafafe;
}

.rt-table tbody tr.is-disabled {
    background: #fffbeb;
}

.rt-call-name {
    font-weight: 650;
    color: var(--rt-ink);
}

.rt-call-sub {
    font-size: 12.5px;
    color: var(--rt-muted);
}

.rt-week {
    display: inline-flex;
    gap: 3px;
}

.rt-week span {
    width: 26px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 650;
    background: var(--rt-soft);
    color: #94a3b8;
}

.rt-week span.on {
    background: var(--rt-accent-soft);
    color: var(--rt-accent);
}

.rt-time {
    font-weight: 650;
    color: var(--rt-ink);
    font-variant-numeric: tabular-nums;
}

.rt-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
}

.rt-badge-active {
    background: var(--rt-green-soft);
    color: var(--rt-green);
}

.rt-badge-off {
    background: var(--rt-amber-soft);
    color: var(--rt-amber);
}

.rt-badge-neutral {
    background: var(--rt-soft);
    color: var(--rt-text);
}

.rt-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.rt-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 18px;
    color: var(--rt-muted);
    font-size: 12.5px;
}

/* ------------------------------ Empty / loading ------------------------------ */

.rt-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--rt-muted);
}

.rt-empty strong {
    display: block;
    margin-bottom: 4px;
    color: var(--rt-ink);
    font-size: 15px;
}

.rt-skeleton {
    height: 52px;
    margin: 10px 18px;
    border-radius: var(--rt-radius-sm);
    background: linear-gradient(90deg, var(--rt-soft) 25%, #e8edf3 37%, var(--rt-soft) 63%);
    background-size: 400% 100%;
    animation: rt-shimmer 1.4s ease infinite;
}

.rt-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rt-spin 0.7s linear infinite;
}

.rt-spinner.dark {
    border-color: var(--rt-line-strong);
    border-top-color: var(--rt-accent);
}

@keyframes rt-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes rt-shimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

/* ------------------------------ Modal ------------------------------ */

.rt-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
    animation: rt-fade 0.15s ease;
}

.rt-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 32px);
    background: var(--rt-surface);
    border-radius: 12px;
    box-shadow: var(--rt-shadow-lg);
    color: var(--rt-text);
    animation: rt-pop 0.18s ease;
}

.rt-modal.wide {
    max-width: 860px;
}

.rt-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--rt-line);
}

.rt-modal-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--rt-ink);
}

.rt-modal-head p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--rt-muted);
}

.rt-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
}

.rt-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--rt-line);
    background: var(--rt-bg);
    border-radius: 0 0 12px 12px;
}

.rt-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    padding: 12px;
    margin-top: 14px;
    background: var(--rt-bg);
    border: 1px solid var(--rt-line);
    border-radius: var(--rt-radius-sm);
}

.rt-info dt {
    font-size: 12px;
    color: var(--rt-muted);
}

.rt-info dd {
    margin: 0;
    font-weight: 650;
    color: var(--rt-ink);
}

.rt-error-text {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: var(--rt-red);
}

@keyframes rt-fade {
    from {
        opacity: 0;
    }
}

@keyframes rt-pop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
}

/* ------------------------------ Toasts ------------------------------ */

.rt-toasts {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(420px, calc(100vw - 32px));
}

.rt-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--rt-ink);
    border-left: 4px solid var(--rt-green);
    border-radius: var(--rt-radius-sm);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.3);
    color: #fff;
    font-size: 13.5px;
    animation: rt-pop 0.2s ease;
}

.rt-toast.error {
    border-left-color: #f87171;
}

.rt-toast button {
    margin-left: auto;
    border: 0;
    background: none;
    color: #94a3b8;
    cursor: pointer;
}

/* ------------------------------ Tablet ------------------------------ */

@media (max-width: 1024px) {
    .rt-header {
        grid-template-columns: 1fr;
    }

    .rt-client-chip {
        justify-self: start;
    }
}

/* ------------------------------ Mobile ------------------------------ */

@media (max-width: 768px) {
    .rt-root {
        padding: 10px 10px 32px;
    }

    .rt-card-body {
        padding: 14px;
    }

    .rt-period {
        grid-template-columns: 1fr 1fr;
    }

    .rt-row-grid {
        grid-template-columns: 1fr 1fr;
    }

    .rt-form-actions .rt-btn {
        flex: 1;
    }

    /* Table turns into stacked cards */
    .rt-table thead {
        display: none;
    }

    .rt-table,
    .rt-table tbody,
    .rt-table tr,
    .rt-table td {
        display: block;
        width: 100%;
    }

    .rt-table tbody {
        padding: 10px;
    }

    .rt-table tr {
        margin-bottom: 12px;
        border: 1px solid var(--rt-line);
        border-radius: var(--rt-radius);
        overflow: hidden;
    }

    .rt-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 12px;
        text-align: right;
    }

    .rt-table td:last-child {
        border-bottom: 0;
    }

    .rt-table td::before {
        content: attr(data-label);
        flex: none;
        font-size: 12px;
        font-weight: 650;
        color: var(--rt-muted);
        text-align: left;
    }

    .rt-table td[data-label=""]::before {
        display: none;
    }

    .rt-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .rt-modal.wide {
        max-width: 100%;
    }

    .rt-modal-foot .rt-btn {
        flex: 1;
    }

    .rt-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .rt-modal {
        max-height: 92vh;
        border-radius: 14px 14px 0 0;
    }
}

@media (max-width: 480px) {
    .rt-row-grid {
        grid-template-columns: 1fr;
    }

    .rt-day {
        flex: 1;
        min-width: 40px;
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    .rt-root *,
    .rt-overlay,
    .rt-modal,
    .rt-toast {
        animation: none !important;
        transition: none !important;
    }
}

/* =====================================================================
   Sidebar layout (client list + rota workspace)
   ===================================================================== */

.rt-root {
    padding-bottom: 16px;
}

.rt-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px;
    height: calc(100vh - 220px); /* fallback only: JS sets the exact height */
    min-height: 480px;
    transition: grid-template-columns 0.2s ease;
}

.rt-layout.is-collapsed {
    grid-template-columns: 76px minmax(0, 1fr);
}

/* ---------- Sidebar ---------- */

.rt-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--rt-surface);
    border: 1px solid var(--rt-line);
    border-radius: 14px;
    box-shadow: var(--rt-shadow);
    overflow: hidden;
}

.rt-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px 16px;
}

.rt-side-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rt-ink);
}

.rt-side-toggle {
    width: 34px;
    height: 34px;
}

.rt-side-toggle:hover {
    background: var(--rt-accent-soft);
    color: var(--rt-accent);
    border-color: var(--rt-accent-soft);
}

.rt-side-search {
    position: relative;
    margin: 0 14px;
}

.rt-side-search > .rt-icon {
    position: absolute;
    left: 12px;
    top: 13px;
    color: var(--rt-muted);
    pointer-events: none;
}

.rt-side-search input {
    width: 100%;
    height: 40px;
    padding: 0 34px 0 36px;
    background: var(--rt-bg);
    border: 1px solid var(--rt-line);
    border-radius: 10px;
    font-size: 13.5px;
    color: var(--rt-ink);
}

.rt-side-search input:focus {
    outline: none;
    background: var(--rt-surface);
    border-color: var(--rt-accent);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}

.rt-side-clear {
    position: absolute;
    right: 6px;
    top: 7px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--rt-muted);
    cursor: pointer;
}

.rt-side-clear:hover {
    background: var(--rt-soft);
}

.rt-side-count {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-top: 10px;
    border-bottom: 1px solid var(--rt-line);
    font-size: 12.5px;
    color: var(--rt-muted);
}

.rt-side-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
}

.rt-side-list,
.rt-rail-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rt-client {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
}

.rt-client:hover {
    background: var(--rt-soft);
}

.rt-client.is-selected {
    background: var(--rt-accent-soft);
}

.rt-client-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.rt-client-name {
    font-weight: 600;
    color: var(--rt-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rt-client-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: var(--rt-muted);
}

.rt-client-meta .rt-icon {
    width: 13px;
    height: 13px;
}

/* ---------- Avatars ---------- */

.rt-avatar {
    flex: none;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--rt-accent-soft);
    color: var(--rt-accent);
    font-size: 12px;
    font-weight: 700;
    transition: background 0.12s, color 0.12s;
}

button.rt-avatar {
    cursor: pointer;
}

button.rt-avatar:hover {
    background: #e6dcfb;
}

.rt-avatar.is-selected {
    background: var(--rt-accent);
    color: #fff;
}

.rt-client:hover .rt-avatar:not(.is-selected) {
    background: #e6dcfb;
}

.rt-avatar-lg {
    width: 46px;
    height: 46px;
    font-size: 14px;
}

/* ---------- Collapsed rail ---------- */

.rt-rail {
    align-items: center;
    padding: 12px 0;
    gap: 10px;
}

.rt-rail-search {
    flex: none;
}

.rt-rail-list {
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.rt-rail-current {
    display: none;
}

/* ---------- Main workspace ---------- */

.rt-main {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
    background: var(--rt-surface);
    border: 1px solid var(--rt-line);
    border-radius: 14px;
    box-shadow: var(--rt-shadow);
}

.rt-main-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--rt-line);
}

.rt-main-head .rt-title {
    white-space: normal;
}

.rt-empty-hero {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 40px 16px;
    text-align: center;
}

.rt-empty-hero strong {
    font-size: 16px;
    color: var(--rt-ink);
}

.rt-empty-hero p {
    margin: 0 0 8px;
    max-width: 320px;
    color: var(--rt-muted);
}

.rt-empty-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin-bottom: 8px;
    border-radius: 50%;
    background: var(--rt-accent-soft);
    color: var(--rt-accent);
}

.rt-empty-icon .rt-icon {
    width: 24px;
    height: 24px;
}

/* ---------- Tablet / mobile: sidebar becomes a top panel ---------- */

@media (max-width: 900px) {

    .rt-layout,
    .rt-layout.is-collapsed {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        height: auto;
        min-height: 0;
    }

    .rt-side-scroll {
        max-height: 300px;
    }

    .rt-main {
        overflow: visible;
        padding: 14px;
    }

    .rt-side-toggle .rt-icon {
        transform: rotate(90deg);
    }

    /* collapsed = slim bar showing the selected client */
    .rt-rail {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
    }

    .rt-rail-list,
    .rt-rail-search {
        display: none;
    }

    .rt-rail-current {
        display: flex;
        flex: 1;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }

    .rt-rail-name {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 600;
        color: var(--rt-ink);
    }

    .rt-rail .rt-side-toggle {
        order: 2;
    }

    .rt-empty-hero {
        padding: 28px 12px;
    }
}

/* =====================================================================
   Slim scrollbars (matches the Risk Assessment look)
   Applies only inside the rota section.
   ===================================================================== */

.rt-root {
    --rt-scroll-thumb: #cfc3f3;
    --rt-scroll-thumb-hover: #a78bfa;
}

/* Modern browsers / current Electron: thin bar, no arrow buttons */
@supports (scrollbar-color: auto) {

    .rt-main,
    .rt-side-scroll,
    .rt-rail-list,
    .rt-table-wrap,
    .rt-modal-body,
    .rt-dropdown {
        scrollbar-width: thin;
        scrollbar-color: var(--rt-scroll-thumb) transparent;
    }
}

/* Older Chromium / Safari fallback */
@supports not (scrollbar-color: auto) {

    .rt-main::-webkit-scrollbar,
    .rt-side-scroll::-webkit-scrollbar,
    .rt-rail-list::-webkit-scrollbar,
    .rt-table-wrap::-webkit-scrollbar,
    .rt-modal-body::-webkit-scrollbar,
    .rt-dropdown::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    .rt-main::-webkit-scrollbar-track,
    .rt-side-scroll::-webkit-scrollbar-track,
    .rt-rail-list::-webkit-scrollbar-track,
    .rt-table-wrap::-webkit-scrollbar-track,
    .rt-modal-body::-webkit-scrollbar-track,
    .rt-dropdown::-webkit-scrollbar-track {
        background: transparent;
    }

    .rt-main::-webkit-scrollbar-thumb,
    .rt-side-scroll::-webkit-scrollbar-thumb,
    .rt-rail-list::-webkit-scrollbar-thumb,
    .rt-table-wrap::-webkit-scrollbar-thumb,
    .rt-modal-body::-webkit-scrollbar-thumb,
    .rt-dropdown::-webkit-scrollbar-thumb {
        background: var(--rt-scroll-thumb);
        border: 2px solid transparent;
        background-clip: content-box;
        border-radius: 999px;
    }

    .rt-main::-webkit-scrollbar-thumb:hover,
    .rt-side-scroll::-webkit-scrollbar-thumb:hover,
    .rt-rail-list::-webkit-scrollbar-thumb:hover,
    .rt-table-wrap::-webkit-scrollbar-thumb:hover,
    .rt-modal-body::-webkit-scrollbar-thumb:hover,
    .rt-dropdown::-webkit-scrollbar-thumb:hover {
        background: var(--rt-scroll-thumb-hover);
        background-clip: content-box;
    }

    .rt-main::-webkit-scrollbar-button,
    .rt-side-scroll::-webkit-scrollbar-button,
    .rt-rail-list::-webkit-scrollbar-button,
    .rt-table-wrap::-webkit-scrollbar-button,
    .rt-modal-body::-webkit-scrollbar-button,
    .rt-dropdown::-webkit-scrollbar-button {
        display: none;
    }
}/* ==========================================================================
   Activities page  (all selectors prefixed .act-, tokens scoped to the page
   and to the portalled overlay so nothing leaks into the rest of the app)
   ========================================================================== */

.act-page,
.act-overlay,
.act-toast {
  --act-purple: #a021c4;
  --act-purple-dark: #7e17a0;
  --act-purple-soft: #faf0fd;
  --act-blue: #2563eb;
  --act-blue-dark: #1d4ed8;
  --act-green: #16a34a;
  --act-danger: #dc2626;
  --act-danger-bg: #fef2f2;
  --act-ink: #0f172a;
  --act-ink-2: #475569;
  --act-muted: #94a3b8;
  --act-line: #e2e8f0;
  --act-line-strong: #cbd5e1;
  --act-surface: #ffffff;
  --act-subtle: #f8fafc;
  --act-page: #f1f5f9;
  --act-radius: 10px;
  --act-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 2px 6px rgba(15, 23, 42, 0.04);
  --act-shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.35);
  --act-ease: cubic-bezier(0.4, 0, 0.2, 1);

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.act-page *,
.act-page *::before,
.act-page *::after,
.act-overlay *,
.act-overlay *::before,
.act-overlay *::after { box-sizing: border-box; }

.act-page button,
.act-overlay button { font: inherit; cursor: pointer; }

/* ==========================================================================
   NO RIGHT-HAND SCROLLBAR
   1. The window itself never scrolls while this page is open (works in the
      browser and in Electron). The JS hook also locks any scrolling parent.
   2. Anything that still scrolls inside the page (table, cards, lists,
      modals) keeps working with wheel / touch / keyboard, but its scrollbar
      is hidden.
   ========================================================================== */
html:has(.act-page),
body:has(.act-page) {
  overflow: hidden !important;
}

html:has(.act-page)::-webkit-scrollbar,
body:has(.act-page)::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.act-page,
.act-table-wrap,
.act-cards,
.act-assigned,
.act-stats,
.act-modal-body,
.act-client-list {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* old Edge / IE */
}

.act-page::-webkit-scrollbar,
.act-table-wrap::-webkit-scrollbar,
.act-cards::-webkit-scrollbar,
.act-assigned::-webkit-scrollbar,
.act-stats::-webkit-scrollbar,
.act-modal-body::-webkit-scrollbar,
.act-client-list::-webkit-scrollbar {
  display: none;                  /* Chrome, Edge, Electron, Safari */
  width: 0;
  height: 0;
}

/* ---------- Page shell ---------- */
/* The height is set by useFitToViewport (--act-fit-h) = window height minus
   whatever sits above the page. The fallback keeps it sane before JS runs. */
.act-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  height: var(--act-fit-h, calc(100vh - 110px));
  padding: 16px 20px;
  overflow-x: hidden;
  overflow-y: auto;               /* only used as a safety net on tiny windows */
  background: var(--act-page);
  color: var(--act-ink);
}

.act-page > * { flex: none; }

.act-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.act-header h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.act-header p { margin: 4px 0 0; font-size: 14px; color: var(--act-ink-2); max-width: 560px; }

/* ---------- Stats ---------- */
.act-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.act-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--act-surface);
  border: 1px solid var(--act-line);
  border-radius: var(--act-radius);
  box-shadow: var(--act-shadow-sm);
}

.act-stat small { display: block; font-size: 12.5px; color: var(--act-ink-2); }
.act-stat strong { display: block; margin-top: 2px; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }

.act-stat-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: #fff;
}

.act-tone-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.act-tone-purple { background: linear-gradient(135deg, #c026d3, #7e17a0); }
.act-tone-green { background: linear-gradient(135deg, #10b981, #059669); }

/* ---------- Panel / toolbar ---------- */
/* The panel takes all the remaining height; its list/table scrolls inside. */
.act-page > .act-panel { flex: 1 1 auto; min-height: 0; }

.act-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  background: var(--act-surface);
  border: 1px solid var(--act-line);
  border-radius: 14px;
  box-shadow: var(--act-shadow-sm);
}

.act-panel > * { flex: none; }

.act-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.act-toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 320px; justify-content: flex-end; min-width: 0; }

.act-tabs { display: inline-flex; padding: 4px; gap: 4px; background: var(--act-page); border-radius: 12px; }

.act-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--act-ink-2);
  font-size: 13.5px;
  font-weight: 600;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.act-tab:hover:not(.is-active) { color: var(--act-ink); }
.act-tab.is-active { background: var(--act-surface); color: var(--act-purple-dark); box-shadow: var(--act-shadow-sm); }

.act-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--act-line);
  color: var(--act-ink-2);
  font-size: 11.5px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.act-tab.is-active .act-count { background: var(--act-purple); color: #fff; }

/* ---------- Search ---------- */
.act-search { position: relative; display: flex; align-items: center; flex: 1 1 240px; max-width: 380px; min-width: 0; }

.act-search input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 36px;
  border: 1.5px solid var(--act-line);
  border-radius: 999px;
  background: var(--act-subtle);
  color: var(--act-ink);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s var(--act-ease);
}

.act-search input::placeholder { color: var(--act-muted); }
.act-search input:focus { background: #fff; border-color: var(--act-purple); box-shadow: 0 0 0 4px rgba(160, 33, 196, 0.1); }
.act-search-icon { position: absolute; left: 13px; color: var(--act-muted); pointer-events: none; }
.act-search:focus-within .act-search-icon { color: var(--act-purple); }
.act-search--sm { max-width: none; flex: none; width: 100%; }
.act-search--sm input { height: 36px; }

.act-search-clear {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: var(--act-line);
  color: var(--act-ink-2);
}

.act-search-clear:hover { background: var(--act-line-strong); color: var(--act-ink); }

/* ---------- Buttons ---------- */
.act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s, box-shadow 0.15s, transform 0.1s, border-color 0.15s;
}

.act-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.act-btn:active:not(:disabled) { transform: translateY(1px); }
.act-btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.act-btn--icon { width: 38px; padding: 0; }

.act-btn--primary { background: var(--act-blue); color: #fff; }
.act-btn--primary:hover:not(:disabled) { background: var(--act-blue-dark); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3); }
.act-btn--ghost { background: var(--act-subtle); border-color: var(--act-line-strong); color: var(--act-ink-2); }
.act-btn--ghost:hover:not(:disabled) { background: var(--act-line); }
.act-btn--danger { background: var(--act-danger); color: #fff; }
.act-btn--danger:hover:not(:disabled) { background: #b91c1c; }
.act-btn--danger-ghost { background: var(--act-surface); border-color: #fecaca; color: var(--act-danger); }
.act-btn--danger-ghost:hover:not(:disabled) { background: var(--act-danger-bg); }

.act-icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--act-ink-2);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.act-icon-btn:hover:not(:disabled) { background: var(--act-page); color: var(--act-ink); border-color: var(--act-line); }
.act-icon-btn--danger:hover:not(:disabled) { background: var(--act-danger-bg); color: var(--act-danger); border-color: #fecaca; }
.act-icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.act-link-btn { border: 0; background: none; padding: 0; color: var(--act-blue); font-size: 13px; font-weight: 600; }
.act-link-btn:hover { text-decoration: underline; }

/* ---------- Selection bar & banner ---------- */
.act-selection {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e9c5f5;
  border-radius: var(--act-radius);
  background: var(--act-purple-soft);
  color: var(--act-purple-dark);
  font-size: 14px;
  animation: act-drop 0.18s var(--act-ease);
}

.act-selection-actions { display: flex; gap: 8px; }

.act-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: var(--act-radius);
  background: var(--act-danger-bg);
  color: #991b1b;
  font-size: 13.5px;
}

.act-banner span { flex: 1 1 200px; }

/* ---------- Table ---------- */
/* Fills whatever height the panel has left and scrolls inside itself
   (scrollbar hidden above). The header row stays sticky. */
.act-table-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 160px;
  overflow: auto;
  border: 1px solid var(--act-line);
  border-radius: var(--act-radius);
}

.act-table { width: 100%; min-width: 760px; border-collapse: collapse; }

.act-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.act-table thead th:not(:has(.act-th-btn)) { padding: 14px 14px; }

.act-th-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
}

.act-th-btn:hover { background: rgba(255, 255, 255, 0.08); }

.act-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 13.5px;
  color: var(--act-ink);
}

.act-table tbody tr { transition: background-color 0.12s; }
.act-table tbody tr:hover { background: var(--act-subtle); }
.act-table tbody tr.is-selected { background: var(--act-purple-soft); }
.act-table tbody tr:last-child td { border-bottom: 0; }

.act-col-select { width: 48px; text-align: center; }
.act-col-name { min-width: 240px; }
.act-col-desc { min-width: 240px; }
.act-col-date { width: 130px; white-space: nowrap; color: var(--act-ink-2); }
.act-col-actions { width: 96px; text-align: right; }
.act-table thead th.act-col-actions { text-align: right; }
.act-table thead th.act-col-select { text-align: center; }

.act-cell-name { font-weight: 600; }

.act-cell-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--act-ink-2);
}

.act-muted { color: var(--act-muted); }
.act-row-actions { display: inline-flex; gap: 4px; }

.act-check { width: 17px; height: 17px; accent-color: var(--act-purple); cursor: pointer; }

/* ---------- Cards (mobile) ---------- */
.act-cards { display: none; }

.act-card {
  padding: 14px;
  border: 1px solid var(--act-line);
  border-radius: var(--act-radius);
  background: var(--act-surface);
}

.act-card.is-selected { border-color: #e9c5f5; background: var(--act-purple-soft); }
.act-card-top { display: flex; align-items: flex-start; gap: 12px; }
.act-card-top h3 { margin: 0; font-size: 15px; line-height: 1.35; font-weight: 700; }
.act-card-desc { margin: 8px 0 0 29px; font-size: 13.5px; color: var(--act-ink-2); }
.act-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0 29px; font-size: 12.5px; color: var(--act-ink-2); }
.act-card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.act-card-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--act-line); }

/* ---------- Assigned (accordion) ---------- */
/* Same idea as the table: fills the panel and scrolls inside it. */
.act-assigned {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 160px;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.act-assigned > * { flex: none; }

.act-group { border: 1px solid var(--act-line); border-radius: var(--act-radius); overflow: hidden; background: var(--act-surface); }

.act-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: var(--act-subtle);
  color: inherit;
  text-align: left;
  transition: background-color 0.15s;
}

.act-group-head:hover { background: #eef2f7; }

.act-group-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.act-group-title strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-group-title small { font-size: 12px; color: var(--act-ink-2); }

.act-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
}

.act-badge {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--act-purple-soft);
  color: var(--act-purple-dark);
  font-size: 12px;
  font-weight: 600;
}

.act-badge--soft { background: var(--act-line); color: var(--act-ink-2); margin-left: auto; }

.act-caret { flex: none; color: var(--act-muted); transition: transform 0.18s var(--act-ease); }
.act-caret.is-open { transform: rotate(90deg); }

.act-group-body { border-top: 1px solid var(--act-line); }
.act-type { border-bottom: 1px solid var(--act-line); }
.act-type:last-child { border-bottom: 0; }

.act-type-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px 10px 44px;
  border: 0;
  background: var(--act-surface);
  color: var(--act-ink);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
}

.act-type-head:hover { background: var(--act-subtle); }
.act-type-icon { color: var(--act-purple); }

.act-items { margin: 0; padding: 0 14px 8px 74px; list-style: none; }

.act-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #f1f5f9;
}

.act-item:first-child { border-top: 0; }
.act-item-text { min-width: 0; }
.act-item-text strong { font-size: 13.5px; }
.act-item-text p { margin: 3px 0 0; font-size: 13px; color: var(--act-ink-2); overflow-wrap: anywhere; }
.act-item-text p.act-muted { color: var(--act-muted); }

/* ---------- Empty / skeleton ---------- */
.act-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; text-align: center; color: var(--act-ink-2); font-size: 14px; }
.act-empty svg { color: var(--act-muted); }
.act-empty p { margin: 0; }

.act-skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #eef1f6 25%, #f8fafc 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: act-shimmer 1.3s ease infinite;
}

.act-skeleton--row { height: 38px; width: 100%; }
.act-skeleton--stat { display: block; height: 24px; width: 46px; margin-top: 2px; }
.act-skeleton--card { height: 120px; border-radius: var(--act-radius); }
.act-skeleton--group { height: 60px; border-radius: var(--act-radius); }

/* ---------- Pagination ---------- */
.act-pagination { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--act-line); }
.act-pagination-left { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.act-pagination-info { font-size: 13px; font-weight: 500; color: var(--act-ink-2); }
.act-per-page { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--act-ink-2); }

.act-per-page select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--act-line-strong);
  border-radius: 8px;
  background: var(--act-surface);
  color: var(--act-ink);
  font: inherit;
  font-size: 13px;
}

.act-pagination-nav { display: flex; align-items: center; gap: 6px; }
.act-page-numbers { display: flex; align-items: center; gap: 6px; }
.act-page-summary { display: none; font-size: 13px; color: var(--act-ink-2); }
.act-page-ellipsis { padding: 0 4px; color: var(--act-muted); }

.act-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--act-line);
  border-radius: 8px;
  background: var(--act-surface);
  color: var(--act-ink-2);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.act-page-btn:hover:not(:disabled):not(.is-active) { background: var(--act-subtle); color: var(--act-ink); }
.act-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.act-page-btn.is-active { background: var(--act-purple); border-color: var(--act-purple); color: #fff; font-weight: 600; }

@media (min-width: 900px) { .act-pagination { flex-direction: row; } }

/* ==========================================================================
   Modals (portalled)
   ========================================================================== */
.act-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  animation: act-fade 0.18s ease-out;
}

.act-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(90vh, 820px);
  overflow: hidden;
  background: var(--act-surface);
  color: var(--act-ink);
  border-radius: 16px;
  box-shadow: var(--act-shadow-lg);
  animation: act-rise 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.act-modal--sm { max-width: 420px; }
.act-modal--md { max-width: 560px; }
.act-modal--lg { max-width: 880px; }

.act-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--act-line);
}

.act-modal-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.act-modal-head p { margin: 4px 0 0; font-size: 13px; color: var(--act-ink-2); }

.act-modal-body { flex: 1; min-height: 0; padding: 18px 20px; overflow-y: auto; overscroll-behavior: contain; }

.act-modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--act-line);
  background: var(--act-subtle);
}

.act-foot-note { margin-right: auto; font-size: 13px; color: var(--act-ink-2); }

/* ---------- Forms ---------- */
.act-form { display: flex; flex-direction: column; gap: 16px; }
.act-field { display: flex; flex-direction: column; gap: 6px; }
.act-field--narrow { max-width: 220px; }
.act-field label { font-size: 13px; font-weight: 600; }
.act-req { color: var(--act-danger); }
.act-opt { font-weight: 400; color: var(--act-muted); }

.act-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--act-line-strong);
  border-radius: var(--act-radius);
  background: var(--act-surface);
  color: var(--act-ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.act-input::placeholder { color: var(--act-muted); }
.act-input:focus { border-color: var(--act-purple); box-shadow: 0 0 0 4px rgba(160, 33, 196, 0.12); }
.act-input.has-error { border-color: var(--act-danger); background: var(--act-danger-bg); }
.act-textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }

.act-error { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 12px; font-weight: 500; color: var(--act-danger); }

.act-facts { display: grid; gap: 8px; margin: 0; padding: 12px 14px; border-radius: var(--act-radius); background: var(--act-subtle); border: 1px solid var(--act-line); }
.act-facts div { display: flex; gap: 12px; font-size: 13.5px; }
.act-facts dt { flex: 0 0 80px; color: var(--act-ink-2); }
.act-facts dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Assign modal ---------- */
.act-assign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.act-assign-col { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.act-sub { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--act-purple-dark); }
.act-sub--spaced { margin-top: 8px; }
.act-sub-row { display: flex; align-items: center; justify-content: space-between; }

.act-client-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  padding: 4px;
  overflow-y: auto;
  border: 1px solid var(--act-line);
  border-radius: var(--act-radius);
}

.act-client-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background-color 0.12s, border-color 0.12s;
}

.act-client-row:hover { background: var(--act-subtle); }
.act-client-row.is-selected { background: var(--act-purple-soft); border-color: #e9c5f5; }
.act-client-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.act-client-text strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-client-text small { font-size: 12px; color: var(--act-ink-2); }
.act-client-check { color: var(--act-purple); flex: none; }

.act-list-state { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 22px 12px; font-size: 13px; color: var(--act-ink-2); text-align: center; }
.act-list-state--error { color: var(--act-danger); }
.act-list-state--box { border: 1px dashed var(--act-line-strong); border-radius: var(--act-radius); }

.act-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.act-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1.5px solid var(--act-line-strong);
  border-radius: 999px;
  background: var(--act-surface);
  color: var(--act-ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.act-chip input { position: absolute; opacity: 0; pointer-events: none; }
.act-chip:hover { border-color: var(--act-purple); }
.act-chip.is-on { background: var(--act-purple); border-color: var(--act-purple); color: #fff; }
.act-chip:has(input:focus-visible) { outline: 2px solid var(--act-purple); outline-offset: 2px; }

/* ---------- Confirm ---------- */
.act-confirm { display: flex; gap: 14px; align-items: flex-start; }
.act-confirm p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--act-ink-2); }
.act-confirm strong { color: var(--act-ink); }
.act-confirm-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--act-danger-bg); color: var(--act-danger); }

/* ---------- Toast ---------- */
.act-toast {
  position: fixed;
  top: 88px;
  right: 20px;
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--act-line);
  border-left-width: 4px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  font-size: 13.5px;
  color: var(--act-ink);
  animation: act-slide-in 0.22s var(--act-ease);
}

.act-toast--success { border-left-color: var(--act-green); }
.act-toast--success > svg { color: var(--act-green); }
.act-toast--error { border-left-color: var(--act-danger); }
.act-toast--error > svg { color: var(--act-danger); }
.act-toast span { flex: 1; }
.act-toast > svg { flex: none; }
.act-toast button { display: grid; place-items: center; border: 0; background: transparent; color: var(--act-muted); padding: 4px; border-radius: 6px; cursor: pointer; }
.act-toast button:hover { background: var(--act-page); color: var(--act-ink); }

/* ---------- Focus & motion ---------- */
.act-page button:focus-visible,
.act-overlay button:focus-visible,
.act-page select:focus-visible,
.act-page input:focus-visible { outline: 2px solid var(--act-purple); outline-offset: 2px; }

.act-spin { animation: act-spin 0.9s linear infinite; }

@keyframes act-spin { to { transform: rotate(360deg); } }
@keyframes act-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes act-rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes act-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes act-slide-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes act-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (prefers-reduced-motion: reduce) {
  .act-spin, .act-skeleton, .act-overlay, .act-modal, .act-toast, .act-selection { animation: none !important; }
  .act-caret, .act-btn, .act-chip { transition: none !important; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .act-page { padding: 14px; gap: 12px; }
  .act-panel { padding: 12px; }

  .act-table-wrap { display: none; }

  /* cards fill the panel and scroll inside it (scrollbar hidden) */
  .act-cards {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 160px;
    gap: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .act-cards > * { flex: none; }

  .act-toolbar-right { flex-basis: 100%; justify-content: stretch; }
  .act-search { max-width: none; flex: 1 1 200px; }

  .act-items { padding-left: 44px; }
  .act-type-head { padding-left: 30px; }
}

@media (max-width: 720px) {
  .act-assign-grid { grid-template-columns: 1fr; gap: 20px; }
  .act-client-list { max-height: 220px; }
}

@media (max-width: 640px) {
  .act-header { align-items: stretch; }
  .act-header .act-btn { width: 100%; }
  .act-header p { font-size: 13px; }

  .act-stats { display: flex; overflow-x: auto; gap: 10px; scroll-snap-type: x proximity; padding-bottom: 4px; }
  .act-stat { flex: 0 0 168px; scroll-snap-align: start; padding: 12px; }

  .act-tabs { width: 100%; }
  .act-tab { flex: 1; justify-content: center; padding: 0 8px; }
  .act-toolbar-right > .act-btn:not(.act-btn--icon) span { display: none; }

  .act-selection { flex-direction: column; align-items: stretch; }
  .act-selection-actions .act-btn { flex: 1; }

  .act-pagination { align-items: stretch; text-align: center; }
  .act-pagination-left { justify-content: center; }
  .act-pagination-nav { justify-content: space-between; }
  .act-page-numbers { display: none; }
  .act-page-summary { display: block; }

  /* modals become full-screen sheets */
  .act-overlay { padding: 0; align-items: flex-end; }
  .act-modal { max-width: none; max-height: 94dvh; border-radius: 16px 16px 0 0; }
  .act-modal--sm { max-height: none; }
  .act-modal-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .act-modal-foot .act-btn { flex: 1; }
  .act-foot-note { flex-basis: 100%; margin-right: 0; }
  .act-input { font-size: 16px; }
  .act-field--narrow { max-width: none; }

  .act-toast { top: auto; bottom: 16px; right: 16px; left: 16px; max-width: none; }
}/* Review Types Management Styles */
.clientreview-btn-reviewtypes {
    background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: white;
  margin-right: 10px;
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.clientreview-btn-reviewtypes:hover {
    background: linear-gradient(135deg, #002060 50%,  #E820DA 50%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

.clientreview-modal-large {
  max-width: 900px;
  width: 90%;
}

.clientreview-reviewtypes-list {
  margin-bottom: 20px;
}

.clientreview-btn-add-type {
  background-color: #4CAF50;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 15px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.clientreview-btn-add-type:hover {
  background-color: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.clientreview-reviewtypes-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.clientreview-reviewtypes-table th,
.clientreview-reviewtypes-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.clientreview-reviewtypes-table th {
  background-color: #9c27b0;
  color: white;
  font-weight: 600;
}

.clientreview-reviewtypes-table tr:hover {
  background-color: #f5f5f5;
}

.clientreview-btn-small {
  padding: 5px 10px;
  margin-right: 5px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.clientreview-btn-delete {
  background-color: #f44336;
  color: white;
}

.clientreview-btn-delete:hover {
  background-color: #da190b;
  transform: translateY(-1px);
}

/* Reduced padding so the whole layout takes less vertical room,
   leaving more space for the table itself. */
.clientreview-container {
  padding: 10px 20px;
  max-width: 98%;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.p-status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
  text-align: center;
  min-width: 100px;
}

.p-status-upcoming {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.p-status-soon {
  background-color: #ffedd5;
  color: #9a3412;
  border: 1px solid #fdba74;
}

.p-status-today {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.p-status-overdue {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.p-status-completed {
  background-color: #e5e7eb;
  color: #374151;
  border: 1px solid #d1d5db;
}

/* Top row: wraps the header buttons, the stats bar, and the
   search/entries toolbar. Wraps naturally onto additional lines
   instead of forcing a horizontal scrollbar. */
.clientreview-toprow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.clientreview-toprow > * {
  flex-shrink: 1;
}

/* Header row: title, primary action, and export/manage buttons. */
.clientreview-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
  padding: 6px 10px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.clientreview-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.clientreview-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  white-space: nowrap;
}

/* Summary stats bar */
.clientreview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0;
}

.clientreview-stat {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 10px;
  background: white;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #9ca3af;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.clientreview-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.clientreview-stat-value {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1;
}

.clientreview-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.clientreview-stat-total {
  border-left-color: #973390;
}
.clientreview-stat-total .clientreview-stat-value {
  color: #973390;
}

.clientreview-stat-overdue {
  border-left-color: #dc2626;
  background: #fef7f7;
}
.clientreview-stat-overdue .clientreview-stat-value {
  color: #991b1b;
}

.clientreview-stat-today {
  border-left-color: #d97706;
  background: #fffaf0;
}
.clientreview-stat-today .clientreview-stat-value {
  color: #92400e;
}

.clientreview-stat-soon {
  border-left-color: #ea580c;
  background: #fff8f3;
}
.clientreview-stat-soon .clientreview-stat-value {
  color: #9a3412;
}

.clientreview-stat-upcoming {
  border-left-color: #059669;
  background: #f5fdf9;
}
.clientreview-stat-upcoming .clientreview-stat-value {
  color: #065f46;
}

.clientreview-stat-completed {
  border-left-color: #6b7280;
  background: #f9fafb;
}
.clientreview-stat-completed .clientreview-stat-value {
  color: #374151;
}

.clientreview-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 0;
}

/* ============================================================
   SEARCH BOX — rebuilt as one self-contained pill.
   The magnifying-glass icon and the "clear" (X) button both live
   INSIDE this fixed-width wrapper, absolutely positioned over the
   input. Because the clear button appearing/disappearing never
   changes the wrapper's own width or the flex row's width, nothing
   around it reflows or gets pushed down while the user types.
   ============================================================ */
.clientreview-search-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 280px;
  max-width: 100%;
  flex-shrink: 0;
}

.clientreview-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.clientreview-search {
  width: 100%;
  padding: 9px 34px 9px 38px;
  border: 2px solid #e5e7eb;
  border-radius: 999px;
  font-size: 14px;
  background: white;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.clientreview-search:focus {
  outline: none;
  border-color: #c923be;
  box-shadow: 0 0 0 3px rgba(201, 35, 190, 0.12);
}

.clientreview-search::placeholder {
  color: #9ca3af;
}

.clientreview-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.clientreview-search-clear:hover {
  background: #e5e7eb;
  color: #374151;
}

/* Kept for backward compatibility in case it's referenced elsewhere;
   no longer used by the search box itself. */
.clientreview-btn-clear-search {
  background: white;
  color: #973390;
  border: 2px solid #e5e7eb;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clientreview-btn-clear-search:hover {
  border-color: #c923be;
  background: #fdf2fc;
  color: #7a1f74;
}

.clientreview-count-badge {
  background: linear-gradient(135deg, #c923be 20%, #973390 100%);
  color: white;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 400;
}

.clientreview-btn-primary {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(201, 35, 190, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.clientreview-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 35, 190, 0.4);
  background: linear-gradient(135deg, #002060 50%,  #E820DA 50%);
}

.clientreview-controls {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 0;
  gap: 12px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.clientreview-export-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.clientreview-btn-excel,
.clientreview-btn-pdf,
.clientreview-btn-print {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0;
  white-space: nowrap;
}

.clientreview-btn-excel {
  background: #10b981;
  color: white;
}

.clientreview-btn-pdf {
  background: #ec4899;
  color: white;
}

.clientreview-btn-print {
  background: #8b5cf6;
  color: white;
}

.clientreview-btn-excel:hover,
.clientreview-btn-pdf:hover,
.clientreview-btn-print:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.clientreview-entries-control {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.clientreview-entries-control label {
  font-size: 14px;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  white-space: nowrap;
}

.clientreview-entries-select {
  padding: 6px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  background: white;
  transition: all 0.3s ease;
}

.clientreview-entries-select:focus {
  outline: none;
  border-color: #c923be;
}

.clientreview-row-completed {
  background-color: #f3f4f6 !important;
}

.clientreview-row-overdue td,
.clientreview-row-due-soon td,
.clientreview-row-due-today td,
.clientreview-row-completed td {
  background-color: inherit !important;
}

.status-legend {
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
  font-size: 12px;
}

.legend {
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.legend.overdue {
  background: #fee2e2;
}

.legend.today {
  background: #fef3c7;
}

.legend.soon {
  background: #ffedd5;
}

.legend.upcoming {
  background: #d1fae5;
}

.legend.completed {
  background: #e5e7eb;
}

.review-summary {
  margin-bottom: 10px;
  font-weight: 600;
}

.summary-overdue {
  color: #dc2626;
}

/* Table wrapper now gets the vertical space freed up above. */
.clientreview-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 72vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  border: 1px solid #e5e7eb;
}

.clientreview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.clientreview-table thead {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.clientreview-table th {
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.clientreview-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.clientreview-table th.sortable:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sort-icon {
  margin-left: 5px;
  opacity: 0.6;
  font-size: 12px;
}

.clientreview-table th.sortable:hover .sort-icon {
  opacity: 1;
}

.sort-asc, .sort-desc {
  opacity: 1;
  font-weight: bold;
}

.clientreview-table td {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.clientreview-table tbody tr {
  transition: all 0.2s ease;
}

.clientreview-table tbody tr:hover {
  background-color: #f9fafb;
  transform: scale(1.005);
}

.clientreview-row-due-today {
  background-color: #fef3c7 !important;
}

.clientreview-row-due-soon {
  background-color: #ffedd5 !important;
}

.clientreview-row-overdue {
  background-color: #fee2e2 !important;
}

.clientreview-btn-details {
  background: #fbbf24;
  color: #1a1a1a;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clientreview-btn-details:hover {
  background: #f59e0b;
  transform: translateY(-1px);
}

.clientreview-btn-edit {
  background: linear-gradient(135deg, #c923be 20%, #973390 100%);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clientreview-btn-edit:hover {
  background: #973390;
  transform: translateY(-1px);
}

.clientreview-btn-archive {
  background: linear-gradient(135deg, #ff9800 20%, #b45309 100%);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 6px;
  display: inline-block;
}

.clientreview-btn-archive:hover {
  background: #b45309;
  transform: translateY(-1px);
}

.clientreview-pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 15px;
  background: #f9fafb;
  border-radius: 8px;
}

.clientreview-pagination-info {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.clientreview-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.clientreview-pagination-btn {
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.clientreview-pagination-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #c923be;
}

.clientreview-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.clientreview-pagination-active {
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: white;
  border-color: #002060;
}

.clientreview-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.clientreview-modal {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease;
}

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

.clientreview-modal-details {
  max-width: 700px;
}

.clientreview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #c923be 20%, #973390 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}

.clientreview-modal-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.clientreview-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 28px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.clientreview-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.clientreview-form {
  padding: 24px;
}

.clientreview-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 10px;
}

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

.clientreview-form-group-full {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.clientreview-form-group label,
.clientreview-form-group-full label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.clientreview-form-group input,
.clientreview-form-group select,
.clientreview-form-group-full input,
.clientreview-form-group-full textarea {
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.clientreview-form-group input:focus,
.clientreview-form-group select:focus,
.clientreview-form-group-full input:focus,
.clientreview-form-group-full textarea:focus {
  outline: none;
  border-color: #c923be;
  box-shadow: 0 0 0 3px rgba(201, 35, 190, 0.1);
}

.clientreview-form-group-full textarea {
  resize: vertical;
  font-family: inherit;
}

.clientreview-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.clientreview-btn-cancel {
  padding: 10px 24px;
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clientreview-btn-cancel:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.clientreview-btn-save {
  padding: 10px 24px;
  border: none;
  background: linear-gradient(135deg, #c923be 20%, #973390 100%);
  color: white;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(201, 35, 190, 0.3);
}

.clientreview-btn-save:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 35, 190, 0.4);
}

.clientreview-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.clientreview-details-content {
  padding: 24px;
}

.clientreview-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 10px;
}

.clientreview-details-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clientreview-details-item strong {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
}

.clientreview-details-item span {
  font-size: 15px;
  color: #1a1a1a;
  font-weight: 500;
}

.clientreview-details-notes {
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 4px solid #c923be;
}

.clientreview-details-notes strong {
  display: block;
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
  font-weight: 600;
}

.clientreview-details-notes p {
  margin: 0;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
  white-space: pre-wrap;
}

.clientreview-loading {
  text-align: center;
  padding: 40px;
  font-size: 16px;
  color: #6b7280;
}

.clientreview-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
}

.clientreview-toast-show {
  transform: translateY(0);
  opacity: 1;
}

.clientreview-toast-success {
  background: #10b981;
}

.clientreview-toast-error {
  background: #ef4444;
}

@media print {

  .clientreview-header,
  .clientreview-controls,
  .clientreview-pagination,
  .clientreview-btn-details,
  .clientreview-btn-edit,
  .clientreview-btn-archive {
    display: none !important;
  }

  .clientreview-table {
    font-size: 10px;
  }

  .clientreview-table th,
  .clientreview-table td {
    padding: 6px;
  }
}

@media (max-width: 768px) {
  .clientreview-container {
    padding: 10px;
  }

  .clientreview-title {
    font-size: 18px;
  }

  .clientreview-search-wrapper {
    width: 100%;
  }

  .clientreview-entries-control {
    font-size: 13px;
  }

  .clientreview-pagination-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .clientreview-pagination-info {
    font-size: 13px;
  }

  .clientreview-table-wrapper {
    max-height: 400px;
  }

  .clientreview-table {
    font-size: 12px;
  }

  .clientreview-table th,
  .clientreview-table td {
    padding: 8px 6px;
  }

  .clientreview-form-row {
    grid-template-columns: 1fr;
  }

  .clientreview-modal {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
  }

  .clientreview-modal-header {
    border-radius: 0;
  }

  .clientreview-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .clientreview-toolbar {
    width: 100%;
  }
}
/* clientreview-stat clientreview-stat-total */

/* ============================================================
   Custom Confirm Modal — replaces window.confirm()
   ============================================================ */
.clientreview-confirm-overlay {
  z-index: 1100;
}

.clientreview-confirm-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 28px 28px 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: confirmPopIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes confirmPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.clientreview-confirm-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, 'Times New Roman', serif;
}

.clientreview-confirm-warning .clientreview-confirm-icon {
  background: #ffedd5;
  color: #b45309;
}

.clientreview-confirm-danger .clientreview-confirm-icon {
  background: #fee2e2;
  color: #dc2626;
}

.clientreview-confirm-info .clientreview-confirm-icon {
  background: #ede9fe;
  color: #7c3aed;
}

.clientreview-confirm-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
}

.clientreview-confirm-message {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.6;
  color: #4b5563;
}

.clientreview-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.clientreview-confirm-actions .clientreview-btn-cancel {
  flex: 1;
  padding: 10px 20px;
}

.clientreview-btn-confirm {
  flex: 1;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
}

.clientreview-btn-confirm-warning {
  background: linear-gradient(135deg, #ff9800 20%, #b45309 100%);
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.3);
}

.clientreview-btn-confirm-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.4);
}

.clientreview-btn-confirm-danger {
  background: linear-gradient(135deg, #f87171 20%, #dc2626 100%);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.clientreview-btn-confirm-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.clientreview-btn-confirm-info {
  background: linear-gradient(135deg, #c923be 20%, #973390 100%);
  box-shadow: 0 2px 8px rgba(201, 35, 190, 0.3);
}

.clientreview-btn-confirm-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 35, 190, 0.4);
}

@media (max-width: 480px) {
  .clientreview-confirm-modal {
    padding: 24px 20px 20px;
  }
  .clientreview-confirm-actions {
    flex-direction: column;
  }
}/* ==========================================================================
   Risk Assessment - professional layout
   All classes are prefixed "ra-" so they cannot clash with w3.css or sp-*.
   ========================================================================== */

.ra-shell {
    --ra-primary: #3b1f8f;
    --ra-primary-hover: #2e1873;
    --ra-primary-soft: #f1edfd;
    --ra-primary-border: #d9d0f7;
    --ra-done: #0f766e;
    --ra-done-soft: #ccfbf1;

    --ra-ink: #1b1b2f;
    --ra-text: #3f3f55;
    --ra-muted: #6b6b80;
    --ra-line: #e4e4ee;
    --ra-field-line: #cfd0de;
    --ra-surface: #ffffff;
    --ra-bg: #f4f4f9;

    --ra-high: #b42318;
    --ra-high-soft: #fee4e2;
    --ra-medium: #92400e;
    --ra-medium-soft: #fef0c7;
    --ra-low: #067647;
    --ra-low-soft: #d1fadf;

    --ra-radius: 10px;
    --ra-radius-sm: 6px;
    --ra-shadow: 0 1px 2px rgba(27, 27, 47, 0.06);

    /* Sidebar widths (expanded / minimised rail) */
    --ra-sidebar-w: 300px;
    --ra-sidebar-w-collapsed: 76px;

    /* Height used by the app's top nav + sub nav. Tweak if needed. */
    --ra-top-offset: 110px;
    /* Space reserved at the bottom (Electron status bar). Set from the component. */
    --ra-bottom-offset: 0px;

    display: grid;
    grid-template-columns: var(--ra-sidebar-w) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 16px;
    padding: 16px;

    /* Smoothly animate the sidebar opening / closing */
    transition: grid-template-columns 0.25s ease;

    /* Fixed height = the page itself no longer scrolls */
    height: calc(100vh - var(--ra-top-offset) - var(--ra-bottom-offset));
    height: calc(100dvh - var(--ra-top-offset) - var(--ra-bottom-offset));
    min-height: 0;
    overflow: hidden;

    background: var(--ra-bg);
    color: var(--ra-text);
    font-size: 14px;
    box-sizing: border-box;
}

/* Minimised: narrow rail on the left, everything else goes to the right panel */
.ra-shell.ra-shell-collapsed {
    grid-template-columns: var(--ra-sidebar-w-collapsed) minmax(0, 1fr);
}

.ra-shell *,
.ra-shell *::before,
.ra-shell *::after {
    box-sizing: border-box;
}

.ra-shell button {
    font-family: inherit;
}

.ra-shell :focus-visible {
    outline: 2px solid var(--ra-primary);
    outline-offset: 2px;
}

/* ---------- Sidebar ---------- */

.ra-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--ra-surface);
    border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius);
    box-shadow: var(--ra-shadow);
    height: 100%;
    max-height: none;
    min-height: 0;
    overflow: hidden;
}

/* ----- Sidebar head (toggle button + title) ----- */

.ra-sidebar-head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px 0;
}

.ra-sidebar-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ra-ink);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}

.ra-sidebar-toggle {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius-sm);
    background: var(--ra-surface);
    color: var(--ra-primary);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ra-sidebar-toggle:hover {
    background: var(--ra-primary);
    border-color: var(--ra-primary);
    color: #fff;
}

/* Rail button that opens the sidebar and focuses search */
.ra-rail-search {
    display: none;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: 10px auto 0;
    border: 1px solid transparent;
    border-radius: var(--ra-radius-sm);
    background: var(--ra-bg);
    color: var(--ra-muted);
    font-size: 17px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ra-rail-search:hover {
    background: var(--ra-primary-soft);
    color: var(--ra-primary);
}

.ra-search {
    position: relative;
    flex: none;
    padding: 14px 14px 8px;
}

.ra-search-icon {
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-30%);
    color: var(--ra-muted);
    pointer-events: none;
}

.ra-search-input {
    width: 100%;
    height: 40px;
    padding: 0 36px 0 38px;
    border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius-sm);
    background: var(--ra-bg);
    color: var(--ra-ink);
    font-size: 14px;
    transition: border-color 0.15s, background 0.15s;
}

.ra-search-input::placeholder {
    color: var(--ra-muted);
}

.ra-search-input:hover {
    border-color: var(--ra-primary-border);
}

.ra-search-input:focus {
    outline: none;
    background: var(--ra-surface);
    border-color: var(--ra-primary);
    box-shadow: 0 0 0 3px var(--ra-primary-soft);
}

.ra-search-clear {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-30%);
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ra-muted);
    cursor: pointer;
}

.ra-search-clear:hover {
    background: var(--ra-line);
    color: var(--ra-ink);
}

.ra-sidebar-meta {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px 10px;
    color: var(--ra-muted);
    font-size: 12.5px;
    border-bottom: 1px solid var(--ra-line);
}

/* The client list scrolls on its own; search + count stay pinned */
.ra-client-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--ra-primary-border) transparent;
}

.ra-client-ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ra-client {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: var(--ra-radius-sm);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}

.ra-client:hover {
    background: var(--ra-bg);
}

.ra-client-active,
.ra-client-active:hover {
    background: var(--ra-primary-soft);
    border-color: var(--ra-primary-border);
}

.ra-avatar {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ra-primary-soft);
    color: var(--ra-primary);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ra-client-active .ra-avatar {
    background: var(--ra-primary);
    color: #fff;
}

.ra-avatar-lg {
    width: 52px;
    height: 52px;
    font-size: 17px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.ra-client-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ra-client-name {
    color: var(--ra-ink);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ra-client-sub {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--ra-muted);
    font-size: 12.5px;
}

/* ----- Minimised sidebar (icon rail) ----- */

.ra-sidebar-collapsed .ra-sidebar-head {
    justify-content: center;
    padding: 12px 0 0;
}

.ra-sidebar-collapsed .ra-rail-search {
    display: inline-grid;
}

.ra-sidebar-collapsed .ra-client-list {
    padding: 10px 8px;
}

.ra-sidebar-collapsed .ra-client {
    justify-content: center;
    padding: 8px 0;
}

.ra-sidebar-collapsed .ra-state-compact {
    padding: 16px 0;
}

.ra-sidebar-collapsed .ra-state-compact .ra-state-title,
.ra-sidebar-collapsed .ra-state-compact .ra-state-text,
.ra-sidebar-collapsed .ra-state-compact .ra-btn {
    display: none;
}

/* ---------- Main column (scrolls inside its own container) ---------- */

.ra-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--ra-primary-border) transparent;
}

/* Stop flex from squashing the header/tabs/form when content is tall */
.ra-main > * {
    flex-shrink: 0;
}

/* ---------- Header ---------- */

.ra-header {
    background: var(--ra-primary);
    color: #fff;
    border-radius: var(--ra-radius);
    box-shadow: var(--ra-shadow);
    overflow: hidden;
}

.ra-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 24px;
}

.ra-header-id {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.ra-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
}

.ra-subtitle {
    margin: 4px 0 0;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.72);
}

.ra-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ra-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    margin: 0;
    background: rgba(255, 255, 255, 0.14);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.ra-fact {
    padding: 12px 24px;
    background: var(--ra-primary-hover);
    min-width: 0;
}

.ra-fact dt {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.68);
}

.ra-fact dd {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ra-fact-progress dd {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ra-progress-text {
    flex: none;
}

.ra-progress {
    flex: 1;
    min-width: 40px;
    height: 6px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.ra-progress-bar {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: #5eead4;
    transition: width 0.3s ease;
}

/* ---------- Buttons ---------- */

.ra-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--ra-radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ra-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ra-btn-light {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.ra-btn-light:hover:not(:disabled) {
    background: #fff;
    color: var(--ra-primary);
}

.ra-btn-light:focus-visible {
    outline-color: #fff;
}

.ra-btn-primary {
    background: var(--ra-primary);
    color: #fff;
}

.ra-btn-primary:hover:not(:disabled) {
    background: var(--ra-primary-hover);
}

.ra-btn-outline {
    background: var(--ra-surface);
    border-color: var(--ra-line);
    color: var(--ra-ink);
}

.ra-btn-outline:hover:not(:disabled) {
    border-color: var(--ra-primary);
    color: var(--ra-primary);
}

/* ---------- Badges ---------- */

.ra-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 12.5px;
    font-weight: 600;
}

.ra-risk-high { background: var(--ra-high-soft); color: var(--ra-high); }
.ra-risk-medium { background: var(--ra-medium-soft); color: var(--ra-medium); }
.ra-risk-low { background: var(--ra-low-soft); color: var(--ra-low); }
.ra-risk-none { background: #ececf3; color: var(--ra-muted); }

/* ---------- Tabs (stay visible while the form scrolls) ---------- */

.ra-tabs-wrap {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--ra-surface);
    border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius);
    /* The first shadow paints page background above the bar so the header
       line never peeks out above it while scrolling. */
    box-shadow: 0 -16px 0 0 var(--ra-bg), var(--ra-shadow);
    padding: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
}

/* Same idea below the bar so form text does not show in the gap */
.ra-tabs-wrap::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 14px;
    background: var(--ra-bg);
    pointer-events: none;
}

.ra-tabs {
    display: flex;
    gap: 4px;
    min-width: max-content;
}

.ra-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--ra-radius-sm);
    background: transparent;
    color: var(--ra-muted);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ra-tab:hover {
    background: var(--ra-bg);
    color: var(--ra-ink);
}

.ra-tab-active,
.ra-tab-active:hover {
    background: var(--ra-primary-soft);
    border-color: var(--ra-primary-border);
    color: var(--ra-primary);
}

.ra-tab-icon {
    font-size: 17px;
}

.ra-tab-status {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 1.5px solid #c9c9d8;
    border-radius: 50%;
    font-size: 11px;
    color: #fff;
}

.ra-tab-status-done {
    border-color: var(--ra-done);
    background: var(--ra-done);
}

/* ---------- Form panel ---------- */

.ra-panel {
    flex: none;
    min-height: 0;
}

.ra-form-card {
    position: relative;
    background: var(--ra-surface);
    border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius);
    box-shadow: var(--ra-shadow);
    padding: 32px 36px 36px;
    /* Wide tables scroll sideways inside the card instead of squashing */
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--ra-primary-border) transparent;
}

.ra-fetching {
    position: absolute;
    top: 12px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ra-muted);
}

/* ==========================================================================
   FORM STYLING - applies to every form inside the card
   ========================================================================== */

/* ----- Titles ----- */

.ra-form-card h1,
.ra-form-card h2 {
    margin: 0 0 22px !important;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--ra-primary-soft);
    color: var(--ra-primary) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-transform: uppercase;
}

.ra-form-card h3,
.ra-form-card h4 {
    margin: 26px 0 12px;
    color: var(--ra-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.ra-form-card p {
    margin: 0 0 16px;
    color: var(--ra-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* ----- Labels ----- */

.ra-form-card label {
    display: block;
    margin-bottom: 8px;
    color: var(--ra-ink);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* ----- Fields: more height, bigger text, comfortable padding ----- */

.ra-form-card input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.ra-form-card select,
.ra-form-card textarea {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--ra-field-line);
    border-radius: 8px;
    background: var(--ra-surface);
    color: var(--ra-ink);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.ra-form-card input::placeholder,
.ra-form-card textarea::placeholder {
    color: #9a9aae;
}

/* Textareas: big starting size, and they grow as the user types */
.ra-form-card textarea {
    min-height: 130px;
    max-height: 480px;
    padding: 14px 16px;
    line-height: 1.6;
    resize: vertical;
    overflow-y: auto;
    field-sizing: content; /* auto-grow in Chrome / Edge; others keep the 130px box */
    scrollbar-width: thin;
    scrollbar-color: var(--ra-primary-border) transparent;
}

.ra-form-card input:not([type="checkbox"]):not([type="radio"]):hover,
.ra-form-card select:hover,
.ra-form-card textarea:hover {
    border-color: #b9a9ee;
}

.ra-form-card input:focus,
.ra-form-card select:focus,
.ra-form-card textarea:focus {
    outline: none;
    border-color: var(--ra-primary);
    box-shadow: 0 0 0 4px var(--ra-primary-soft);
}

.ra-form-card input:disabled,
.ra-form-card input[readonly],
.ra-form-card select:disabled,
.ra-form-card textarea:disabled {
    background: var(--ra-bg);
    color: var(--ra-muted);
    cursor: not-allowed;
}

/* Dropdowns get a clean custom arrow */
.ra-form-card select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6b80' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

.ra-form-card input[type="date"] {
    min-width: 170px;
}

.ra-form-card input[type="checkbox"],
.ra-form-card input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--ra-primary);
    cursor: pointer;
}

/* ----- Tables ----- */

.ra-form-card table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
}

.ra-form-card th {
    padding: 14px;
    background: var(--ra-primary-soft);
    border-bottom: 2px solid var(--ra-primary-border);
    color: var(--ra-primary);
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    line-height: 1.4;
    text-align: left;
    text-transform: uppercase;
    vertical-align: middle;
}

.ra-form-card td {
    padding: 18px 14px;
    border-bottom: 1px solid var(--ra-line);
    vertical-align: top;
}

.ra-form-card tbody tr:hover td {
    background: #fbfaff;
}

/* Plain-text cells (e.g. the question column) read like labels */
.ra-form-card td:first-child:not(:has(input, textarea, select)) {
    min-width: 200px;
    color: var(--ra-ink);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.55;
}

/* Give typing columns real width */
.ra-form-card td textarea {
    min-width: 230px;
}

.ra-form-card td input:not([type="checkbox"]):not([type="radio"]),
.ra-form-card td select {
    min-width: 130px;
}

/* ----- Row buttons (Add row / Remove) - one consistent look ----- */

.ra-form-card td button:not([type="submit"]) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-width: 110px;
    height: 36px;
    margin: 0 0 8px;
    padding: 0 12px;
    border: 1px solid var(--ra-primary-border) !important;
    border-radius: 6px !important;
    background: var(--ra-primary-soft) !important;
    color: var(--ra-primary) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ra-form-card td button:not([type="submit"]):hover {
    background: var(--ra-primary) !important;
    border-color: var(--ra-primary) !important;
    color: #fff !important;
}

/* Remove / delete buttons get a red variant (best-effort class matching) */
.ra-form-card td button:not([type="submit"]).w3-red,
.ra-form-card td button:not([type="submit"])[class*="remove" i],
.ra-form-card td button:not([type="submit"])[class*="delete" i],
.ra-form-card td button:not([type="submit"])[class*="danger" i] {
    border-color: #f5c2bd !important;
    background: var(--ra-high-soft) !important;
    color: var(--ra-high) !important;
}

.ra-form-card td button:not([type="submit"]).w3-red:hover,
.ra-form-card td button:not([type="submit"])[class*="remove" i]:hover,
.ra-form-card td button:not([type="submit"])[class*="delete" i]:hover,
.ra-form-card td button:not([type="submit"])[class*="danger" i]:hover {
    background: var(--ra-high) !important;
    border-color: var(--ra-high) !important;
    color: #fff !important;
}

/* ----- Submit button ----- */

.ra-form-card button[type="submit"],
.ra-form-card .ra-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    margin-top: 28px;
    padding: 0 30px;
    border: 0;
    border-radius: 8px;
    background: var(--ra-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(59, 31, 143, 0.28);
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.ra-form-card button[type="submit"]:hover,
.ra-form-card .ra-save:hover {
    background: var(--ra-primary-hover);
    box-shadow: 0 4px 12px rgba(59, 31, 143, 0.32);
}

.ra-form-card button[type="submit"]:disabled,
.ra-form-card .ra-save:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------- Empty / error states ---------- */

.ra-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 56px 24px;
    text-align: center;
    background: var(--ra-surface);
    border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius);
}

.ra-state-hero {
    flex: 1;
    min-height: 360px;
}

.ra-state-compact {
    padding: 32px 12px;
    border: 0;
    background: transparent;
}

.ra-state-badge {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: var(--ra-primary-soft);
    color: var(--ra-primary);
    font-size: 24px;
}

.ra-state-icon {
    font-size: 28px;
    color: var(--ra-muted);
}

.ra-state-icon-error {
    color: var(--ra-high);
}

.ra-state-title {
    margin: 4px 0 0;
    color: var(--ra-ink);
    font-size: 16px;
    font-weight: 600;
}

.ra-state-text {
    max-width: 340px;
    margin: 0 0 10px;
    color: var(--ra-muted);
    font-size: 13.5px;
}

/* ---------- Skeletons ---------- */

.ra-skeleton {
    display: block;
    border-radius: 6px;
    background: linear-gradient(90deg, #ececf3 25%, #f5f5fa 50%, #ececf3 75%);
    background-size: 200% 100%;
    animation: ra-shimmer 1.4s linear infinite;
}

.ra-skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
}

.ra-skeleton-avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.ra-skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ra-skeleton-line { height: 12px; width: 70%; }
.ra-skeleton-short { width: 40%; }

/* In the minimised rail only the avatar circles are shown */
.ra-sidebar-collapsed .ra-skeleton-row {
    justify-content: center;
    padding: 8px 0;
}

.ra-sidebar-collapsed .ra-skeleton-lines {
    display: none;
}

.ra-form-skeleton {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px;
    background: var(--ra-surface);
    border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius);
}

.ra-skeleton-title { height: 24px; width: 280px; max-width: 70%; }
.ra-form-skeleton-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ra-skeleton-field { height: 44px; }

@keyframes ra-shimmer {
    to { background-position: -200% 0; }
}

.ra-spin {
    animation: ra-rotate 1s linear infinite;
}

@keyframes ra-rotate {
    to { transform: rotate(360deg); }
}

/* ---------- Toast ---------- */

.ra-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 420px;
    padding: 12px 12px 12px 16px;
    border-radius: var(--ra-radius-sm);
    background: var(--ra-ink);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(27, 27, 47, 0.25);
    animation: ra-toast-in 0.2s ease-out;
}

.ra-toast svg:first-child {
    flex: none;
    font-size: 18px;
}

.ra-toast-success svg:first-child { color: #5eead4; }
.ra-toast-error svg:first-child { color: #fda29b; }

.ra-toast button {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin-left: 4px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.ra-toast button:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

@keyframes ra-toast-in {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .ra-shell,
    .ra-shell.ra-shell-collapsed {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .ra-sidebar {
        height: auto;
        max-height: 240px;
    }

    /* On small screens "minimised" = only the header bar with the toggle */
    .ra-sidebar-collapsed {
        max-height: none;
    }

    .ra-sidebar-collapsed .ra-sidebar-head {
        justify-content: space-between;
        padding: 12px 14px;
    }

    .ra-sidebar-collapsed .ra-rail-search,
    .ra-sidebar-collapsed .ra-client-list {
        display: none;
    }

    .ra-form-skeleton-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .ra-shell { padding: 10px; }
    .ra-header-top { padding: 16px; }
    .ra-fact { padding: 10px 16px; }
    .ra-form-card { padding: 20px 16px 24px; }
    .ra-tab { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .ra-shell,
    .ra-skeleton,
    .ra-spin,
    .ra-toast,
    .ra-progress-bar {
        animation: none;
        transition: none;
    }
}/* ============ SCHEDULER ROSTER VISITS — prefixed classes (global-safe) ============ */

.scheduler-roster-container {
    display: flex;
    gap: 12px;
    padding: 12px;
    height: 100vh;
    background: #f3f4f6;
    box-sizing: border-box;
    overflow: hidden;
}

/* ---------- Sidebar ---------- */
.scheduler-roster-sidebar {
    width: 240px;
    flex: 0 0 240px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    height: 100%;
    overflow-y: auto;
}
.scheduler-roster-search {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.scheduler-roster-client-list { display: flex; flex-direction: column; gap: 6px; }
.scheduler-roster-client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
}
.scheduler-roster-client-item:hover { background: #eef2ff; }
.scheduler-roster-client-item.active { background: #e0e7ff; border-color: #6366f1; }
.scheduler-roster-client-name { font-weight: 600; color: #1f2937; }
.scheduler-roster-client-postcode { color: #6b7280; font-size: 11px; }

/* ---------- Main ---------- */
.scheduler-roster-main {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 20px;
}
.scheduler-roster-header {
    background: linear-gradient(90deg, #059669, #10b981);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.scheduler-roster-title { margin: 0; font-size: 15px; font-weight: 700; }
.scheduler-roster-logged-in { font-size: 12px; margin-top: 4px; opacity: 0.9; }

.scheduler-roster-card {
    background: #eef0f3;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    position: relative;
    padding-bottom: 80px;
}
.scheduler-roster-form-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    border-bottom: 2px solid #10b981;
    padding-bottom: 8px;
    margin-bottom: 8px;
}
.scheduler-roster-intro {
    font-size: 12px;
    color: #4b5563;
    margin-bottom: 14px;
}

.scheduler-roster-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}
.scheduler-roster-row > div:only-child { grid-column: 1 / -1; }
.scheduler-roster-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}
.scheduler-roster-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    background: #f9fafb;
    color: #1d4ed8;
    box-sizing: border-box;
}

.scheduler-roster-section-header {
    background: #d1fae5;
    border-left: 4px solid #10b981;
    color: #065f46;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 6px;
    margin: 14px 0 10px;
}

/* ---------- Table ---------- */
.scheduler-roster-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}
.scheduler-roster-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}
.scheduler-roster-table th {
    font-size: 12px;
    text-align: left;
    padding: 8px;
    color: #374151;
    border-bottom: 2px solid #d1d5db;
    position: sticky;
    top: 0;
    background: #eef0f3;
    z-index: 1;
}
.scheduler-roster-table td { padding: 8px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }

.scheduler-roster-variation { background: #fafafa; }
.scheduler-roster-variation > td { padding: 4px 10px; }
.scheduler-roster-variation-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.scheduler-roster-banner {
    border: 1px solid #fca5a5;
    background: #fef2f2;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #7f1d1d;
}
.scheduler-roster-banner b { color: #991b1b; }
.scheduler-roster-banner ul { margin: 6px 0 0 18px; }

.scheduler-roster-add-btn {
    width: 100%;
    padding: 10px;
    border: 2px dashed #a7f3d0;
    border-radius: 8px;
    background: #ecfdf5;
    color: #065f46;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.scheduler-roster-status-line { margin-top: 8px; color: #64748b; font-size: 12px; }
.scheduler-roster-empty { text-align: center; color: #64748b; padding: 20px; font-size: 13px; }

.scheduler-roster-review-box {
    margin-top: 16px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 12px;
}
.scheduler-roster-review-title { font-weight: 700; color: #065f46; font-size: 13px; margin-bottom: 10px; }
.scheduler-roster-review-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.scheduler-roster-save-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    position: sticky;
    bottom: 0;
    background: #eef0f3;
    padding: 10px 0;
    border-top: 1px solid #e5e7eb;
}
.scheduler-roster-save-btn {
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
}
.scheduler-roster-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.scheduler-roster-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 10px 16px;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.scheduler-roster-toast.success { background: #16a34a; }
.scheduler-roster-toast.error { background: #dc2626; }

@media (max-width: 900px) {
    .scheduler-roster-container { flex-direction: column; height: auto; overflow: visible; }
    .scheduler-roster-sidebar { width: 100%; flex: none; max-height: 40vh; }
    .scheduler-roster-main { height: auto; overflow: visible; }
    .scheduler-roster-row { grid-template-columns: 1fr; }
    .scheduler-roster-review-row { grid-template-columns: 1fr; }
}.invoice-container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 10px;
    font-family: Arial, sans-serif;
}

.invoice-container table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.invoice-container th {
    background-color: #9c27b0;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

.invoice-container td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.invoice-container tr:hover {
    background-color: #f5f5f5;
}

.invoice-container .w3-right-align {
    text-align: right;
}

@media print {
    .invoice-container button {
        display: none;
    }

    .w3-card {
        display: none;
    }
}



/*//===============payroll css =======================*/



.payroll-container {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.payroll-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.payroll-container th {
    background-color: #bd54b0;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #ddd;
}

.payroll-container td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.payroll-container tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.payroll-container tbody tr:hover {
    background-color: #f0f0f0;
}

.payroll-container h3 {
    color: #5a7a8c;
    margin: 0;
    font-size: 20px;
}

.payroll-container h6 {
    color: #5a7a8c;
    margin: 10px 0;
    font-size: 14px;
}

.payroll-container .w3-text-blue-grey {
    color: #5a7a8c;
}

@media print {
    .payroll-container button {
        display: none;
    }

    .payroll-container {
        box-shadow: none;
    }
}.payrates-container {
    padding: 20px;
    max-width: 100%;
    overflow-x: auto;
}

.payrates-header {
    margin-bottom: 4px;
}

.payrates-header h2 {
    color: #5e35b1;
    margin-bottom: 5px;
}

.payrates-header p {
    color: #666;
    font-size: 14px;
}

.payrates-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 500;
    color: #333;
}

.control-group select,
.control-group input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.control-group input[type="text"] {
    min-width: 200px;
}

.payrates-table-wrapper {
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 10px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
}

.payrates-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.payrates-table thead {
    background-color: #5e35b1;
    color: white;
}

.payrates-table th {
    padding: 1px 8px;
    text-align: left;
    font-weight: 700;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.payrates-table th:last-child {
    border-right: none;
}

.payrates-table th small {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.9;
}

.payrates-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.payrates-table tbody tr:hover {
    background-color: #cacbcc;
}

.payrates-table td {
    padding: 2px 8px;
    border-right: 1px solid #e0e0e0;
}

.payrates-table td:last-child {
    border-right: none;
}

.staff-name {
    font-weight: 500;
    color: #333;
}

.rate-col {
    text-align: center;
}


.payrates-table input[type="number"] {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.payrates-table input[type="number"]:focus {
    outline: none;
    border-color: #5e35b1;
    box-shadow: 0 0 0 2px rgba(94, 53, 177, 0.1);
}

.update-btn {
    background-color: #00897b;
    color: white;
    border: none;
    padding: 4px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.update-btn:hover:not(:disabled) {
    background-color: #00695c;
}

.update-btn:disabled {
    background-color: #b0bec5;
    cursor: not-allowed;
}

.payrates-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pagination-controls button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination-controls button:hover:not(:disabled) {
    background-color: #5e35b1;
    color: white;
    border-color: #5e35b1;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-controls span {
    color: #333;
    font-weight: 500;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-notification.success {
    background-color: #4caf50;
}

.toast-notification.error {
    background-color: #f44336;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .payrates-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        justify-content: space-between;
    }

    .control-group input[type="text"] {
        min-width: auto;
        flex: 1;
    }

    .payrates-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-controls {
        justify-content: center;
    }
}/* ============ FINANCIAL SUPPORT PLAN — with proper scrolling ============ */

.financial-support-container {
    display: flex;
    gap: 12px;
    padding: 12px;
    height: 100vh; /* ✅ Full viewport height */
    background: #f3f4f6;
    box-sizing: border-box;
    overflow: hidden; /* ✅ Prevent container-level scroll */
}

/* ---------- Sidebar (fixed, scrollable internally) ---------- */
.financial-support-sidebar {
    width: 240px;
    flex: 0 0 240px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    height: 100%;
    overflow-y: auto; /* ✅ Sidebar scrolls independently */
}
.financial-support-search {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.financial-support-client-list { display: flex; flex-direction: column; gap: 6px; }
.financial-support-client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
}
.financial-support-client-item:hover { background: #eef2ff; }
.financial-support-client-item.active { background: #e0e7ff; border-color: #6366f1; }
.financial-support-client-name { font-weight: 600; color: #1f2937; }
.financial-support-client-postcode { color: #6b7280; font-size: 11px; }

/* ---------- ✅ Main area (scrollable) ---------- */
.financial-support-main {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto; /* ✅ Main content scrolls vertically */
    padding-bottom: 20px;
}
.financial-support-header {
    background: linear-gradient(90deg, #7c3aed, #6366f1);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.financial-support-title { margin: 0; font-size: 15px; font-weight: 700; }
.financial-support-logged-in {
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.9;
}

.financial-support-card {
    background: #eef0f3;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    position: relative;
    padding-bottom: 80px; /* ✅ Space for save button */
}
.financial-support-form-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    border-bottom: 2px solid #6366f1;
    padding-bottom: 8px;
    margin-bottom: 8px;
}
.financial-support-intro {
    font-size: 12px;
    color: #4b5563;
    margin-bottom: 14px;
}

.financial-support-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}
.financial-support-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}
.financial-support-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    background: #f9fafb;
    color: #1d4ed8;
    box-sizing: border-box;
}

.financial-support-section-header {
    background: #e0e7ff;
    border-left: 4px solid #6366f1;
    color: #4338ca;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 6px;
    margin: 14px 0 10px;
}

/* ✅ Table wrapper for horizontal scroll on small screens */
.financial-support-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}
.financial-support-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px; /* ✅ Force min width so columns don't squish */
}
.financial-support-table th {
    font-size: 12px;
    text-align: left;
    padding: 8px;
    color: #374151;
    border-bottom: 2px solid #d1d5db;
    position: sticky;
    top: 0;
    background: #eef0f3;
    z-index: 1;
}
.financial-support-table td { padding: 8px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }

.financial-support-variation { background: #fafafa; }
.financial-support-variation > td { padding: 4px 10px; }
.financial-support-variation-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.financial-support-banner {
    border: 1px solid #fca5a5;
    background: #fef2f2;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #7f1d1d;
}
.financial-support-banner b { color: #991b1b; }
.financial-support-banner ul { margin: 6px 0 0 18px; }

.financial-support-add-btn {
    width: 100%;
    padding: 10px;
    border: 2px dashed #c7d2fe;
    border-radius: 8px;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.financial-support-status-line { margin-top: 8px; color: #64748b; font-size: 12px; }
.financial-support-empty { text-align: center; color: #64748b; padding: 20px; font-size: 13px; }

.financial-support-review-box {
    margin-top: 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 12px;
}
.financial-support-review-title { font-weight: 700; color: #1d4ed8; font-size: 13px; margin-bottom: 10px; }
.financial-support-review-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ✅ Save button - sticky at bottom of card */
.financial-support-save-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    position: sticky;
    bottom: 0;
    background: #eef0f3;
    padding: 10px 0;
    border-top: 1px solid #e5e7eb;
}
.financial-support-save-btn {
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
}
.financial-support-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.financial-support-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 10px 16px;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.financial-support-toast.success { background: #16a34a; }
.financial-support-toast.error { background: #dc2626; }

@media (max-width: 900px) {
    .financial-support-container { flex-direction: column; height: auto; overflow: visible; }
    .financial-support-sidebar { width: 100%; flex: none; max-height: 40vh; }
    .financial-support-main { height: auto; overflow: visible; }
    .financial-support-row { grid-template-columns: 1fr; }
    .financial-support-review-row { grid-template-columns: 1fr; }
}/* =========================================================
   IMAGES MANAGEMENT - PREMIUM UI REFINEMENT
========================================================= */

/* ================= ROOT ================= */

.images_management_container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 20px;
    font-family: "Segoe UI", Roboto, sans-serif;
    color: #111827;
}

/* ================= HEADER ================= */

.images_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.images_header h1 {
    font-size: 26px;
    font-weight: 700;
}

/* ================= BUTTON SYSTEM ================= */

.images_btn_primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: 0.25s ease;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.images_btn_primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.images_btn_cancel {
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    transition: 0.2s;
}

.images_btn_cancel:hover {
    background: #f3f4f6;
}

/* ================= ACTION BUTTONS ================= */

.images_action_btn_labeled {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.images_btn_preview_labeled {
    background: #e0f2fe;
    color: #0369a1;
}

.images_btn_edit_labeled {
    background: #fef3c7;
    color: #92400e;
}

.images_btn_archive_labeled {
    background: #e5e7eb;
    color: #374151;
}

.images_btn_publish_labeled {
    background: #dcfce7;
    color: #166534;
}

.images_btn_delete_labeled {
    background: #fee2e2;
    color: #b91c1c;
}

.images_action_btn_labeled:hover {
    transform: scale(1.05);
    filter: brightness(0.95);
}

/* ================= FEATURED BUTTON ================= */

.images_featured_btn {
    background: #f3f4f6;
    border: none;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.images_featured_btn:hover {
    background: #e5e7eb;
}

.images_featured_active {
    background: #facc15;
    color: #78350f;
}

/* ================= CONTROLS ================= */

.images_controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.images_search_input,
.images_filter_select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

.images_search_input {
    flex: 1;
    min-width: 200px;
}

/* ================= TABLE ================= */

.images_table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.images_table th {
    background: #111827;
    color: #fff;
    font-size: 12px;
    padding: 12px;
    text-transform: uppercase;
}

.images_table td {
    padding: 12px;
}

.images_table tbody tr {
    border-bottom: 1px solid #f1f5f9;
}

.images_table tbody tr:hover {
    background: #f9fafb;
}

/* ================= THUMBNAIL ================= */

.images_table_thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

/* ================= STATUS ================= */

.images_status_badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.images_status_draft {
    background: #ede9fe;
    color: #6d28d9;
}

.images_status_published {
    background: #dcfce7;
    color: #166534;
}

.images_status_archived {
    background: #e5e7eb;
    color: #374151;
}

/* ================= MODAL ================= */

.images_modal_overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.images_modal {
    width: 95%;
    max-width: 720px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.images_modal_header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
}

.images_modal_body {
    padding: 18px;
}

/* ================= FORM ================= */

.images_form_row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.images_form_col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.images_form_col input,
.images_form_col textarea,
.images_form_col select {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

.images_form_col input:focus,
.images_form_col textarea:focus,
.images_form_col select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ================= DROP ZONE ================= */

.images_drop_zone {
    border: 2px dashed #d1d5db;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}

.images_drop_zone:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

/* ================= PREVIEW ================= */

.images_preview_content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.images_preview_img {
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.images_preview_details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.images_preview_row {
    display: flex;
    flex-direction: column;
}

.images_preview_row label {
    font-size: 11px;
    color: #6b7280;
}

.images_url_copy {
    display: flex;
    gap: 6px;
}

.images_url_copy input {
    flex: 1;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 768px) {
    .images_form_row {
        flex-direction: column;
    }

    .images_preview_content {
        grid-template-columns: 1fr;
    }

    .images_actions_cell {
        flex-wrap: wrap;
    }
}/* ================= GLOBAL PAGE ================= */

.news_page {
    padding: 24px;
    background: #e3e7ec;
    min-height: 100vh;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

/* ================= HEADER ================= */

.news_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.news_header h2 {
    font-size: 26px;
    font-weight: 800;
    color: #111827;
}

/* ================= PRIMARY BUTTON ================= */
.news_btn_add {
    background: linear-gradient(135deg, #2049a3, #1d4ed8);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.news_btn_primary {
    display: block;
    width: 40%;
    margin: 20px auto 40px auto;
    /* centers horizontally */
    padding: 10px 0;
    text-align: center;

    color: #fff;
    font-weight: 600;
    font-size: 13px;

    border: none;
    border-radius: 10px;
    cursor: pointer;

    background: linear-gradient(135deg, #4f46e5, #06b6d4);

    transition: all 0.25s ease-in-out;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.news_btn_primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #6366f1, #22d3ee);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.news_btn_primary:active {
    transform: translateY(0px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.news_btn_primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.news_btn_primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.news_btn_primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ================= FILTERS ================= */

.news_filters {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.news_input,
.news_select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: white;
    min-width: 220px;
    transition: 0.2s;
}

.news_input:focus,
.news_select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

/* ================= TABLE WRAPPER ================= */

.news_table {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* ================= TABLE ================= */

.news_table table {
    width: 100%;
    border-collapse: collapse;
}

/* HEADER STYLE */
.news_table thead {
    background: linear-gradient(135deg, #111827, #1f2937);
    color: white;
}

.news_table th {
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

/* ROWS */
.news_table td {
    padding: 8px 12px;
    font-size: 13px;
    color: #374151;
    vertical-align: middle;
}

.news_table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: 0.2s;
}

.news_table tbody tr:hover {
    background: #f8fafc;
}

/* ================= IMAGE IN TABLE ================= */

.news_table_img {
    width: 50px;
    height: 38px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* ================= STATUS BADGES ================= */

.news_status {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
}

.news_status.published {
    background: #dcfce7;
    color: #166534;
}

.news_status.draft {
    background: #fef9c3;
    color: #854d0e;
}

.news_status.archived {
    background: #fee2e2;
    color: #991b1b;
}

/* ================= ACTION BUTTONS CELL ================= */

.news_actions_cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ================= ACTION BUTTONS ================= */
.news_toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* buttons */
.news_toolbar button {
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s ease;
}

.news_toolbar button:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* editor box */
.news_editor {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    min-height: 180px;
    background: white;
}

/* make tiptap content bigger */
.ProseMirror {
    min-height: 140px;
    outline: none;
}

.news_icon_btn {
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.news_icon_btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.news_icon_btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.news_preview_btn {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

.news_preview_btn:hover {
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
    background: linear-gradient(135deg, #0891b2, #0e7490);
}

.news_edit_btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
}

.news_edit_btn:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.news_archive_btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.news_archive_btn:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, #d97706, #b45309);
}

.news_delete_btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.news_delete_btn:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.news_publish_btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.news_publish_btn:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, #059669, #047857);
}

/* ================= MODAL ================= */

.news_modal_overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: news_fadeIn 0.2s ease;
}

@keyframes news_fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* MODAL */
.news_modal {
    width: 1100px;
    max-width: 95%;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: news_modalSlideIn 0.3s ease;
}

@keyframes news_modalSlideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* PREVIEW MODAL */
.news_preview_modal {
    width: 900px;
    max-width: 95%;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: news_modalSlideIn 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
}

/* MODAL HEADER */
.news_modal_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #111827, #1f2937);
    color: white;
    border-bottom: 1px solid #e5e7eb;
}

.news_modal_header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.news_modal_close_btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.news_modal_close_btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ================= MODAL BODY ================= */

.news_modal_body {
    padding: 20px;
}

/* ================= FORM ================= */

.news_form {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 12px;
}

.news_form input,
.news_form select {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    transition: 0.2s;
}

.news_form input:focus,
.news_form select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.news_form textarea {
    min-height: 120px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: 0.2s;
}

.news_form textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* ================= IMAGE UPLOAD ================= */

.news_dropzone {
    grid-column: span 3;
    border: 2px dashed #2563eb;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    transition: 0.2s;
    position: relative;
}

.news_dropzone:hover {
    background: #eef2ff;
    border-color: #1d4ed8;
}

.news_dropzone input[type="file"] {
    display: none;
}

.news_dropzone p {
    margin: 8px 0;
    color: #6b7280;
}

.news_preview {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 10px;
    border: 1px solid #e5e7eb;
}

/* ================= PREVIEW MODAL CONTENT ================= */

.news_preview_content {
    padding: 20px;
}

.news_preview_large_img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.news_preview_text h2 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 800;
    color: #111827;
}

.news_preview_text h4 {
    margin: 20px 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.news_preview_text p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

.news_preview_html {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #374151;
    line-height: 1.8;
}

/* Summernote HTML Display Styles */
.news_preview_html h1,
.news_preview_html h2,
.news_preview_html h3,
.news_preview_html h4,
.news_preview_html h5,
.news_preview_html h6 {
    margin: 16px 0 8px 0;
    color: #111827;
    font-weight: 700;
}

.news_preview_html h1 {
    font-size: 28px;
}

.news_preview_html h2 {
    font-size: 24px;
}

.news_preview_html h3 {
    font-size: 20px;
}

.news_preview_html h4 {
    font-size: 18px;
}

.news_preview_html p {
    margin: 0 0 12px 0;
    line-height: 1.8;
}

.news_preview_html strong,
.news_preview_html b {
    font-weight: 700;
    color: #1f2937;
}

.news_preview_html em,
.news_preview_html i {
    font-style: italic;
    color: #4b5563;
}

.news_preview_html u {
    text-decoration: underline;
    text-decoration-color: #2563eb;
}

.news_preview_html ul,
.news_preview_html ol {
    margin: 12px 0 12px 24px;
    line-height: 1.8;
}

.news_preview_html li {
    margin-bottom: 6px;
}

.news_preview_html blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 4px solid #2563eb;
    background: #f0f9ff;
    color: #1e40af;
    font-style: italic;
    border-radius: 4px;
}

.news_preview_html img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    border: 1px solid #e5e7eb;
}

.news_preview_html a {
    color: #2563eb;
    text-decoration: underline;
    transition: 0.2s;
}

.news_preview_html a:hover {
    color: #1d4ed8;
}

.news_preview_html code {
    background: #f3f4f6;
    color: #dc2626;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.news_preview_html pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.news_preview_html pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.news_preview_html table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.news_preview_html th {
    background: #2563eb;
    color: white;
    padding: 10px;
    text-align: left;
    border: 1px solid #1d4ed8;
}

.news_preview_html td {
    padding: 10px;
    border: 1px solid #d1d5db;
}

.news_preview_html tr:nth-child(even) {
    background: #f9fafb;
}

.news_preview_meta {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.news_preview_author {
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.news_preview_date {
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

/* ================= SUMMERNOTE STYLING ================= */

.note-editor {
    border-radius: 10px !important;
}

.note-editor.note-frame {
    border: 1px solid #d1d5db !important;
}

.note-editor.note-frame .note-toolbar {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb !important;
    border-radius: 10px 10px 0 0;
}

.note-toolbar .btn-group {
    margin-right: 5px;
}

.note-toolbar .btn {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
    transition: 0.2s;
}

.note-toolbar .btn:hover {
    background: #f0f9ff;
    border-color: #2563eb;
    color: #2563eb;
}

.note-toolbar .btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.note-editor.note-frame .note-editing-area {
    background: white;
    border-radius: 0 0 10px 10px;
}

.note-editor.note-frame .note-editable {
    color: #374151;
    font-size: 14px;
    line-height: 1.6;
}

.note-placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* ================= FORM LABEL ================= */

.news_form label {
    grid-column: span 1;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    margin-top: 8px;
}

/* ================= LOADING STATES ================= */

.news_spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: news_spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes news_spin {
    to {
        transform: rotate(360deg);
    }
}

.news_loading_row {
    padding: 40px 20px !important;
    text-align: center;
    background: #f9fafb;
}

.news_loading_row p {
    margin: 10px 0 0 0;
    color: #6b7280;
    font-weight: 500;
}

.news_empty_row {
    padding: 40px 20px !important;
    text-align: center;
    background: #f9fafb;
}

.news_empty_row p {
    margin: 0;
    color: #9ca3af;
    font-weight: 500;
}

/* ================= PAGINATION ================= */

.news_pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 16px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.news_pagination_btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.news_pagination_btn:hover:not(:disabled) {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.news_pagination_btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
}

.news_pagination_info {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 768px) {
    .news_management_container {
        padding: 12px;
    }

    .news_header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .news_controls {
        flex-direction: column;
        gap: 8px;
    }

    .news_form_content {
        grid-template-columns: 1fr !important;
    }

    .news_actions_cell {
        flex-wrap: wrap;
        gap: 4px;
    }

    .news_icon_btn span {
        display: none;
    }

    .news_pagination {
        flex-direction: column;
        gap: 8px;
    }
}

/* ================= FORM PAGE STYLES ================= */

.news_form_page {
    padding: 24px;
    background: #f4f7fc;
    min-height: 100vh;
}

.news_form_header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.news_back_btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    cursor: pointer;
}

.news_back_btn:hover {
    background: #f3f4f6;
    border-color: #2563eb;
    color: #2563eb;
}

.news_form_page h1 {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin: 0;
}

.news_form_container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.news_form_content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.news_form_left,
.news_form_right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news_form_group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news_form_group label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.news_form_group input,
.news_form_group select,
.news_form_group textarea {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: 0.2s;
}

.news_form_group input:focus,
.news_form_group select:focus,
.news_form_group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.news_form_group input[disabled],
.news_form_group textarea[disabled] {
    background: #f9fafb;
    opacity: 0.6;
    cursor: not-allowed;
}

.news_preview_container {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.news_preview_img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.news_form_actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.news_btn_cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.news_btn_cancel:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.news_loading_page,
.news_error_page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 16px;
    background: #f4f7fc;
    padding: 24px;
}

.news_loading_page p,
.news_error_page p {
    color: #6b7280;
    font-size: 16px;
    font-weight: 500;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 768px) {
    .news_management_container {
        padding: 12px;
    }

    .news_header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .news_controls {
        flex-direction: column;
        gap: 8px;
    }

    .news_form_content {
        grid-template-columns: 1fr !important;
    }

    .news_form_page {
        padding: 12px;
    }

    .news_form_container {
        padding: 16px;
    }

    .news_form_content {
        gap: 16px;
    }

    .news_actions_cell {
        flex-wrap: wrap;
        gap: 4px;
    }

    .news_icon_btn span {
        display: none;
    }

    .news_pagination {
        flex-direction: column;
        gap: 8px;
    }

    .news_form_header {
        flex-direction: column;
        gap: 12px;
    }

    .news_form_actions {
        flex-direction: column-reverse;
    }
}

.news_preview_modal {
    width: 98%;
}

.news_form {
    grid-template-columns: 1fr;
}

.news_dropzone {
    grid-column: span 1;
}


.news_icon_btn {
    padding: 6px 8px;
}

@media (max-width: 600px) {
    .news_header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .news_filters {
        flex-direction: column;
    }

    .news_input,
    .news_select {
        width: 100%;
        min-width: unset;
    }

    .news_table table {
        font-size: 12px;
    }

    .news_table th {
        padding: 6px 8px;
    }

    .news_table td {
        padding: 6px 8px;
    }

    .news_actions_cell {
        display: flex;
        gap: 4px;
    }

    .news_icon_btn {
        padding: 4px 6px;
        font-size: 10px;
    }
}/* ==================== JOBS MANAGEMENT STYLES ==================== */

/* Page Container */
.jobs_page {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
}

/* Header */
.jobs_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 15px;
}

.jobs_header h2 {
    font-size: 28px;
    margin: 0;
    color: #333;
}

.jobs_btn_add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.jobs_btn_add:hover:not(:disabled) {
    background-color: #45a049;
}

.jobs_btn_add:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Filters */
.jobs_filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.jobs_input,
.jobs_select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.jobs_input {
    flex: 1;
    min-width: 200px;
}

.jobs_input:focus,
.jobs_select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

/* Table */
.jobs_table {
    background-color: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.jobs_table table {
    width: 100%;
    border-collapse: collapse;
}

.jobs_table thead {
    background-color: #f9f9f9;
    border-bottom: 2px solid #e0e0e0;
}

.jobs_table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jobs_table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.jobs_table tbody tr:hover {
    background-color: #f9f9f9;
}

.jobs_table_img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
}

/* Status Badge */
.jobs_status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.jobs_status.draft {
    background-color: #fff3cd;
    color: #856404;
}

.jobs_status.published {
    background-color: #d4edda;
    color: #155724;
}

.jobs_status.archived {
    background-color: #e2e3e5;
    color: #383d41;
}

.jobs_employment_type {
    display: inline-block;
    padding: 4px 10px;
    background-color: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Actions */
.jobs_actions_cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.jobs_icon_btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

.jobs_icon_btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.jobs_preview_btn {
    background-color: #2196F3;
    color: white;
}

.jobs_preview_btn:hover:not(:disabled) {
    background-color: #0b7dda;
}

.jobs_publish_btn {
    background-color: #4CAF50;
    color: white;
}

.jobs_publish_btn:hover:not(:disabled) {
    background-color: #45a049;
}

.jobs_edit_btn {
    background-color: #9C27B0;
    color: white;
}

.jobs_edit_btn:hover:not(:disabled) {
    background-color: #7b1fa2;
}

.jobs_archive_btn {
    background-color: #FF9800;
    color: white;
}

.jobs_archive_btn:hover:not(:disabled) {
    background-color: #e68900;
}

.jobs_delete_btn {
    background-color: #f44336;
    color: white;
}

.jobs_delete_btn:hover:not(:disabled) {
    background-color: #da190b;
}

/* Loading */
.jobs_loading_row,
.jobs_empty_row {
    text-align: center;
    padding: 40px !important;
    color: #999;
}

.jobs_spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: jobs_spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes jobs_spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Pagination */
.jobs_pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.jobs_pagination button {
    padding: 8px 16px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.jobs_pagination button:hover:not(:disabled) {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.jobs_pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.jobs_pagination span {
    font-weight: 600;
    color: #333;
}

/* Modal */
.jobs_modal_overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.jobs_modal {
    background-color: white;
    border-radius: 8px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.jobs_modal_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.jobs_modal_header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.jobs_modal_close_btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.jobs_modal_close_btn:hover {
    color: #333;
}

.jobs_modal_body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Form */
.jobs_form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.jobs_form_group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jobs_form_group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.jobs_form_input,
.jobs_editor {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
}

.jobs_form_input:focus,
.jobs_editor:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.jobs_editor {
    min-height: 200px;
    padding: 12px;
}

/* Image Upload */
.jobs_image_upload {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #999;
}

.jobs_image_upload:hover {
    border-color: #4CAF50;
    background-color: #f9f9f9;
}

.jobs_image_preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
}

.jobs_uploading {
    color: #4CAF50;
    font-size: 13px;
    margin-top: 8px;
}

/* Toolbar */
.jobs_toolbar {
    display: flex;
    gap: 8px;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.jobs_toolbar button {
    padding: 6px 12px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.jobs_toolbar button:hover {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* Form Buttons */
.jobs_form_buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 10px;
}

.jobs_btn_cancel,
.jobs_btn_submit {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.jobs_btn_cancel {
    background-color: #e0e0e0;
    color: #333;
}

.jobs_btn_cancel:hover {
    background-color: #d0d0d0;
}

.jobs_btn_submit {
    background-color: #4CAF50;
    color: white;
}

.jobs_btn_submit:hover:not(:disabled) {
    background-color: #45a049;
}

.jobs_btn_submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Preview Modal */
.jobs_preview_modal {
    background-color: white;
    border-radius: 8px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.jobs_preview_content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.jobs_preview_large_img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 20px;
}

.jobs_preview_text {
    color: #333;
}

.jobs_preview_text h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
}

.jobs_preview_text h4 {
    margin: 20px 0 10px 0;
    font-size: 16px;
    color: #555;
}

.jobs_preview_meta {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 13px;
    color: #999;
}

.jobs_preview_author,
.jobs_preview_date,
.jobs_preview_location,
.jobs_preview_salary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.jobs_preview_tags {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.jobs_preview_html {
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .jobs_page {
        padding: 15px;
    }

    .jobs_header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .jobs_filters {
        flex-direction: column;
    }

    .jobs_input {
        width: 100%;
    }

    .jobs_table th,
    .jobs_table td {
        padding: 10px;
        font-size: 12px;
    }

    .jobs_table_img {
        width: 40px;
        height: 40px;
    }

    .jobs_actions_cell {
        flex-direction: column;
    }

    .jobs_icon_btn {
        width: 100%;
        justify-content: center;
    }

    .jobs_modal {
        max-width: 95vw;
    }
}.enquire-app {
  display: flex;
  width: 100%;
  height: 100vh;      /* fixed to viewport — no page-level scroll */
  overflow: hidden;    /* only inner regions scroll, so scrolling always matches the real screen size */
  background: #F5F6FB;
  font-family: 'Inter', system-ui, sans-serif;
}

/* Sidebar */
.enquire-sidebar {
  flex: 0 0 240px;
  width: 240px;
  height: 100%;
  background: #002060;
  color: #fff;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
}

.enquire-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}

.enquire-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #E820DA 0%, #7A1FD6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.enquire-brand-name {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.25;
}

.enquire-brand-name small {
  display: block;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.enquire-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.enquire-nav-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  padding: 14px 12px 6px;
}

.enquire-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: all 0.2s;
}

.enquire-nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.85;
}

.enquire-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.enquire-nav-item.enquire-active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: inset 3px 0 0 #E820DA;
}

.enquire-nav-count {
  margin-left: auto;
  background: #E820DA;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1.5px 7px;
  border-radius: 20px;
}

.enquire-sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.enquire-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E820DA, #6E1FC4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
}

.enquire-sidebar-foot .enquire-who {
  font-size: 12.5px;
  font-weight: 600;
}

.enquire-sidebar-foot .enquire-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

/* Main Content — fills ALL remaining width AND height, single scroll region */
.enquire-main-content {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 90%;
  overflow-y: auto;     /* the ONE scrollbar for the whole page — sized to the real viewport */
  overflow-x: auto;
    padding: 10px clamp(6px, 2vw, 12px) 22px;
  display: flex;
  flex-direction: column;
}

.enquire-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.enquire-topbar h1 {
  font-size: 22px;
  margin: 0 0 4px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #12172B;
}

.enquire-topbar p {
  margin: 0;
  color: #6B7280;
  font-size: 13.5px;
}

.enquire-topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.enquire-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid #E7E9F2;
  background: #fff;
  color: #002060;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.enquire-btn:hover {
  background: #F5F6FB;
}

.enquire-btn-primary {
  background: linear-gradient(90deg, #002060 0%, #E820DA 130%);
  color: #fff;
  border: none;
  box-shadow: 0 6px 16px rgba(232, 32, 218, 0.25);
}

.enquire-btn-primary:hover {
  box-shadow: 0 8px 20px rgba(232, 32, 218, 0.35);
  transform: translateY(-1px);
  color: #002060;
}

/* Stats — responsive, never overflow */
.enquire-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
  width: 100%;
}

.enquire-stat-card {
  background: #FFFFFF;
  border: 1px solid #E7E9F2;
  border-radius: 14px;
  padding: 16px 18px;
  min-width: 0;
}

.enquire-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.enquire-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.enquire-stat-icon svg {
  width: 16px;
  height: 16px;
}

.enquire-stat-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #12172B;
}

.enquire-stat-label {
  font-size: 12.5px;
  color: #6B7280;
  margin-top: 2px;
}

.enquire-stat-delta {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.enquire-stat-delta.enquire-up {
  color: #0F9D58;
}

.enquire-stat-delta.enquire-flat {
  color: #9CA3AF;
}

/* Panel & Filters — take full available width */
.enquire-panel {
  background: #FFFFFF;
  border: 1px solid #E7E9F2;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
  width: 100%;
}

/* Use ONLY on panels that should stretch to fill the rest of the screen
   (e.g. the main Enquiries table). Do NOT put this on forms/simple panels
   or their content will get clipped. */
.enquire-panel--fill {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.enquire-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-bottom: 1px solid #E7E9F2;
}

.enquire-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #E7E9F2;
  border-radius: 9px;
  padding: 8px 12px;
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 320px;
  background: #FBFBFD;
}

.enquire-search svg {
  width: 15px;
  height: 15px;
  color: #9CA3AF;
  flex-shrink: 0;
}

.enquire-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  width: 100%;
  font-family: inherit;
}

.enquire-pill {
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid #E7E9F2;
  background: #FBFBFD;
  color: #12172B;
  font-family: inherit;
  cursor: pointer;
}

.enquire-filters-right {
  margin-left: auto;
  color: #6B7280;
  font-size: 12.5px;
  white-space: nowrap;
}

/* Table wrapper — base: just allows horizontal scroll on narrow screens */
.enquire-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

/* Use with .enquire-panel--fill: makes the table consume the rest of the
   screen and scroll vertically inside it (e.g. main Enquiries list). */
.enquire-table-wrapper--fill {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* Use for standalone lists that should scroll within a fixed, comfortable
   height instead of growing forever (e.g. Offices list). */
.enquire-table-wrapper--scroll {
  max-height: min(55vh, 520px);
  overflow-y: auto;
}

.enquire-filters,
.enquire-pagination {
  flex: 0 0 auto;   /* these never shrink or grow — only the fill table area does */
}

.enquire-table {
  width: 100%;
  min-width: 720px; /* keeps columns readable, scrolls inside wrapper on small screens */
  border-collapse: collapse;
}

.enquire-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9CA3AF;
  padding: 12px 18px;
  border-bottom: 1px solid #E7E9F2;
  background: #FCFCFE;
  white-space: nowrap;
}

.enquire-table tbody tr {
  border-bottom: 1px solid #E7E9F2;
  cursor: pointer;
  transition: background 0.12s ease;
}

.enquire-table tbody tr:hover {
  background: #FBFAFF;
}

.enquire-table tbody tr:last-child {
  border-bottom: none;
}

.enquire-table td {
  padding: 13px 18px;
  font-size: 13.3px;
  vertical-align: middle;
}

.enquire-lead-name {
  font-weight: 700;
  color: #002060;
}

.enquire-lead-sub {
  font-size: 11.5px;
  color: #9CA3AF;
  margin-top: 1px;
}

.enquire-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.enquire-tag {
  font-size: 10.8px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: #EEF1FA;
  color: #0A2E7A;
  white-space: nowrap;
}

.enquire-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.enquire-status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.enquire-status-pill.enquire-new {
  background: #FCE9FB;
  color: #E820DA;
}

.enquire-status-pill.enquire-contacted {
  background: #FDF3E3;
  color: #B7791F;
}

.enquire-status-pill.enquire-converted {
  background: #E9F9EF;
  color: #0F9D58;
}

.enquire-row-office {
  color: #6B7280;
  font-size: 12.8px;
  white-space: nowrap;
}

.enquire-row-time {
  color: #9CA3AF;
  font-size: 12px;
  white-space: nowrap;
}

.enquire-chevron {
  width: 15px;
  height: 15px;
  color: #9CA3AF;
}

.enquire-table-note {
  margin-top: 14px;
  color: #9CA3AF;
  font-size: 12px;
}

/* Reusable form styling (Add Office, etc.) */
.enquire-form-title {
  font-size: 15px;
  font-weight: 800;
  color: #002060;
  margin: 0 0 18px;
}

.enquire-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}

.enquire-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.enquire-field--full {
  grid-column: 1 / -1;
}

.enquire-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: #12172B;
}

.enquire-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #E7E9F2;
  border-radius: 9px;
  font-size: 13.5px;
  font-family: inherit;
  background: #FBFBFD;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.enquire-input:focus {
  outline: none;
  border-color: #E820DA;
  box-shadow: 0 0 0 3px rgba(232, 32, 218, 0.12);
  background: #fff;
}

.enquire-input::placeholder {
  color: #9CA3AF;
}

.enquire-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

/* Scrollable form body — use when a form panel should stay within a fixed
   comfortable height instead of growing indefinitely (e.g. Add Office). */
.enquire-form-scroll {
  max-height: min(45vh, 380px);
  overflow-y: auto;
  padding-right: 6px;
}

/* Nicer, thinner scrollbars for the scrollable areas */
.enquire-main-content,
.enquire-table-wrapper,
.enquire-table-wrapper--fill,
.enquire-table-wrapper--scroll,
.enquire-form-scroll,
.enquire-sidebar {
  scrollbar-width: thin;
  scrollbar-color: #D7DAE8 transparent;
}

.enquire-main-content::-webkit-scrollbar,
.enquire-table-wrapper::-webkit-scrollbar,
.enquire-form-scroll::-webkit-scrollbar,
.enquire-sidebar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.enquire-main-content::-webkit-scrollbar-thumb,
.enquire-table-wrapper::-webkit-scrollbar-thumb,
.enquire-form-scroll::-webkit-scrollbar-thumb {
  background: #D7DAE8;
  border-radius: 20px;
}

.enquire-main-content::-webkit-scrollbar-thumb:hover,
.enquire-table-wrapper::-webkit-scrollbar-thumb:hover,
.enquire-form-scroll::-webkit-scrollbar-thumb:hover {
  background: #B9BEDA;
}

.enquire-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
}

/* Small label under a scrollable table so it's obvious there's more to see */
.enquire-scroll-hint {
  padding: 10px 18px;
  font-size: 11.5px;
  color: #9CA3AF;
  text-align: center;
  border-top: 1px solid #E7E9F2;
  background: #FCFCFE;
}

/* Drawer */
.enquire-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 40, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 40;
}

.enquire-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.enquire-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 420px;
  max-width: 92vw;
  background: #fff;
  box-shadow: -16px 0 40px rgba(10, 16, 40, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.enquire-drawer.show {
  transform: translateX(0);
}

.enquire-drawer-head {
  padding: 20px 22px;
  border-bottom: 1px solid #E7E9F2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.enquire-drawer-head h2 {
  margin: 0 0 3px;
  font-size: 18px;
  font-weight: 800;
  color: #12172B;
}

.enquire-drawer-head p {
  margin: 0;
  color: #6B7280;
  font-size: 12.5px;
}

.enquire-drawer-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #E7E9F2;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.enquire-drawer-close:hover {
  background: #F5F6FB;
}

.enquire-drawer-close svg {
  width: 14px;
  height: 14px;
}

.enquire-drawer-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.enquire-step-block {
  border: 1px solid #E7E9F2;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.enquire-step-block h4 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #E820DA;
  display: flex;
  align-items: center;
  gap: 7px;
}

.enquire-step-block h4 .enquire-num {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #002060;
  color: #fff;
  font-size: 9.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
  flex-shrink: 0;
}

.enquire-kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
}

.enquire-kv .enquire-k {
  color: #6B7280;
}

.enquire-kv .enquire-v {
  font-weight: 600;
  text-align: right;
}

.enquire-drawer-foot {
  padding: 16px 22px;
  border-top: 1px solid #E7E9F2;
  display: flex;
  gap: 8px;
}

.enquire-drawer-foot .enquire-btn {
  flex: 1;
  justify-content: center;
}

.enquire-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #9CA3AF;
  gap: 12px;
}

.enquire-loading svg {
  color: #E820DA;
}

.enquire-empty {
  text-align: center;
  padding: 40px 20px;
  color: #9CA3AF;
  font-style: italic;
}

/* Pagination bar */
.enquire-pagination {
  flex-wrap: wrap;
  gap: 10px;
}
/* Contact message status colors */
.enquire-status-pill.enquire-read {
  background: #EEF1FA;
  color: #002060;
}

.enquire-status-pill.enquire-replied {
  background: #E9F9EF;
  color: #0F9D58;
}

.enquire-status-pill.enquire-archived {
  background: #F3F4F6;
  color: #6B7280;
}

/* Responsive */
@media (max-width: 900px) {
  .enquire-app {
    flex-direction: column;
  }

  .enquire-sidebar {
    display: none;
  }

  .enquire-main-content {
    padding: 20px 16px 40px;
  }

  .enquire-stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .enquire-form-grid {
    grid-template-columns: 1fr;
  }
}/* ============================================
   WRAPPER - FULL HEIGHT FLEX CONTAINER
   ============================================ */
.careservice-admin-wrapper {
  --careservice-navy: rgb(0, 32, 96);
  --careservice-navy-dark: rgb(0, 22, 68);
  --careservice-pink: #d6336c;
  --careservice-pink-light: #fbe4ec;
  --careservice-border: #e3e5e9;
  --careservice-text: #1c1f26;
  --careservice-muted: #666c76;
  --careservice-danger: #c0392b;
  --careservice-danger-bg: #fdecea;
  --careservice-success: #27ae60;
  --careservice-success-bg: #e8f5e9;
  --careservice-warning: #f39c12;
  --careservice-bg: #f8f9fa;

  max-width: 95%;
  margin: 0 auto;
  padding: 0;
  color: var(--careservice-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--careservice-bg);

  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  min-height: 0;
}

/* ============================================
   HEADER - FIXED (Now contains Search, Rows Selector & Count)
   ============================================ */
.careservice-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 2px solid var(--careservice-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  gap: 20px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.careservice-header-content {
  flex: 1;
  min-width: 200px;
}

.careservice-header-content h1 {
  font-size: 26px;
  margin: 0 0 4px;
  color: var(--careservice-navy);
  font-weight: 700;
  line-height: 1.2;
}

.careservice-header-content p {
  margin: 0;
  color: var(--careservice-muted);
  font-size: 14px;
  line-height: 1.5;
}

.careservice-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.careservice-search-wrapper {
  position: relative;
  width: 220px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--careservice-muted);
}

.careservice-search {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 2px solid var(--careservice-border);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #fff;
}

.careservice-search:focus {
  outline: none;
  border-color: var(--careservice-navy);
  box-shadow: 0 0 0 3px rgba(0, 32, 96, 0.1);
}

/* ============================================
   ROWS PER PAGE SELECTOR
   ============================================ */
.careservice-rows-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--careservice-muted);
  font-weight: 600;
  background: var(--careservice-bg);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--careservice-border);
}

.careservice-rows-selector label {
  margin: 0;
}

.careservice-rows-dropdown {
  padding: 6px 10px;
  border: 2px solid var(--careservice-border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--careservice-navy);
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  min-width: 70px;
}

.careservice-rows-dropdown:focus {
  border-color: var(--careservice-navy);
  box-shadow: 0 0 0 3px rgba(0, 32, 96, 0.1);
}

.careservice-rows-selector span {
  font-size: 13px;
}

.careservice-count {
  font-size: 14px;
  color: var(--careservice-muted);
  font-weight: 600;
  white-space: nowrap;
  padding: 8px 14px;
  background: var(--careservice-bg);
  border-radius: 8px;
}

/* ============================================
   BUTTONS
   ============================================ */
.careservice-btn {
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.careservice-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.careservice-btn-primary {
  background: var(--careservice-navy);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 32, 96, 0.25);
}

.careservice-btn-primary:hover:not(:disabled) {
  background: var(--careservice-navy-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 32, 96, 0.3);
}

.careservice-btn-outline {
  background: #fff;
  color: var(--careservice-navy);
  border: 2px solid var(--careservice-border);
}

.careservice-btn-outline:hover:not(:disabled) {
  border-color: var(--careservice-navy);
  background: var(--careservice-bg);
}

.careservice-btn-danger {
  background: var(--careservice-danger);
  color: #fff;
}

.careservice-btn-danger:hover:not(:disabled) {
  background: #a93226;
  transform: translateY(-2px);
}

.careservice-btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 6px;
}

.btn-icon {
  font-size: 20px;
  line-height: 1;
  font-weight: bold;
}

/* ============================================
   ALERT MESSAGES
   ============================================ */
.careservice-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  margin: 20px 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.careservice-alert-error {
  background: var(--careservice-danger-bg);
  color: var(--careservice-danger);
  border: 2px solid #f3c8c3;
}

.alert-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ============================================
   SCROLL CONTAINER - FIXED VERSION
   ============================================ */
.careservice-scroll-container {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding: 14px 22px;
  padding-bottom: 40px;
  max-height: calc(100vh - 140px);
}

.careservice-scroll-container::-webkit-scrollbar { 
  width: 10px; 
}

.careservice-scroll-container::-webkit-scrollbar-track { 
  background: var(--careservice-bg); 
  border-radius: 10px; 
}

.careservice-scroll-container::-webkit-scrollbar-thumb { 
  background: var(--careservice-border); 
  border-radius: 10px; 
}

.careservice-scroll-container::-webkit-scrollbar-thumb:hover { 
  background: var(--careservice-muted); 
}

/* ============================================
   PAGINATION - Enhanced Visibility
   ============================================ */
.careservice-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  margin-bottom: 20px;
  padding: 10px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 2px solid var(--careservice-border);
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
}

.careservice-pagination-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--careservice-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.careservice-pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.careservice-page-btn {
  padding: 10px 16px;
  border: 2px solid var(--careservice-border);
  background: #fff;
  color: var(--careservice-text);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 40px;
  justify-content: center;
}

.careservice-page-btn:hover:not(:disabled) {
  border-color: var(--careservice-navy);
  color: var(--careservice-navy);
  background: var(--careservice-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 32, 96, 0.15);
}

.careservice-page-btn.active {
  background: var(--careservice-navy);
  color: #fff;
  border-color: var(--careservice-navy);
  box-shadow: 0 4px 12px rgba(0, 32, 96, 0.3);
  transform: translateY(-2px);
}

.careservice-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--careservice-bg);
  transform: none;
}

/* ============================================
   GRID - Content inside the scroll container
   ============================================ */
.careservice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
  padding-bottom: 10px;
  width: 100%;
}

/* ============================================
   CARDS
   ============================================ */
.careservice-card {
  background: #fff;
  border: 2px solid var(--careservice-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  break-inside: avoid;
  page-break-inside: avoid;
}

.careservice-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  border-color: var(--careservice-navy);
}

.careservice-card-media {
  position: relative;
  height: 200px;
  background: linear-gradient(135deg, var(--careservice-pink-light), #e7ebf3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.careservice-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.careservice-card:hover .careservice-card-image {
  transform: scale(1.08);
}

.careservice-card-icon {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--careservice-pink), var(--careservice-navy));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 28px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.careservice-card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--careservice-navy);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 24px;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.careservice-card-inactive {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(4px);
}

.careservice-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.careservice-card-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--careservice-navy);
  line-height: 1.3;
}

.careservice-card-summary {
  font-size: 15px;
  color: var(--careservice-muted);
  line-height: 1.7;
  margin: 0 0 20px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 60px;
}

.careservice-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-top: 16px;
  border-top: 2px solid var(--careservice-border);
}

.careservice-card-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--careservice-muted);
  font-weight: 500;
}

.careservice-card-status {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.careservice-card-status.active {
  background: var(--careservice-success-bg);
  color: var(--careservice-success);
}

.careservice-card-status.inactive {
  background: var(--careservice-danger-bg);
  color: var(--careservice-danger);
}

.careservice-card-actions {
  display: flex;
  gap: 12px;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.careservice-empty {
  text-align: center;
  padding: 100px 32px;
  color: var(--careservice-muted);
  background: #fff;
  border-radius: 14px;
  border: 3px dashed var(--careservice-border);
  margin: 24px 0;
}

.empty-icon { width: 80px; height: 80px; margin-bottom: 24px; opacity: 0.4; }
.careservice-empty h3 { font-size: 24px; color: var(--careservice-text); margin: 0 0 12px; font-weight: 700; }
.careservice-empty p { margin: 0 0 32px; font-size: 16px; }

/* ============================================
   MODAL
   ============================================ */
.careservice-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 25, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow: auto;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.careservice-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.careservice-modal-sm { max-width: 520px; }

.careservice-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 32px 32px 0;
  gap: 20px;
}

.careservice-modal-header h2 { margin: 0 0 6px; font-size: 28px; color: var(--careservice-navy); font-weight: 700; }
.careservice-modal-sub { margin: 0; font-size: 15px; color: var(--careservice-muted); line-height: 1.6; }

.careservice-modal-close {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--careservice-muted);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.careservice-modal-close:hover {
  background: var(--careservice-bg);
  color: var(--careservice-text);
  transform: rotate(90deg);
}

.careservice-form-content { padding: 32px; }

/* ============================================
   FORM FIELDS
   ============================================ */
.careservice-field { margin-bottom: 24px; }
.careservice-field-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 10px; color: var(--careservice-text); }
.required { color: var(--careservice-danger); }

.careservice-input,
.careservice-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--careservice-border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: #fff;
  box-sizing: border-box;
}

.careservice-input:focus,
.careservice-textarea:focus {
  outline: none;
  border-color: var(--careservice-navy);
  box-shadow: 0 0 0 4px rgba(0, 32, 96, 0.1);
}

.careservice-textarea { resize: vertical; min-height: 100px; }
.careservice-field-hint { display: block; margin-top: 8px; font-size: 13px; color: var(--careservice-muted); text-align: right; }

/* ============================================
   IMAGE UPLOAD
   ============================================ */
.careservice-field-image { margin-bottom: 28px; }

.careservice-image-upload {
  position: relative;
  border: 3px dashed var(--careservice-border);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--careservice-bg);
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.careservice-image-upload:hover { border-color: var(--careservice-navy); background: rgba(0, 32, 96, 0.03); }
.careservice-image-upload.has-image { padding: 0; border-style: solid; border-color: var(--careservice-border); min-height: auto; overflow: hidden; }

.careservice-file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.careservice-upload-placeholder { padding: 32px; }

.upload-icon { width: 64px; height: 64px; margin: 0 auto 20px; color: var(--careservice-muted); }
.upload-text { margin: 0 0 10px; font-size: 16px; color: var(--careservice-text); font-weight: 600; }
.upload-highlight { color: var(--careservice-navy); text-decoration: underline; }
.upload-hint { margin: 0; font-size: 14px; color: var(--careservice-muted); }

.careservice-image-preview { position: relative; width: 100%; height: 240px; overflow: hidden; }
.careservice-image-preview img { width: 100%; height: 100%; object-fit: cover; }

.careservice-remove-image {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(192, 57, 43, 0.95);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.careservice-remove-image:hover { background: var(--careservice-danger); transform: scale(1.15) rotate(90deg); }

.careservice-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.careservice-image-upload:hover .careservice-image-overlay { opacity: 1; }

/* ============================================
   FIELD ROW & CHECKBOX
   ============================================ */
.careservice-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.careservice-field-checkbox { margin-top: 28px; padding-top: 28px; border-top: 2px solid var(--careservice-border); }

.careservice-checkbox-label { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; user-select: none; }
.careservice-checkbox-label input[type="checkbox"] { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }

.careservice-checkbox-custom {
  height: 24px;
  width: 24px;
  background-color: #fff;
  border: 2px solid var(--careservice-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.careservice-checkbox-label input:checked ~ .careservice-checkbox-custom { background-color: var(--careservice-navy); border-color: var(--careservice-navy); }
.careservice-checkbox-custom svg { display: none; color: #fff; }
.careservice-checkbox-label input:checked ~ .careservice-checkbox-custom svg { display: block; }

.careservice-checkbox-text { display: flex; flex-direction: column; gap: 3px; }
.careservice-checkbox-hint { font-size: 13px; color: var(--careservice-muted); font-weight: 400; }

/* ============================================
   MODAL ACTIONS & SPINNER
   ============================================ */
.careservice-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding: 24px 32px 32px;
  border-top: 2px solid var(--careservice-border);
  background: var(--careservice-bg);
  border-radius: 0 0 20px 20px;
}

.spinner { animation: spin 1s linear infinite; width: 18px; height: 18px; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.opacity-25 { opacity: 0.25; }
.opacity-75 { opacity: 0.75; }

/* ============================================
   DELETE MODAL
   ============================================ */
.careservice-modal-danger .careservice-modal-header { flex-direction: column; align-items: center; text-align: center; padding-top: 40px; }

.careservice-danger-icon {
  width: 80px;
  height: 80px;
  background: var(--careservice-danger-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--careservice-danger);
  margin-bottom: 20px;
}

.careservice-confirm-content { padding: 0 32px 32px; }
.careservice-confirm-text { font-size: 17px; color: var(--careservice-text); margin: 0 0 16px; line-height: 1.6; }
.careservice-confirm-sub { font-size: 15px; color: var(--careservice-muted); margin: 0; line-height: 1.7; }

/* ============================================
   TOAST
   ============================================ */
.careservice-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--careservice-navy);
  color: #fff;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: toastSlideIn 0.4s ease forwards;
}

.careservice-toast-success { background: var(--careservice-success); }
.careservice-toast-error { background: var(--careservice-danger); }

@keyframes toastSlideIn { to { transform: translateX(-50%) translateY(0); } }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
  .careservice-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

@media (max-width: 768px) {
  .careservice-admin-wrapper { max-width: 100%; height: 100dvh; max-height: 100dvh; }

  .careservice-admin-header {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 16px;
  }

  .careservice-header-content { text-align: center; }
  
  .careservice-header-actions {
    width: 100%;
    justify-content: center;
  }

  .careservice-search-wrapper {
    width: 100%;
    max-width: 300px;
  }

  .careservice-rows-selector {
    width: 100%;
    justify-content: center;
  }

  .careservice-btn { width: 100%; }

  .careservice-scroll-container { 
    padding: 14px 16px; 
    padding-bottom: 30px;
    max-height: calc(100dvh - 160px);
  }
  
  .careservice-grid { grid-template-columns: 1fr; gap: 20px; }
  .careservice-card-media { height: 220px; }
  .careservice-field-row { grid-template-columns: 1fr; gap: 0; }

  .careservice-modal { max-height: 100vh; border-radius: 0; margin: 0; }
  .careservice-modal-header { padding: 24px 24px 0; }
  .careservice-form-content { padding: 24px; }
  .careservice-modal-actions { padding: 20px 24px 24px; flex-direction: column-reverse; }
  .careservice-modal-actions .careservice-btn { width: 100%; }

  .careservice-image-upload { min-height: 200px; }
  .careservice-image-preview { height: 200px; }

  .careservice-pagination {
    margin-top: 30px;
    margin-bottom: 15px;
    padding: 16px 12px;
  }
  
  .careservice-page-btn {
    padding: 8px 12px;
    min-width: 36px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .careservice-card-actions { flex-direction: column; }
  .careservice-card-actions .careservice-btn { width: 100%; }

  .careservice-card-meta { flex-direction: column; align-items: flex-start; gap: 12px; }
  .careservice-empty { padding: 80px 20px; margin: 20px 0; }
  .careservice-field { margin-bottom: 20px; }
  .careservice-modal-overlay { padding: 20px; }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .careservice-admin-header button,
  .careservice-card-actions,
  .careservice-modal-overlay,
  .careservice-pagination {
    display: none !important;
  }

  .careservice-grid { display: block; }
  .careservice-card { break-inside: avoid; margin-bottom: 24px; box-shadow: none; border: 2px solid #ddd; }
}/* ═══════════════════════════════════════════════════════════════
   QR CODE MANAGEMENT — Policies-Style Layout
   Brand: #002060 (Navy) | #E820DA (Magenta) | #0F9D58 (Green)
   No :root variables. All direct hex values.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Base Container ─── */
.qrcode-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Oxygen", "Ubuntu", "Cantarell", sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #ececec;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ─── Header Section ─── */
.qrcode-header {
  background: linear-gradient(135deg, #002060 0%, #E820DA 100%);
  color: white;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.qrcode-header-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.qrcode-header-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ─── Top Section ─── */
.qrcode-top-section {
  background: rgb(228, 228, 228);
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 1px;
  z-index: 90;
}

/* Stats Pills */
.qrcode-stats-bar {
  display: flex;
  gap: 0.5rem;
  margin-right: auto;
  flex-wrap: wrap;
}

.qrcode-stat-pill {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 80px;
  transition: transform 0.2s;
  border: 1px solid #e2e8f0;
}

.qrcode-stat-pill:hover {
  transform: translateY(-2px);
}

.qrcode-stat-pill-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #002060 0%, #E820DA 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.qrcode-stat-pill-content {
  display: flex;
  flex-direction: column;
}

.qrcode-stat-pill-value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  color: #002060;
}

.qrcode-stat-pill-label {
  font-size: 0.65rem;
  color: #6c757d;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Controls */
.qrcode-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.qrcode-search {
  position: relative;
  flex: 1;
  min-width: 150px;
  max-width: 280px;
}

.qrcode-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.qrcode-search input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 38px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.2s;
  background: white;
  box-sizing: border-box;
  color: #333;
}

.qrcode-search input:focus {
  outline: none;
  border-color: #E820DA;
  box-shadow: 0 0 0 3px rgba(232, 32, 218, 0.12);
}

.qrcode-search input::placeholder {
  color: #94a3b8;
}

/* View Mode Toggle */
.qrcode-view-toggle {
  display: flex;
  background-color: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.qrcode-view-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  transition: all 0.2s;
}

.qrcode-view-btn:hover {
  background-color: #e9ecef;
}

.qrcode-view-btn.active {
  background-color: #002060;
  color: white;
}

/* Buttons */
.qrcode-btn {
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  white-space: nowrap;
  line-height: 1;
}

.qrcode-btn-add {
  background: linear-gradient(135deg, #002060 0%, #1e3a8a 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 32, 96, 0.2);
}

.qrcode-btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 32, 96, 0.3);
}

.qrcode-btn-refresh {
  background: white;
  color: #002060;
  border: 1px solid #e2e8f0;
  padding: 0.5rem;
  min-width: 36px;
}

.qrcode-btn-refresh:hover {
  border-color: #E820DA;
  color: #E820DA;
  background: #fdf2f8;
}

.qrcode-btn-primary {
  background: linear-gradient(135deg, #002060 0%, #1e3a8a 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 32, 96, 0.2);
}

.qrcode-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 32, 96, 0.3);
}

.qrcode-btn-outline {
  background: white;
  color: #002060;
  border: 1.5px solid #e2e8f0;
}

.qrcode-btn-outline:hover:not(:disabled) {
  border-color: #E820DA;
  color: #E820DA;
  background: #fdf2f8;
}

.qrcode-btn-sm {
  padding: 7px 12px;
  font-size: 12px;
  min-height: 34px;
}

.qrcode-btn-cancel {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #333;
}

.qrcode-btn-cancel:hover {
  background: #f7fafc;
  border-color: #cbd5e0;
}

.qrcode-btn-submit {
  flex: 1;
  padding: 0.75rem;
  background: linear-gradient(135deg, #002060 0%, #1e3a8a 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.qrcode-btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 32, 96, 0.3);
}

.qrcode-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Page Title ─── */
.qrcode-page-title {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a202c;
  margin: 1rem 0 0.5rem 0;
  padding: 0 1rem;
}

/* ─── Main Content Area ─── */
.qrcode-content-wrapper {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── Loading State ─── */
.qrcode-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
}

.qrcode-loading svg {
  margin-bottom: 1rem;
  color: #E820DA;
}

.qrcode-spin {
  animation: qrcode-spin 1s linear infinite;
}

@keyframes qrcode-spin {
  to { transform: rotate(360deg); }
}

/* ─── Empty State ─── */
.qrcode-empty {
  text-align: center;
  padding: 3rem 1rem;
  background: white;
  border-radius: 12px;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.qrcode-empty svg {
  margin-bottom: 1rem;
  color: #94a3b8;
}

.qrcode-empty h3 {
  font-size: 1.25rem;
  color: #1a202c;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.qrcode-empty p {
  color: #718096;
  font-size: 0.875rem;
  margin: 0 0 1.25rem 0;
}

/* ─── Grid View ─── */
.qrcode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.qrcode-card {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
  border: 1px solid #e2e8f0;
}

.qrcode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: #002060;
}

.qrcode-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 8px;
}

.qrcode-card-icon-wrapper {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #eef1fa 0%, #fce9fb 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}

.qrcode-card-icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

.qrcode-card-campaign-badge {
  padding: 0.25rem 0.625rem;
  background: #e0e7ff;
  color: #5a67d8;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
}

.qrcode-card-status {
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.qrcode-card-status.active {
  background: #e9f9ef;
  color: #0F9D58;
  border: 1px solid #bbf7d0;
}

.qrcode-card-status.inactive {
  background: #fef2f2;
  color: #DC2626;
  border: 1px solid #fecaca;
}

.qrcode-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qrcode-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.qrcode-card-info-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: #4a5568;
  font-size: 0.813rem;
}

.qrcode-card-info-item svg {
  width: 14px;
  height: 14px;
  color: #718096;
  flex-shrink: 0;
}

.qrcode-card-actions {
  display: flex;
  justify-content: flex-start;
  gap: 0.375rem;
  margin-top: 0.75rem;
}

.qrcode-action-btn {
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex: 1;
  font-size: 0.8rem;
  font-weight: 500;
  color: #4a5568;
}

.qrcode-action-btn svg {
  width: 15px;
  height: 15px;
}

.qrcode-btn-view {
  color: #667eea;
  border-color: #e0e7ff;
  flex: 0 0 auto;
  min-width: 36px;
}
.qrcode-btn-view:hover {
  background: #e0e7ff;
  border-color: #667eea;
}

.qrcode-btn-download {
  color: #48bb78;
  border-color: #c6f6d5;
}
.qrcode-btn-download:hover {
  background: #c6f6d5;
  border-color: #48bb78;
}

.qrcode-btn-copy {
  color: #002060;
  border-color: #e2e8f0;
}
.qrcode-btn-copy:hover {
  background: #eef1fa;
  border-color: #002060;
}

.qrcode-btn-copied {
  color: #0F9D58;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

/* ─── List View ─── */
.qrcode-list-container {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
}

.qrcode-list-header {
  display: none;
  background-color: #f8f9fa;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #495057;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qrcode-list-cell {
  padding: 0 0.5rem;
}

.qrcode-list-name-cell { flex: 2; }
.qrcode-list-campaign-cell { flex: 1; }
.qrcode-list-scans-cell { flex: 0.5; }
.qrcode-list-location-cell { flex: 1; }
.qrcode-list-date-cell { flex: 1; }
.qrcode-list-actions-cell { flex: 1; min-width: 130px; }

.qrcode-list-item {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 0.2s;
}

.qrcode-list-item:last-child {
  border-bottom: none;
}

.qrcode-list-item:hover {
  background-color: #f8f9fa;
}

.qrcode-list-name-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.qrcode-list-thumb {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #eef1fa 0%, #fce9fb 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}

.qrcode-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
}

.qrcode-list-thumb svg {
  width: 16px;
  height: 16px;
  color: #002060;
}

.qrcode-list-name {
  font-weight: 600;
  color: #1a202c;
  flex: 1;
}

.qrcode-list-status {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.qrcode-list-status.active {
  background: #e9f9ef;
  color: #0F9D58;
  border: 1px solid #bbf7d0;
}

.qrcode-list-status.inactive {
  background: #fef2f2;
  color: #DC2626;
  border: 1px solid #fecaca;
}

.qrcode-list-campaign {
  background-color: #e7f5ff;
  color: #1c7ed6;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  display: inline-block;
  font-weight: 600;
}

.qrcode-list-scans {
  font-size: 0.875rem;
  color: #4a5568;
  font-weight: 600;
}

.qrcode-list-location {
  font-size: 0.813rem;
  color: #4a5568;
}

.qrcode-list-date {
  font-size: 0.813rem;
  color: #4a5568;
}

.qrcode-list-actions {
  display: flex;
  gap: 0.5rem;
}

.qrcode-list-action-btn {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  background: white;
  transition: all 0.2s;
}

.qrcode-list-action-btn svg {
  width: 15px;
  height: 15px;
}

.qrcode-list-view-btn { color: #1c7ed6; }
.qrcode-list-view-btn:hover { background-color: #e7f5ff; border-color: #1c7ed6; }

.qrcode-list-download-btn { color: #37b24d; }
.qrcode-list-download-btn:hover { background-color: #ebfbee; border-color: #37b24d; }

.qrcode-list-copy-btn { color: #002060; }
.qrcode-list-copy-btn:hover { background-color: #eef1fa; border-color: #002060; }

.qrcode-list-copied-btn { color: #0F9D58; background: #f0fdf4; border-color: #bbf7d0; }

/* ─── Pagination ─── */
.qrcode-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.qrcode-page-btn {
  padding: 8px 14px;
  border: 1.5px solid #e2e8f0;
  background: white;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #002060;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.qrcode-page-btn:hover:not(:disabled) {
  border-color: #E820DA;
  color: #E820DA;
  background: #fdf2f8;
}

.qrcode-page-btn.active {
  background: #002060;
  color: white;
  border-color: #002060;
}

.qrcode-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qrcode-page-dots {
  color: #94a3b8;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 700;
  user-select: none;
}

/* ─── Modal Styles ─── */
.qrcode-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.qrcode-modal {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.qrcode-modal-large {
  max-width: 860px;
}

.qrcode-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  background: white;
}

.qrcode-modal-header h2 {
  font-size: 1.25rem;
  color: #1a202c;
  margin: 0;
  font-weight: 700;
}

.qrcode-modal-subtitle {
  color: #64748b;
  margin: 4px 0 0 0;
  font-size: 14px;
  font-weight: 500;
}

.qrcode-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f7fafc;
  border-radius: 6px;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #718096;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qrcode-modal-close:hover {
  background: #e2e8f0;
  color: #1a202c;
}

/* ═══════════════════════════════════════════════════════════════
   CRITICAL FIX: Modal Body Scrolls Independently
   ═══════════════════════════════════════════════════════════════ */
.qrcode-modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

/* ─── Form ─── */
.qrcode-form {
  padding: 1rem 1.25rem;
}

.qrcode-form-group {
  margin-bottom: 1rem;
}

.qrcode-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #2d3748;
  font-size: 0.875rem;
}

.qrcode-required {
  color: #DC2626;
}

.qrcode-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.2s;
  background: white;
  color: #333;
  box-sizing: border-box;
}

.qrcode-input:focus {
  outline: none;
  border-color: #E820DA;
  box-shadow: 0 0 0 3px rgba(232, 32, 218, 0.12);
}

.qrcode-input::placeholder {
  color: #94a3b8;
}

.qrcode-hint {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: #718096;
  line-height: 1.5;
}

.qrcode-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ─── Statistics Content ─── */
.qrcode-stats-content {
  padding: 1.25rem;
}

.qrcode-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.qrcode-stat-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.qrcode-stat-box:hover {
  border-color: #cbd5e1;
  background: white;
}

.qrcode-stat-box-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qrcode-stat-box-value {
  font-size: 20px;
  font-weight: 800;
  color: #002060;
  line-height: 1.1;
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
}

.qrcode-stat-box-label {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qrcode-stats-section {
  margin-bottom: 24px;
}

.qrcode-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #002060;
  margin: 0 0 14px 0;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.qrcode-stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qrcode-stats-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}

.qrcode-stats-item:hover {
  background: white;
  border-color: #cbd5e1;
}

.qrcode-stats-item-label {
  flex: 1;
  font-weight: 600;
  color: #002060;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qrcode-stats-item-bar {
  flex: 2;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
}

.qrcode-stats-item-fill {
  height: 100%;
  background: linear-gradient(90deg, #002060 0%, #E820DA 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.qrcode-stats-item-value {
  font-weight: 700;
  color: #002060;
  min-width: 40px;
  text-align: right;
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 13px;
}

.qrcode-recent-scans {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qrcode-recent-scan {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  transition: all 0.15s ease;
}

.qrcode-recent-scan:hover {
  background: white;
  border-color: #cbd5e1;
}

.qrcode-recent-scan-location {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  color: #002060;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qrcode-recent-scan-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
}

.qrcode-recent-scan-time {
  color: #94a3b8;
  font-size: 12px;
  white-space: nowrap;
  font-weight: 500;
}

/* ─── Map Container ─── */
.qrcode-map-container {
  width: 100%;
  height: 320px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  margin-bottom: 24px;
  background: #e2e8f0;
  position: relative;
}

.qrcode-map-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  gap: 10px;
}

/* ─── Toast ─── */
.qrcode-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 14px 20px;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: qrcode-toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 400px;
  line-height: 1.4;
}

@keyframes qrcode-toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.qrcode-toast-success { background: #0F9D58; }
.qrcode-toast-error { background: #DC2626; }
.qrcode-toast-info { background: #3b82f6; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 576px) {
  .qrcode-top-section { flex-wrap: nowrap; }
  .qrcode-controls { flex-wrap: nowrap; }
  .qrcode-search { min-width: 200px; }

  .qrcode-stat-pill { min-width: 100px; padding: 0.75rem; }
  .qrcode-stat-pill-icon { width: 32px; height: 32px; }
  .qrcode-stat-pill-value { font-size: 1.25rem; }
  .qrcode-stat-pill-label { font-size: 0.75rem; }

  .qrcode-pagination {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
  }
}

@media (min-width: 768px) {
  .qrcode-content-wrapper { padding: 1.5rem; }

  .qrcode-grid { grid-template-columns: repeat(2, 1fr); }

  .qrcode-list-header {
    display: flex;
    align-items: center;
  }

  .qrcode-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
  }

  .qrcode-list-name-wrapper { flex: 2; margin-bottom: 0; }
  .qrcode-list-campaign { flex: 1; margin-bottom: 0; }
  .qrcode-list-actions { flex: 1; justify-content: flex-end; }

  .qrcode-stats-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .qrcode-stat-box { padding: 18px; }
  .qrcode-stat-box-value { font-size: 22px; }

  .qrcode-modal-header h2 { font-size: 1.25rem; }
}

@media (min-width: 992px) {
  .qrcode-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1200px) {
  .qrcode-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Mobile-specific adjustments */
@media (max-width: 480px) {
  .qrcode-header-title { font-size: 1.25rem; }

  .qrcode-top-section {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .qrcode-stats-bar {
    width: 100%;
    justify-content: space-between;
  }

  .qrcode-stat-pill {
    flex: 1;
    min-width: 0;
    padding: 0.5rem;
  }

  .qrcode-stat-pill-value { font-size: 0.9rem; }
  .qrcode-stat-pill-label { font-size: 0.6rem; }

  .qrcode-controls {
    width: 100%;
    justify-content: space-between;
  }

  .qrcode-search {
    max-width: none;
    flex: 1;
  }

  .qrcode-search input {
    font-size: 16px; /* Prevents iOS zoom */
  }

  .qrcode-modal {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    margin: 0;
  }

  .qrcode-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .qrcode-modal-header {
    border-radius: 16px 16px 0 0;
  }

  .qrcode-toast {
    left: 1rem;
    right: 1rem;
    top: 1rem;
    max-width: none;
    animation: qrcode-toast-in-mobile 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes qrcode-toast-in-mobile {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  .qrcode-recent-scan {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .qrcode-recent-scan-location,
  .qrcode-recent-scan-info,
  .qrcode-recent-scan-time {
    width: 100%;
    white-space: normal;
  }

  .qrcode-stats-item {
    flex-wrap: wrap;
    gap: 8px;
  }

  .qrcode-stats-item-bar {
    width: 100%;
    order: 3;
    flex: none;
  }

  .qrcode-map-container {
    height: 240px;
  }
}

@media (max-width: 360px) {
  .qrcode-stats-bar {
    flex-direction: column;
    width: 100%;
  }

  .qrcode-stat-pill {
    flex-direction: row;
    text-align: left;
  }

  .qrcode-card-actions {
    flex-direction: column;
  }

  .qrcode-action-btn {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════════ */
@media print {
  .qrcode-header button,
  .qrcode-top-section,
  .qrcode-card-actions,
  .qrcode-list-actions,
  .qrcode-modal-overlay,
  .qrcode-toast {
    display: none !important;
  }

  .qrcode-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}/* WebReview Component - Fully Responsive + Scrollable */

/* ═══════════════════════════════════════════════════
   SCROLL FIX
   If this page is nested inside a dashboard shell with a
   fixed-height container and `overflow: hidden`, the page
   can get visually "trapped" and never scroll. Making the
   wrapper own its scroll behavior fixes that regardless of
   what the parent layout does.
   ═══════════════════════════════════════════════════ */
.webreview-wrapper {
  width: 100%;
  height: 100%;
  /* CRITICAL FIX: min-height:100vh previously forced this wrapper to be at
     LEAST the full browser viewport tall. Inside the dashboard's own
     fixed-height, overflow:hidden shell, that meant the wrapper was always
     bigger than its own visible box — nothing inside the wrapper ever
     "overflowed" the wrapper itself (there was room to spare), so its
     own overflow-y:auto had nothing to scroll. The excess height just got
     silently clipped by the parent shell instead, making the bottom of the
     page unreachable. min-height:0 + flex:1 lets this wrapper size itself
     to whatever space the dashboard actually gives it, so real overflow
     happens *inside* the wrapper and its scrollbar works as intended. */
  min-height: 0;
  flex: 1 1 auto; /* fills a flex-based dashboard shell correctly */
  min-width: 0; /* Prevents overflow issues */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
  overscroll-behavior-y: contain;
  background: linear-gradient(180deg, #f8f9ff 0%, #ffffff 100%);
  box-sizing: border-box;
  position: relative;
}

.webreview-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: clamp(1rem, 3vw, 2.5rem);
  padding-bottom: clamp(2rem, 6vw, 4rem); /* extra breathing room so last card isn't flush with viewport edge */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Header */
.webreview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eef0f7;
  flex-wrap: wrap;
}

.webreview-header-content {
  flex: 1;
  min-width: 0;
}

.webreview-title {
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.5px;
  line-height: 1.2;
  word-break: break-word;
}

.webreview-subtitle {
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: #64748b;
  margin: 0;
  font-weight: 400;
}

.webreview-btn {
  padding: clamp(0.7rem, 2vw, 0.875rem) clamp(1.1rem, 2.5vw, 1.75rem);
  border: none;
  border-radius: 10px;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  flex-shrink: 0;
}

.webreview-btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
}

.webreview-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.5);
}

.webreview-btn-secondary {
  background: white;
  color: #475569;
  border: 2px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.webreview-btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.webreview-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.webreview-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.webreview-icon-small {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Stats Cards */
.webreview-stats {
  display: grid;
  /* Fixed 4-column row (was auto-fit with a 190px minimum, which wrapped to
     2-3 columns as soon as the dashboard sidebar narrowed the available
     width below ~800px). Columns now shrink together instead of wrapping,
     so all four stay on one line at any desktop/tablet width; the mobile
     media queries below still collapse this to 2 columns on small phones. */
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.6rem, 1.5vw, 1.5rem);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.webreview-stat-card {
  position: relative;
  background: white;
  padding: clamp(1rem, 2vw, 1.5rem) clamp(0.85rem, 1.8vw, 1.5rem);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px -8px rgba(15, 23, 42, 0.08);
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #eef0f7;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: clamp(0.65rem, 1.5vw, 1rem);
}

.webreview-stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--stat-accent, #6366f1);
}

.webreview-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.06), 0 16px 28px -10px rgba(15, 23, 42, 0.14);
  border-color: #e4e7f5;
}

.webreview-stat-primary { --stat-accent: #6366f1; }
.webreview-stat-success { --stat-accent: #10b981; }
.webreview-stat-warning { --stat-accent: #f59e0b; }
.webreview-stat-info { --stat-accent: #3b82f6; }

/* Fallback tints for browsers without color-mix() support */
.webreview-stat-primary .webreview-stat-icon { background: #eef0ff; }
.webreview-stat-success .webreview-stat-icon { background: #e7fbf3; }
.webreview-stat-warning .webreview-stat-icon { background: #fff5e6; }
.webreview-stat-info .webreview-stat-icon { background: #eaf3ff; }

.webreview-stat-icon {
  flex-shrink: 0;
  width: clamp(36px, 6vw, 44px);
  height: clamp(36px, 6vw, 44px);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--stat-accent, #6366f1) 12%, white);
  color: var(--stat-accent, #6366f1);
}

.webreview-stat-icon svg {
  width: clamp(18px, 3.5vw, 22px);
  height: clamp(18px, 3.5vw, 22px);
}

.webreview-stat-body {
  min-width: 0;
}

.webreview-stat-value {
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.webreview-stat-label {
  font-size: clamp(0.62rem, 1.3vw, 0.78rem);
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Filters */
.webreview-filters {
  display: flex;
  gap: clamp(0.75rem, 2vw, 1rem);
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
  padding: clamp(1rem, 2vw, 1.5rem);
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  flex-wrap: wrap;
}

.webreview-search-box {
  flex: 1;
  min-width: min(100%, 220px);
  position: relative;
}

.webreview-search-icon {
  position: absolute;
  left: clamp(0.75rem, 2vw, 1rem);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #94a3b8;
  flex-shrink: 0;
  pointer-events: none;
}

.webreview-search-input {
  width: 100%;
  padding: clamp(0.7rem, 2vw, 0.875rem) clamp(1rem, 2vw, 1rem) clamp(0.7rem, 2vw, 0.875rem) clamp(2.5rem, 4vw, 3rem);
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  transition: all 0.3s ease;
  background: #f8fafc;
  box-sizing: border-box;
}

.webreview-search-input:focus {
  outline: none;
  border-color: #6366f1;
  background: white;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.webreview-filter-select {
  min-width: clamp(140px, 25vw, 180px);
  flex-shrink: 0;
}

.webreview-select {
  width: 100%;
  padding: clamp(0.7rem, 2vw, 0.875rem) clamp(1rem, 2vw, 1rem);
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.webreview-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Error Message */
.webreview-error {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
  padding: clamp(0.875rem, 2vw, 1rem) clamp(1rem, 2vw, 1.25rem);
  border-radius: 10px;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  border-left: 4px solid #dc2626;
  font-weight: 500;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  flex-wrap: wrap;
}

.webreview-error-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.webreview-error-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #dc2626;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.webreview-error-dismiss:hover {
  background: rgba(220, 38, 38, 0.1);
}

/* Loading State */
.webreview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: clamp(3rem, 8vw, 5rem) clamp(1rem, 3vw, 2rem);
  font-size: clamp(0.95rem, 2.5vw, 1.125rem);
  color: #64748b;
  font-weight: 500;
}

.webreview-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: webreview-spin 1s linear infinite;
}

@keyframes webreview-spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.webreview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 3vw, 2rem);
  text-align: center;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.webreview-empty-icon {
  width: clamp(48px, 10vw, 64px);
  height: clamp(48px, 10vw, 64px);
  color: #cbd5e1;
}

.webreview-empty h3 {
  margin: 0;
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  color: #1e293b;
}

.webreview-empty p {
  margin: 0;
  color: #64748b;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
}

/* Review Grid */
.webreview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.webreview-card {
  background: white;
  border-radius: 16px;
  padding: clamp(1.1rem, 3vw, 1.75rem);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.webreview-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  border-color: #e0e7ff;
  transform: translateY(-2px);
}

.webreview-card-header {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1rem);
  margin-bottom: clamp(1rem, 2vw, 1.25rem);
  min-width: 0;
}

.webreview-avatar {
  width: clamp(44px, 8vw, 56px);
  height: clamp(44px, 8vw, 56px);
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: clamp(0.95rem, 2.5vw, 1.25rem);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.webreview-card-info {
  flex: 1;
  min-width: 0;
}

.webreview-card-name {
  margin: 0 0 0.375rem 0;
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: #1e293b;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webreview-role-badge {
  display: inline-block;
  padding: clamp(0.2rem, 1vw, 0.25rem) clamp(0.5rem, 1.5vw, 0.75rem);
  background: #f1f5f9;
  color: #64748b;
  border-radius: 20px;
  font-size: clamp(0.68rem, 1.5vw, 0.8rem);
  font-weight: 500;
  text-transform: capitalize;
}

.webreview-card-rating {
  margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
}

.webreview-stars-input {
  display: flex;
  gap: clamp(0.2rem, 1vw, 0.375rem);
  flex-wrap: wrap;
}

.webreview-star-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.webreview-star-btn:hover:not(:disabled) {
  transform: scale(1.15);
}

.webreview-star-icon {
  width: clamp(18px, 4vw, 24px);
  height: clamp(18px, 4vw, 24px);
}

.webreview-star-active {
  color: #fbbf24;
}

.webreview-star-inactive {
  color: #e2e8f0;
}

.webreview-card-text {
  color: #475569;
  line-height: 1.7;
  margin: 0 0 clamp(1rem, 2vw, 1.25rem) 0;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  padding: clamp(0.5rem, 1.5vw, 0.75rem);
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid #6366f1;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  flex: 1;
}

.webreview-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: clamp(1rem, 2vw, 1.25rem);
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
  margin-top: auto;
}

.webreview-card-badges {
  display: flex;
  gap: clamp(0.4rem, 1vw, 0.625rem);
  align-items: center;
  flex-wrap: wrap;
}

.webreview-badge {
  padding: clamp(0.25rem, 1vw, 0.375rem) clamp(0.55rem, 1.5vw, 0.875rem);
  border-radius: 20px;
  font-size: clamp(0.6rem, 1.5vw, 0.75rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: clamp(0.25rem, 0.5vw, 0.375rem);
  white-space: nowrap;
}

.webreview-badge-pending {
  background: #fef3c7;
  color: #d97706;
}

.webreview-badge-approved {
  background: #d1fae5;
  color: #059669;
}

.webreview-badge-rejected {
  background: #fee2e2;
  color: #dc2626;
}

.webreview-badge-featured {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
}

.webreview-badge-icon {
  width: clamp(11px, 2.5vw, 14px);
  height: clamp(11px, 2.5vw, 14px);
}

.webreview-card-actions {
  display: flex;
  gap: clamp(0.35rem, 1vw, 0.5rem);
  flex-shrink: 0;
}

.webreview-btn-icon {
  width: clamp(30px, 6vw, 36px);
  height: clamp(30px, 6vw, 36px);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  background: #f1f5f9;
  flex-shrink: 0;
}

.webreview-btn-icon svg {
  width: clamp(15px, 3.5vw, 18px);
  height: clamp(15px, 3.5vw, 18px);
}

.webreview-btn-approve {
  background: #d1fae5;
  color: #059669;
}

.webreview-btn-approve:hover {
  background: #10b981;
  color: white;
  transform: scale(1.1);
}

.webreview-btn-edit {
  background: #dbeafe;
  color: #3b82f6;
}

.webreview-btn-edit:hover {
  background: #3b82f6;
  color: white;
  transform: scale(1.1);
}

.webreview-btn-delete {
  background: #fee2e2;
  color: #dc2626;
}

.webreview-btn-delete:hover {
  background: #dc2626;
  color: white;
  transform: scale(1.1);
}

/* Pagination */
.webreview-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.75rem, 2.5vw, 1.25rem);
  padding: clamp(1.25rem, 2.5vw, 1.5rem);
  flex-wrap: wrap;
}

.webreview-page-info {
  font-weight: 600;
  color: #475569;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  white-space: nowrap;
}

/* Modal */
.webreview-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: clamp(0.75rem, 3vw, 2rem);
  backdrop-filter: blur(4px);
  animation: webreview-fadeIn 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes webreview-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.webreview-modal {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 750px;
  max-height: none;
  margin: clamp(0.5rem, 4vh, 3rem) auto;
  overflow-y: visible;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: webreview-modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes webreview-modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.webreview-modal-header {
  padding: clamp(1.25rem, 3vw, 2rem);
  border-bottom: 2px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  border-radius: 20px 20px 0 0;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1;
}

.webreview-modal-title {
  margin: 0 0 0.5rem 0;
  color: #1e293b;
  font-size: clamp(1.15rem, 3vw, 1.75rem);
  font-weight: 700;
  word-break: break-word;
}

.webreview-modal-subtitle {
  margin: 0;
  color: #64748b;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
}

.webreview-close {
  background: #f1f5f9;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: #64748b;
  flex-shrink: 0;
}

.webreview-close svg {
  width: 20px;
  height: 20px;
}

.webreview-close:hover {
  background: #e2e8f0;
  color: #1e293b;
  transform: rotate(90deg);
}

.webreview-form {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.webreview-form-section {
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(1.25rem, 3vw, 2rem);
  border-bottom: 1px solid #e2e8f0;
}

.webreview-form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.webreview-form-section-title {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 clamp(1rem, 2vw, 1.5rem) 0;
  padding-left: 1rem;
  border-left: 4px solid #6366f1;
}

.webreview-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

.webreview-form-group {
  margin-bottom: clamp(1.1rem, 2.5vw, 1.5rem);
  min-width: 0;
}

.webreview-label {
  display: block;
  margin-bottom: clamp(0.5rem, 1vw, 0.625rem);
  font-weight: 600;
  color: #334155;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.webreview-required {
  color: #ef4444;
}

.webreview-input,
.webreview-textarea {
  width: 100%;
  padding: clamp(0.7rem, 2vw, 0.875rem) clamp(0.9rem, 2vw, 1rem);
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  transition: all 0.3s ease;
  background: #f8fafc;
  font-family: inherit;
  box-sizing: border-box;
}

.webreview-input:focus,
.webreview-textarea:focus {
  outline: none;
  border-color: #6366f1;
  background: white;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.webreview-textarea {
  resize: vertical;
  min-height: 100px;
}

.webreview-hint {
  display: block;
  margin-top: clamp(0.375rem, 1vw, 0.5rem);
  font-size: clamp(0.72rem, 1.5vw, 0.85rem);
  color: #94a3b8;
  font-style: italic;
}

/* Role Selector */
.webreview-role-selector {
  display: flex;
  flex-direction: column;
  gap: clamp(0.6rem, 1.5vw, 0.75rem);
}

.webreview-role-option {
  display: flex;
  align-items: center;
  padding: clamp(0.7rem, 2vw, 1rem);
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f8fafc;
}

.webreview-role-option:hover {
  border-color: #cbd5e1;
  background: white;
}

.webreview-role-selected {
  border-color: #6366f1;
  background: linear-gradient(135deg, #f0f2ff 0%, #eef2ff 100%);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.webreview-role-input {
  margin-right: clamp(0.6rem, 1.5vw, 0.75rem);
  width: 18px;
  height: 18px;
  accent-color: #6366f1;
  flex-shrink: 0;
}

.webreview-role-label {
  font-weight: 500;
  color: #334155;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
}

/* Rating Container */
.webreview-rating-container {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1rem);
  padding: clamp(0.75rem, 2vw, 1rem);
  background: #f8fafc;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  flex-wrap: wrap;
}

.webreview-rating-text {
  font-weight: 600;
  color: #6366f1;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
}

/* Checkbox */
.webreview-checkbox {
  display: flex;
  align-items: flex-start;
  gap: clamp(0.7rem, 1.5vw, 0.875rem);
  padding: clamp(1rem, 2vw, 1.25rem);
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f8fafc;
}

.webreview-checkbox:hover {
  border-color: #cbd5e1;
  background: white;
}

.webreview-checkbox-input {
  margin-top: clamp(0.125rem, 0.5vw, 0.1875rem);
  width: 20px;
  height: 20px;
  accent-color: #6366f1;
  cursor: pointer;
  flex-shrink: 0;
}

.webreview-checkbox-text {
  display: flex;
  flex-direction: column;
  gap: clamp(0.1875rem, 0.5vw, 0.25rem);
  flex: 1;
  min-width: 0;
}

.webreview-checkbox-hint {
  font-size: clamp(0.72rem, 1.5vw, 0.85rem);
  color: #64748b;
  font-weight: 400;
}

.webreview-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: clamp(0.75rem, 2vw, 1rem);
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-top: clamp(1.25rem, 3vw, 2rem);
  border-top: 2px solid #f1f5f9;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════ */

/* Large tablets / small laptops */
@media (max-width: 1024px) {
  .webreview-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  }
}

/* Tablets */
@media (max-width: 768px) {
  .webreview-header {
    flex-direction: column;
    align-items: stretch;
  }

  .webreview-header-content {
    width: 100%;
  }

  .webreview-btn {
    width: 100%;
  }

  .webreview-filters {
    flex-direction: column;
  }

  .webreview-search-box {
    min-width: 100%;
  }

  .webreview-filter-select {
    min-width: 100%;
  }

  .webreview-grid {
    grid-template-columns: 1fr;
  }

  .webreview-form-row {
    grid-template-columns: 1fr;
  }

  .webreview-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .webreview-card-badges {
    justify-content: flex-start;
  }

  .webreview-card-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .webreview-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .webreview-stat-card {
    padding: 0.85rem;
  }

  .webreview-modal-overlay {
    align-items: flex-start;
    padding: 0;
  }

  .webreview-modal {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .webreview-modal-header {
    border-radius: 0;
  }
}

/* Small phones / narrow screens */
@media (max-width: 480px) {
  .webreview-container {
    padding: 0.875rem;
    padding-bottom: 2.5rem;
  }

  .webreview-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
  }

  .webreview-stat-card {
    padding: 0.875rem 0.5rem;
  }

  .webreview-modal-title {
    font-size: 1.15rem;
  }

  .webreview-pagination {
    flex-direction: column;
  }

  .webreview-page-info {
    order: -1;
  }

  .webreview-card-header {
    flex-wrap: wrap;
  }

  .webreview-role-selector {
    gap: 0.5rem;
  }

  .webreview-form-actions {
    flex-direction: column-reverse;
  }

  .webreview-form-actions .webreview-btn {
    width: 100%;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .webreview-stats {
    grid-template-columns: 1fr 1fr;
  }

  .webreview-stat-value {
    font-size: 1.4rem;
  }

  .webreview-title {
    font-size: 1.25rem;
  }

  .webreview-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.85rem;
  }
}

/* Landscape phones — short viewport height needs the modal to scroll internally */
@media (max-height: 500px) and (orientation: landscape) {
  .webreview-modal-overlay {
    align-items: flex-start;
  }

  .webreview-modal {
    margin: 0.5rem auto;
  }
}

/* Scrollbar Styling */
.webreview-modal::-webkit-scrollbar,
.webreview-container::-webkit-scrollbar,
.webreview-wrapper::-webkit-scrollbar {
  width: 10px;
}

.webreview-modal::-webkit-scrollbar-track,
.webreview-container::-webkit-scrollbar-track,
.webreview-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 8px;
}

.webreview-modal::-webkit-scrollbar-thumb,
.webreview-container::-webkit-scrollbar-thumb,
.webreview-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 8px;
}

.webreview-modal::-webkit-scrollbar-thumb:hover,
.webreview-container::-webkit-scrollbar-thumb:hover,
.webreview-wrapper::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #4f46e5 0%, #7c3aed 100%);
}.map_clients-map-container {
    display: flex;
    width: 100%;
    height: 80vh;
}

.map_clients-map-sidebar {
    width: 250px;
    border-right: 1px solid #ddd;
    padding: 10px;
    overflow-y: auto;
    background: #f8f9fa;
}

.map_clients-list {
    margin-top: 10px;
}

.map_client-item {
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    transition: background 0.2s;
}

.map_client-item:hover {
    background: #b3c4ce;
}

.map_client-item.selected {
    background: #667eea;
    color: white;
}

.map_clients-map-content {
    flex: 1;
}

.map_client-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map_call-count {
    background: #2e7d32c0;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 20px;
}

.map_tootip {
    font-size: 14px;
    padding: 8px 14px;
}/* Base Container Styles */
.acp-container,
.crp-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
}

/* Card Styles */
.acp-card,
.crp-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

/* Header Styles */
.acp-header,
.crp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
}

.acp-header-title,
.crp-header-title {
    flex: 1;
}

.acp-title,
.crp-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Back Button Styles */
.acp-back-btn,
.crp-back-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.acp-back-btn:hover,
.crp-back-btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

/* Form Group Styles */
.acp-form-group,
.crp-form-group {
    margin-bottom: 20px;
    box-sizing: border-box;
}

.acp-label,
.crp-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.acp-input,
.acp-select,
.acp-textarea,
.crp-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: var(--transition);
    box-sizing: border-box;
}

.acp-input:focus,
.acp-select:focus,
.acp-textarea:focus,
.crp-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Form Row Styles */
.acp-form-row,
.crp-form-row {
    display: flex;
    gap: 20px;
    box-sizing: border-box;
}

.acp-form-row .acp-form-group,
.crp-form-row .crp-form-group {
    flex: 1;
    box-sizing: border-box;
}

/* Actions Button Styles */
.acp-actions,
.crp-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    box-sizing: border-box;
}

.acp-btn,
.crp-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-sizing: border-box;
}

.acp-btn-primary,
.crp-btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.acp-btn-primary:hover,
.crp-btn-primary:hover {
    background-color: var(--primary-hover);
}

.acp-btn-secondary,
.crp-btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-muted);
}

.acp-btn-secondary:hover,
.crp-btn-secondary:hover {
    background-color: var(--secondary-hover);
}

/* Loading Animation */
.acp-loading,
.crp-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Notification Styles */
.acp-notification,
.crp-notification {
    position: fixed;
    top: 50px;
    right: 30px;
    padding: 15px 20px;
    border-radius: 6px;
    background: rgb(200, 214, 6) !important;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
    box-sizing: border-box;
}

.acp-notification.show,
.crp-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.acp-notification.success,
.crp-notification.success {
    background-color: var(--success-color);
}

.acp-notification.error,
.crp-notification.error {
    background-color: var(--error-color);
}

.acp-notification.warning,
.crp-notification.warning {
    background-color: var(--warning-color);
}

/* Add Call Page Specific Styles */
.acp-client-search {
    position: relative;
}

.acp-selected-client {
    margin-top: 10px;
    padding: 10px;
    background-color: var(--background-light);
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
    box-sizing: border-box;
}

.acp-client-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.acp-client-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    box-sizing: border-box;
}

.acp-client-option:hover {
    background-color: #f5f9ff;
}

/* Clone Rota Page Specific Styles */
.crp-info-box {
    background-color: var(--background-light);
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 6px 6px 0;
    box-sizing: border-box;
}

.crp-info-box p {
    margin: 0 0 10px 0;
    color: var(--text-secondary);
}

.crp-info-box p:last-child {
    margin-bottom: 0;
}

.crp-date-display {
    display: flex;
    align-items: center;
    margin-top: 10px;
    padding: 10px;
    background-color: var(--background-light);
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
    box-sizing: border-box;
}

.crp-date-display strong {
    margin-right: 10px;
    color: var(--text-secondary);
}

/* Modal Styles */
.acp-modal-overlay,
.crp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-sizing: border-box;
}

.acp-modal,
.crp-modal {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.acp-modal-header,
.crp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.acp-modal-title,
.crp-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.acp-modal-close,
.crp-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.acp-modal-close:hover,
.crp-modal-close:hover {
    color: var(--text-primary);
}

.acp-modal-body,
.crp-modal-body {
    margin-bottom: 20px;
    box-sizing: border-box;
}

.acp-modal-footer,
.crp-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    box-sizing: border-box;
}

.acp-disabled,
.crp-disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Styles - Tablet */
@media (max-width: 992px) {

    .acp-container,
    .crp-container {
        padding: 15px;
    }

    .acp-card,
    .crp-card {
        padding: 20px;
    }

    .acp-title,
    .crp-title {
        font-size: 22px;
    }

    .acp-form-row,
    .crp-form-row {
        gap: 15px;
    }
}

/* Responsive Styles - Mobile Landscape */
@media (max-width: 768px) {

    .acp-container,
    .crp-container {
        padding: 10px;
    }

    .acp-card,
    .crp-card {
        padding: 15px;
    }

    .acp-header,
    .crp-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .acp-back-btn,
    .crp-back-btn {
        margin-top: 10px;
        align-self: flex-end;
    }

    .acp-form-row,
    .crp-form-row {
        flex-direction: column;
        gap: 0;
    }

    .acp-actions,
    .crp-actions {
        flex-direction: column;
        gap: 10px;
    }

    .acp-btn,
    .crp-btn {
        width: 100%;
        padding: 12px 15px;
    }

    .acp-notification,
    .crp-notification {
        max-width: 90%;
        right: 5%;
        left: 5%;
    }

    .acp-modal,
    .crp-modal {
        width: 95%;
        padding: 20px;
    }
}

/* Responsive Styles - Mobile Portrait */
@media (max-width: 576px) {

    .acp-container,
    .crp-container {
        padding: 5px;
    }

    .acp-card,
    .crp-card {
        padding: 10px;
        border-radius: 6px;
    }

    .acp-title,
    .crp-title {
        font-size: 20px;
    }

    .acp-header,
    .crp-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .acp-form-group,
    .crp-form-group {
        margin-bottom: 15px;
    }

    .acp-label,
    .crp-label {
        margin-bottom: 5px;
        font-size: 14px;
    }

    .acp-input,
    .acp-select,
    .acp-textarea,
    .crp-input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .acp-actions,
    .crp-actions {
        margin-top: 20px;
    }

    .acp-btn,
    .crp-btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    .acp-back-btn,
    .crp-back-btn {
        padding: 6px 10px;
        font-size: 14px;
    }

    .acp-modal,
    .crp-modal {
        padding: 15px;
    }

    .acp-modal-title,
    .crp-modal-title {
        font-size: 18px;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {

    .acp-title,
    .crp-title {
        font-size: 18px;
    }

    .acp-header,
    .crp-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .acp-form-group,
    .crp-form-group {
        margin-bottom: 12px;
    }

    .acp-actions,
    .crp-actions {
        margin-top: 15px;
    }

    .acp-btn,
    .crp-btn {
        padding: 8px 12px;
    }
}

/* Print Styles */
@media print {

    .acp-container,
    .crp-container {
        max-width: 100%;
        padding: 0;
    }

    .acp-card,
    .crp-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .acp-back-btn,
    .crp-back-btn,
    .acp-actions,
    .crp-actions,
    .acp-notification,
    .crp-notification {
        display: none;
    }
}/* ==========================================================================
   Care Notes & Communications — dashboard redesign
   ========================================================================== */

:root {
  --notes-green-900: #002060;
  --notes-green-700: #002060;
  --notes-green-600: #002060;
  --notes-green-100: #e6f4ee;
  --notes-ink: #1c2726;
  --notes-ink-soft: #5a6b68;
  --notes-border: #e2e8e5;
  --notes-bg: #f4f7f6;
  --notes-card-bg: #ffffff;
  --notes-urgent: #d64545;
  --notes-urgent-bg: #fde8e8;
  --notes-attention: #b8860b;
  --notes-attention-bg: #fdf3d9;
  --notes-routine: #002060;
  --notes-routine-bg: #e6f4ee;
  --notes-radius-lg: 16px;
  --notes-radius-md: 10px;
  --notes-radius-sm: 7px;
  --notes-shadow: 0 2px 10px rgba(11, 61, 46, 0.06);
}

.notes-container {
  width: 100%;
  margin: 0;
  padding: 0 0 32px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--notes-ink);
  background: var(--notes-bg);
  display: flex;
  flex-direction: column;
  position: relative;

  /* This component may be dropped into a parent layout that has a fixed
     height (e.g. a dashboard shell with its own header/sidebar). Without
     an explicit height + overflow here, content below the fold has no
     scroll container and simply gets clipped. Making the component own
     its scrolling fixes that regardless of the parent's CSS. */
  height: 100%;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------------------- */
/* Hero header                                                            */
/* ---------------------------------------------------------------------- */

.notes-hero {
  background: linear-gradient(135deg, var(--notes-green-900) 0%, var(--notes-green-700) 100%);
  color: #ffffff;
  padding: 16px 16px 14px;
  border-radius: 0 0 20px 20px;
}

.notes-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.notes-hero-title {
  margin: 0 0 10px;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
}

.notes-hero-subtitle {
  margin: 0 0 22px;
  max-width: 640px;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
}

.notes-stats-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.notes-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--notes-radius-md);
  padding: 14px 20px;
  min-width: 180px;
  flex: 1 1 180px;
}

.notes-stat-icon {
  font-size: 20px;
  opacity: 0.9;
}

.notes-stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.notes-stat-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

/* ---------------------------------------------------------------------- */
/* Filter panel                                                           */
/* ---------------------------------------------------------------------- */

.notes-filter-panel {
  background: var(--notes-card-bg);
  border: 1px solid var(--notes-border);
  border-radius: var(--notes-radius-lg);
  box-shadow: var(--notes-shadow);
  margin: -20px 32px 20px;
  padding: 18px 20px 16px;
  position: relative;
  z-index: 2;
}

.notes-period-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.notes-period-tabs {
  display: inline-flex;
  background: var(--notes-bg);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  flex-wrap: wrap;
}

.notes-period-tab {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--notes-ink-soft);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.notes-period-tab:hover {
  color: var(--notes-ink);
}

.notes-period-tab.active {
  background: var(--notes-card-bg);
  color: var(--notes-green-700);
  box-shadow: 0 1px 4px rgba(11, 61, 46, 0.15);
}

.notes-groupby-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notes-groupby-label {
  font-size: 13px;
  color: var(--notes-ink-soft);
  font-weight: 500;
}

.notes-groupby-buttons {
  display: inline-flex;
  border: 1px solid var(--notes-border);
  border-radius: 999px;
  overflow: hidden;
}

.notes-groupby-btn {
  border: none;
  background: var(--notes-card-bg);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--notes-ink-soft);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.notes-groupby-btn + .notes-groupby-btn {
  border-left: 1px solid var(--notes-border);
}

.notes-groupby-btn.active {
  background: var(--notes-green-700);
  color: #ffffff;
}

.notes-custom-range-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--notes-bg);
  border-radius: var(--notes-radius-md);
}

.notes-custom-hint {
  font-size: 12px;
  color: var(--notes-ink-soft);
  padding-bottom: 8px;
}

.notes-filters-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.notes-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.notes-filter-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--notes-ink-soft);
}

.notes-filter-input {
  padding: 9px 12px;
  border: 1px solid var(--notes-border);
  border-radius: var(--notes-radius-sm);
  font-size: 14px;
  color: var(--notes-ink);
  background: var(--notes-card-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.notes-filter-input:focus {
  outline: none;
  border-color: var(--notes-green-600);
  box-shadow: 0 0 0 3px rgba(18, 138, 99, 0.15);
}

.notes-search-wrap {
  position: relative;
}

.notes-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.6;
  pointer-events: none;
}

.notes-search-input {
  padding-left: 34px;
}

.notes-results-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--notes-border);
}

.notes-results-count {
  font-size: 13px;
  color: var(--notes-ink-soft);
  font-weight: 500;
}

.notes-action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notes-export-btn {
  padding: 8px 14px;
  border: 1px solid var(--notes-border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  background: var(--notes-card-bg);
  color: var(--notes-ink);
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.notes-export-btn:hover {
  background: var(--notes-bg);
}

.notes-create-btn {
  background: var(--notes-green-700);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.notes-create-btn:hover {
  background: var(--notes-green-600);
  transform: translateY(-1px);
}

/* ---------------------------------------------------------------------- */
/* Grouped list                                                           */
/* ---------------------------------------------------------------------- */

.notes-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 32px;
}

.notes-empty-state {
  margin: 20px 32px;
  padding: 48px 20px;
  text-align: center;
  color: var(--notes-ink-soft);
  background: var(--notes-card-bg);
  border: 1px dashed var(--notes-border);
  border-radius: var(--notes-radius-lg);
  font-size: 14px;
}

/* ---------------------------------------------------------------------- */
/* Pagination bar (now counts individual notes, with a page-size picker)  */
/* ---------------------------------------------------------------------- */

.notes-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 32px 0;
  padding: 14px 18px;
  background: var(--notes-card-bg);
  border: 1px solid var(--notes-border);
  border-radius: var(--notes-radius-lg);
  box-shadow: var(--notes-shadow);
  margin-bottom: 20px;
}

.notes-pagination-top {
  margin: 0 32px 20px;
}

.notes-pagination-bottom {
  margin: 18px 32px 20px;
}

.notes-pagination-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.notes-page-size-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--notes-ink-soft);
  font-weight: 500;
}

.notes-page-size-select {
  padding: 5px 8px;
  border: 1px solid var(--notes-border);
  border-radius: var(--notes-radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--notes-ink);
  background: var(--notes-card-bg);
  cursor: pointer;
}

.notes-page-size-select:focus {
  outline: none;
  border-color: var(--notes-green-600);
  box-shadow: 0 0 0 3px rgba(18, 138, 99, 0.15);
}

.notes-pagination-info {
  font-size: 13px;
  color: var(--notes-ink-soft);
  font-weight: 500;
}

.notes-pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.notes-pagination-ellipsis {
  padding: 0 4px;
  color: var(--notes-ink-soft);
  font-weight: 600;
}

.notes-pagination-nav,
.notes-pagination-number {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  border: 1px solid var(--notes-border);
  background: var(--notes-card-bg);
  color: var(--notes-ink);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-width: 36px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.notes-pagination-nav:hover:not(:disabled),
.notes-pagination-number:hover:not(.active) {
  background: var(--notes-bg);
  border-color: var(--notes-green-600);
  color: var(--notes-green-700);
}

.notes-pagination-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.notes-pagination-number.active {
  background: var(--notes-green-700);
  border-color: var(--notes-green-700);
  color: #fff;
}

.notes-group-card {
  background: var(--notes-card-bg);
  border: 1px solid var(--notes-border);
  border-radius: var(--notes-radius-lg);
  box-shadow: var(--notes-shadow);
  overflow: hidden;
}

.notes-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}

.notes-group-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--notes-green-700);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.notes-group-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.notes-group-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--notes-ink);
}

.notes-group-meta {
  font-size: 13px;
  color: var(--notes-ink-soft);
}

.notes-group-urgent-badge {
  flex-shrink: 0;
  background: var(--notes-urgent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
}

.notes-group-chevron {
  flex-shrink: 0;
  font-size: 16px;
  color: var(--notes-ink-soft);
  transition: transform 0.15s ease;
}

.notes-group-chevron.collapsed {
  transform: rotate(-90deg);
}

.notes-group-body {
  border-top: 1px solid var(--notes-border);
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------------- */
/* Individual note card                                                   */
/* ---------------------------------------------------------------------- */

.notes-card {
  padding: 18px 20px;
}

.notes-card + .notes-card {
  border-top: 1px solid var(--notes-border);
}

.notes-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.notes-card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notes-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.notes-badge-urgent {
  background: var(--notes-urgent-bg);
  color: var(--notes-urgent);
}

.notes-badge-attention {
  background: var(--notes-attention-bg);
  color: var(--notes-attention);
}

.notes-badge-routine {
  background: var(--notes-routine-bg);
  color: var(--notes-routine);
}

.notes-badge-tag {
  background: var(--notes-bg);
  color: var(--notes-ink-soft);
  border: 1px solid var(--notes-border);
}

.notes-card-id {
  font-size: 12px;
  color: var(--notes-ink-soft);
  font-weight: 500;
}

.notes-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.notes-card-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--notes-ink);
}

.notes-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--notes-ink-soft);
  margin-bottom: 10px;
}

.notes-card-content {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--notes-ink);
  white-space: pre-line;
}

.notes-read-more-link {
  margin-top: 8px;
  border: none;
  background: none;
  color: var(--notes-green-700);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.notes-read-more-link:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------- */
/* Action icon buttons (edit / delete)                                    */
/* ---------------------------------------------------------------------- */

.notes-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--notes-border);
  background: var(--notes-bg);
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

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

.notes-action-btn.notes-edit:hover {
  background: var(--notes-routine-bg);
}

.notes-action-btn.notes-delete:hover {
  background: var(--notes-urgent-bg);
}

/* ---------------------------------------------------------------------- */
/* Create / edit form                                                     */
/* ---------------------------------------------------------------------- */

.notes-form-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--notes-border);
  background: var(--notes-card-bg);
}

.notes-form-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--notes-green-700);
  margin: 0;
}

.notes-back-btn {
  background: var(--notes-bg);
  color: var(--notes-ink);
  border: 1px solid var(--notes-border);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.notes-back-btn:hover {
  background: #eef2f0;
}

.notes-form-container {
  background: var(--notes-card-bg);
  margin: 20px 32px;
  padding: 24px;
  border-radius: var(--notes-radius-lg);
  border: 1px solid var(--notes-border);
  box-shadow: var(--notes-shadow);
}

.notes-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.notes-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

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

.notes-form-group label {
  font-weight: 600;
  color: var(--notes-ink);
  font-size: 13px;
}

.notes-input {
  padding: 10px 12px;
  border: 1px solid var(--notes-border);
  border-radius: var(--notes-radius-sm);
  font-size: 14px;
  transition: border-color 0.15s ease;
  background: #fff;
}

.notes-input:focus {
  outline: none;
  border-color: var(--notes-green-600);
  box-shadow: 0 0 0 3px rgba(18, 138, 99, 0.15);
}

.notes-textarea {
  padding: 12px;
  border: 1px solid var(--notes-border);
  border-radius: var(--notes-radius-sm);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 160px;
  transition: border-color 0.15s ease;
}

.notes-textarea:focus {
  outline: none;
  border-color: var(--notes-green-600);
  box-shadow: 0 0 0 3px rgba(18, 138, 99, 0.15);
}

.notes-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.notes-update-btn {
  background: var(--notes-green-700);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.15s ease;
}

.notes-update-btn:hover {
  background: var(--notes-green-600);
}

.notes-update-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.notes-cancel-btn {
  background: #fff;
  color: var(--notes-urgent);
  border: 1px solid var(--notes-urgent);
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.15s ease;
}

.notes-cancel-btn:hover {
  background: var(--notes-urgent-bg);
}

.notes-required {
  color: var(--notes-urgent);
  font-weight: bold;
}

.notes-client-dropdown {
  max-height: 200px;
  overflow-y: auto;
}

/* ---------------------------------------------------------------------- */
/* Toast                                                                  */
/* ---------------------------------------------------------------------- */

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  border-radius: 10px;
  color: white;
  font-weight: 500;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: notesSlideIn 0.3s ease-out;
}

.toast-success {
  background: #1c9a5b;
}

.toast-error {
  background: var(--notes-urgent);
}

.toast-warning {
  background: #e0a800;
  color: #000;
}

.toast-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

@keyframes notesSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ---------------------------------------------------------------------- */
/* Delete confirmation modal                                              */
/* ---------------------------------------------------------------------- */

.delete-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 61, 46, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.delete-modal {
  background: white;
  border-radius: var(--notes-radius-lg);
  padding: 0;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.delete-modal-header {
  padding: 20px 24px 0;
}

.delete-modal-header h3 {
  margin: 0 0 16px 0;
  color: var(--notes-urgent);
  font-size: 18px;
  font-weight: 700;
}

.delete-modal-body {
  padding: 0 24px 20px;
}

.delete-modal-body p {
  margin: 0 0 12px 0;
  color: #333;
  line-height: 1.5;
}

.delete-warning {
  color: var(--notes-urgent) !important;
  font-weight: 500;
  font-size: 14px;
}

.delete-modal-actions {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.delete-cancel-btn {
  padding: 9px 18px;
  border: 1px solid var(--notes-border);
  background: white;
  color: #333;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.delete-cancel-btn:hover {
  background: var(--notes-bg);
}

.delete-confirm-btn {
  padding: 9px 18px;
  border: none;
  background: var(--notes-urgent);
  color: white;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.delete-confirm-btn:hover {
  background: #b93a3a;
}

/* ---------------------------------------------------------------------- */
/* Loading spinner                                                        */
/* ---------------------------------------------------------------------- */

.loading-spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  color: var(--notes-ink-soft);
}

.policy-spinner {
  border: 4px solid rgba(15, 111, 82, 0.15);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: var(--notes-green-700);
  animation: notesSpin 1s ease infinite;
  margin-bottom: 12px;
}

.loading-spinner-small {
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.4);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border-left-color: #ffffff;
  animation: notesSpin 1s ease infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

/* ---------------------------------------------------------------------- */
/* Responsive                                                             */
/* ---------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .notes-filters-grid {
    grid-template-columns: 1fr 1fr;
  }

  .notes-filter-panel {
    margin: -20px 20px 18px;
  }

  .notes-groups,
  .notes-hero,
  .notes-form-header,
  .notes-form-container {
    margin-left: 0;
    margin-right: 0;
  }

  .notes-hero {
    padding: 28px 20px 24px;
  }

  .notes-groups {
    padding: 0 20px;
  }

  .notes-form-header {
    padding: 16px 20px;
  }

  .notes-form-container {
    margin: 20px;
  }
}

@media (max-width: 768px) {
  .notes-hero-title {
    font-size: 26px;
  }

  .notes-hero-subtitle {
    font-size: 14px;
  }

  .notes-stat-card {
    min-width: 140px;
  }

  .notes-filter-panel {
    margin: -16px 16px 16px;
    padding: 16px 14px;
  }

  .notes-groups {
    padding: 0 16px;
  }

  .notes-pagination-bar {
    margin: 16px 16px 0;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    margin-bottom: 20px;

  }

  .notes-pagination-top {
    margin: 0 16px 16px;
  }

  .notes-pagination-summary {
    justify-content: center;
  }

  .notes-pagination-controls {
    justify-content: center;
  }

  .notes-hero {
    padding: 24px 16px 20px;
  }

  .notes-filters-grid {
    grid-template-columns: 1fr;
  }

  .notes-period-row {
    flex-direction: column;
    align-items: stretch;
  }

  .notes-groupby-toggle {
    justify-content: space-between;
  }

  .notes-results-row {
    flex-direction: column;
    align-items: stretch;
  }

  .notes-action-buttons {
    justify-content: stretch;
  }

  .notes-action-buttons .notes-export-btn,
  .notes-action-buttons .notes-create-btn {
    flex: 1;
    text-align: center;
  }

  .notes-card-top {
    flex-direction: column;
  }

  .notes-form-container {
    margin: 16px;
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .notes-hero-title {
    font-size: 22px;
  }

  .notes-stats-row {
    gap: 10px;
  }

  .notes-stat-card {
    min-width: 100%;
  }

  .notes-period-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .notes-period-tab {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
  }

  .notes-group-header {
    padding: 14px;
    flex-wrap: wrap;
  }

  .notes-group-urgent-badge {
    order: 3;
  }

  .notes-card {
    padding: 14px;
  }
}/* ==========================================================================
   Logbooks / Care Notes — dashboard redesign (matches Notes.css look)
   ========================================================================== */

:root {
  --lb-navy-900: #002060;
  --lb-navy-700: #002060;
  --lb-ink: #1c2726;
  --lb-ink-soft: #5a6b68;
  --lb-border: #e2e8e5;
  --lb-bg: #f4f7f6;
  --lb-card-bg: #ffffff;
  --lb-urgent: #d64545;
  --lb-urgent-bg: #fde8e8;
  --lb-attention: #b8860b;
  --lb-attention-bg: #fdf3d9;
  --lb-active: #1c9a5b;
  --lb-active-bg: #e6f4ee;
  --lb-archived-bg: #f0f0f0;
  --lb-archived-ink: #666666;
  --lb-paired: #7c4dff;
  --lb-paired-bg: #efe9ff;
  --lb-radius-lg: 16px;
  --lb-radius-md: 10px;
  --lb-radius-sm: 7px;
  --lb-shadow: 0 2px 10px rgba(11, 61, 46, 0.06);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
}

/* ---------------------------------------------------------------------- */
/* Container                                                              */
/* ---------------------------------------------------------------------- */

.logbook-container {
  width: 100%;
  margin: 0;
  padding: 0 0 32px 0;
  font-family: var(--font-family);
  color: var(--lb-ink);
  background: var(--lb-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------------------- */
/* Hero header                                                            */
/* ---------------------------------------------------------------------- */

.logbook-hero {
  background: linear-gradient(135deg, var(--lb-navy-900) 0%, var(--lb-navy-700) 100%);
  color: #ffffff;
  padding: 16px 32px 14px;
  border-radius: 0 0 20px 20px;
}

.logbook-hero-title {
  margin: 0 0 16px;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
}

.logbook-stats-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.logbook-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--lb-radius-md);
  padding: 14px 20px;
  min-width: 180px;
  flex: 1 1 180px;
}

.logbook-stat-icon {
  font-size: 20px;
  opacity: 0.9;
  display: inline-flex;
}

.logbook-stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.logbook-stat-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

/* ---------------------------------------------------------------------- */
/* Filter panel                                                           */
/* ---------------------------------------------------------------------- */

.logbook-filter-panel {
  background: var(--lb-card-bg);
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-lg);
  box-shadow: var(--lb-shadow);
  margin: -20px 32px 20px;
  padding: 18px 20px 16px;
  position: relative;
  z-index: 2;
}

/* ---------------------------------------------------------------------- */
/* Time Filter Buttons & Custom Dates (NEW)                               */
/* ---------------------------------------------------------------------- */

.logbook-time-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.logbook-time-btn {
  padding: 8px 16px;
  border: 1px solid var(--lb-border);
  background: var(--lb-card-bg);
  color: var(--lb-ink);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.logbook-time-btn:hover {
  background: var(--lb-bg);
  border-color: var(--lb-navy-700);
}

.logbook-time-btn.active {
  background: var(--lb-navy-700);
  border-color: var(--lb-navy-700);
  color: #ffffff;
}

.logbook-custom-dates {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--lb-bg);
  border-radius: var(--lb-radius-md);
  border: 1px dashed var(--lb-border);
}

.logbook-custom-dates .logbook-filter-field {
  flex: 1;
  min-width: 0;
}

/* ---------------------------------------------------------------------- */
/* Period & Grouping Rows                                                 */
/* ---------------------------------------------------------------------- */

.logbook-period-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.logbook-period-fields {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.logbook-groupby-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logbook-groupby-label {
  font-size: 13px;
  color: var(--lb-ink-soft);
  font-weight: 500;
}

.logbook-groupby-buttons {
  display: inline-flex;
  border: 1px solid var(--lb-border);
  border-radius: 999px;
  overflow: hidden;
}

.logbook-groupby-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: var(--lb-card-bg);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--lb-ink-soft);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.logbook-groupby-btn + .logbook-groupby-btn {
  border-left: 1px solid var(--lb-border);
}

.logbook-groupby-btn.active {
  background: var(--lb-navy-700);
  color: #ffffff;
}

.logbook-filters-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.logbook-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.logbook-filter-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--lb-ink-soft);
}

.logbook-filter-input {
  padding: 9px 12px;
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-sm);
  font-size: 14px;
  color: var(--lb-ink);
  background: var(--lb-card-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.logbook-filter-input:focus {
  outline: none;
  border-color: var(--lb-navy-700);
  box-shadow: 0 0 0 3px rgba(0, 32, 96, 0.12);
}

.logbook-search-wrap {
  position: relative;
}

.logbook-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.55;
  pointer-events: none;
  display: inline-flex;
}

.logbook-search-input {
  padding-left: 34px;
}

.logbook-results-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--lb-border);
}

.logbook-results-count {
  font-size: 13px;
  color: var(--lb-ink-soft);
  font-weight: 500;
}

.logbook-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.logbook-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--lb-border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  background: var(--lb-card-bg);
  color: var(--lb-ink);
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.logbook-export-btn:hover:not(:disabled) {
  background: #E820DA;
  transform: translateY(-1px);
}

.logbook-export-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.logbook-export-btn.logbook-audit {
  background: #6f42c1;
  border-color: #6f42c1;
  color: #ffffff;
}

.logbook-export-btn.logbook-excel {
  background: var(--lb-active);
  border-color: var(--lb-active);
  color: #ffffff;
}

.logbook-export-btn.logbook-print {
  background: var(--lb-navy-700);
  border-color: var(--lb-navy-700);
  color: #ffffff;
}

.logbook-page-size-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--lb-ink-soft);
  font-weight: 500;
  margin-left: 4px;
}

.logbook-page-size-select {
  padding: 5px 8px;
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--lb-ink);
  background: var(--lb-card-bg);
  cursor: pointer;
}

.logbook-page-size-select:focus {
  outline: none;
  border-color: var(--lb-navy-700);
  box-shadow: 0 0 0 3px rgba(0, 32, 96, 0.12);
}

/* ---------------------------------------------------------------------- */
/* Grouped list                                                           */
/* ---------------------------------------------------------------------- */

.logbook-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 32px;
}

.logbook-empty-state {
  margin: 20px 32px;
  padding: 48px 20px;
  text-align: center;
  color: var(--lb-ink-soft);
  background: var(--lb-card-bg);
  border: 1px dashed var(--lb-border);
  border-radius: var(--lb-radius-lg);
  font-size: 14px;
}

.logbook-group-card {
  background: var(--lb-card-bg);
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-lg);
  box-shadow: var(--lb-shadow);
  overflow: hidden;
}

.logbook-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}

.logbook-group-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--lb-navy-700);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.logbook-group-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.logbook-group-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--lb-ink);
}

.logbook-group-meta {
  font-size: 13px;
  color: var(--lb-ink-soft);
}

.logbook-group-archived-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--lb-archived-bg);
  color: var(--lb-archived-ink);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
}

.logbook-group-chevron {
  flex-shrink: 0;
  color: var(--lb-ink-soft);
  transition: transform 0.15s ease;
  display: inline-flex;
}

.logbook-group-chevron.collapsed {
  transform: rotate(-90deg);
}

.logbook-group-body {
  border-top: 1px solid var(--lb-border);
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------------- */
/* Individual visit card                                                  */
/* ---------------------------------------------------------------------- */

.logbook-card {
  padding: 18px 20px;
}

.logbook-card + .logbook-card {
  border-top: 1px solid var(--lb-border);
}

.logbook-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.logbook-card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.logbook-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.logbook-badge-calltype {
  background: var(--lb-bg);
  color: var(--lb-ink-soft);
  border: 1px solid var(--lb-border);
}

.logbook-badge-active {
  background: var(--lb-active-bg);
  color: var(--lb-active);
}

.logbook-badge-archived {
  background: var(--lb-archived-bg);
  color: var(--lb-archived-ink);
}

.logbook-badge-paired {
  background: var(--lb-paired-bg);
  color: var(--lb-paired);
}

.logbook-card-id {
  font-size: 12px;
  color: var(--lb-ink-soft);
  font-weight: 500;
}

.logbook-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.logbook-card-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--lb-ink);
}

.logbook-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--lb-ink-soft);
  margin-bottom: 10px;
}

.logbook-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.logbook-card-content {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--lb-ink);
  white-space: pre-line;
}

.logbook-read-more-link {
  margin-top: 8px;
  border: none;
  background: none;
  color: var(--lb-navy-700);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.logbook-read-more-link:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------- */
/* Action icon buttons (edit / archive / unarchive)                       */
/* ---------------------------------------------------------------------- */

.logbook-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--lb-border);
  background: var(--lb-bg);
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

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

.logbook-action-btn.logbook-edit:hover {
  background: var(--lb-active-bg);
}

.logbook-action-btn.logbook-archive:hover {
  background: var(--lb-attention-bg);
}

.logbook-action-btn.logbook-unarchive:hover {
  background: var(--lb-active-bg);
}

/* ---------------------------------------------------------------------- */
/* Pagination bar                                                         */
/* ---------------------------------------------------------------------- */

.logbook-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 32px 20px;
  padding: 14px 18px;
  background: var(--lb-card-bg);
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-lg);
  box-shadow: var(--lb-shadow);
}

.logbook-pagination-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.logbook-pagination-info {
  font-size: 13px;
  color: var(--lb-ink-soft);
  font-weight: 500;
}

.logbook-pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.logbook-pagination-nav,
.logbook-pagination-number {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  border: 1px solid var(--lb-border);
  background: var(--lb-card-bg);
  color: var(--lb-ink);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-width: 36px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.logbook-pagination-nav:hover:not(:disabled),
.logbook-pagination-number:hover:not(.active) {
  background: var(--lb-bg);
  border-color: var(--lb-navy-700);
  color: var(--lb-navy-700);
}

.logbook-pagination-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.logbook-pagination-number.active {
  background: var(--lb-navy-700);
  border-color: var(--lb-navy-700);
  color: #fff;
}

/* ---------------------------------------------------------------------- */
/* Edit form                                                              */
/* ---------------------------------------------------------------------- */

.logbook-form-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--lb-border);
  background: var(--lb-card-bg);
}

.logbook-form-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--lb-navy-700);
  margin: 0;
}

.logbook-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--lb-bg);
  color: var(--lb-ink);
  border: 1px solid var(--lb-border);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.logbook-back-btn:hover {
  background: #eef2f0;
}

.logbook-form-container {
  background: var(--lb-card-bg);
  margin: 20px 32px;
  padding: 24px;
  border-radius: var(--lb-radius-lg);
  border: 1px solid var(--lb-border);
  box-shadow: var(--lb-shadow);
}

.logbook-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.logbook-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

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

.logbook-form-group label {
  font-weight: 600;
  color: var(--lb-ink);
  font-size: 13px;
}

.logbook-input {
  padding: 10px 12px;
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-sm);
  font-size: 14px;
  transition: border-color 0.15s ease;
  background: #fff;
}

.logbook-input:focus {
  outline: none;
  border-color: var(--lb-navy-700);
  box-shadow: 0 0 0 3px rgba(0, 32, 96, 0.12);
}

.logbook-input:disabled {
  background: var(--lb-bg);
  color: var(--lb-ink-soft);
  cursor: not-allowed;
}

.logbook-textarea {
  padding: 12px;
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-sm);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 160px;
  transition: border-color 0.15s ease;
}

.logbook-textarea:focus {
  outline: none;
  border-color: var(--lb-navy-700);
  box-shadow: 0 0 0 3px rgba(0, 32, 96, 0.12);
}

.logbook-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.logbook-update-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--lb-navy-700);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.15s ease;
}

.logbook-update-btn:hover:not(:disabled) {
  background: #001c56;
}

.logbook-update-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.logbook-cancel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--lb-urgent);
  border: 1px solid var(--lb-urgent);
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.15s ease;
}

.logbook-cancel-btn:hover:not(:disabled) {
  background: var(--lb-urgent-bg);
}

.logbook-required {
  color: var(--lb-urgent);
  font-weight: bold;
}

/* ---------------------------------------------------------------------- */
/* Toast                                                                  */
/* ---------------------------------------------------------------------- */

.logbook-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  border-radius: 10px;
  color: white;
  font-weight: 500;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: logbookSlideIn 0.3s ease-out;
}

.logbook-toast-success {
  background: var(--lb-active);
}

.logbook-toast-error {
  background: var(--lb-urgent);
}

.logbook-toast-warning {
  background: #e0a800;
  color: #000;
}

.logbook-toast-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

@keyframes logbookSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ---------------------------------------------------------------------- */
/* Delete / archive confirmation modal                                    */
/* ---------------------------------------------------------------------- */

.delete-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 61, 46, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.delete-modal {
  background: white;
  border-radius: var(--lb-radius-lg);
  padding: 0;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.delete-modal-header {
  padding: 20px 24px 0;
}

.delete-modal-header h3 {
  margin: 0 0 16px 0;
  color: var(--lb-urgent);
  font-size: 18px;
  font-weight: 700;
}

.delete-modal-body {
  padding: 0 24px 20px;
}

.delete-modal-body p {
  margin: 0 0 12px 0;
  color: #333;
  line-height: 1.5;
}

.delete-warning {
  color: var(--lb-urgent) !important;
  font-weight: 500;
  font-size: 14px;
}

.delete-modal-actions {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.delete-cancel-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 18px;
  border: 1px solid var(--lb-border);
  background: white;
  color: #333;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.delete-cancel-btn:hover {
  background: var(--lb-bg);
}

.delete-confirm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  background: var(--lb-urgent);
  color: white;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.delete-confirm-btn:hover {
  opacity: 0.9;
}

.delete-confirm-btn.delete-confirm-archive {
  background: var(--lb-attention);
}

.delete-confirm-btn.delete-confirm-unarchive {
  background: var(--lb-active);
}

/* ---------------------------------------------------------------------- */
/* Loading spinner                                                        */
/* ---------------------------------------------------------------------- */

.loading-spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  color: var(--lb-ink-soft);
}

.policy-spinner {
  border: 4px solid rgba(0, 32, 96, 0.15);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: var(--lb-navy-700);
  animation: logbookSpin 1s ease infinite;
  margin-bottom: 12px;
}

.policy-spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--lb-navy-700);
  border-radius: 50%;
  animation: logbookSpin 1s linear infinite;
}

.loading-spinner-small {
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.4);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border-left-color: #ffffff;
  animation: logbookSpin 1s ease infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.logbook-loading {
  text-align: center;
  color: var(--lb-ink-soft);
  padding: 8px 0;
}

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

/* ---------------------------------------------------------------------- */
/* Detail-view compatible helper classes (kept for any older references)  */
/* ---------------------------------------------------------------------- */

.maxwidth {
  max-width: 600px;
}

.individual-time {
  font-size: 0.9em;
  color: var(--lb-ink-soft);
}

.individual-time strong {
  color: var(--lb-ink);
}

/* ---------------------------------------------------------------------- */
/* Audit dashboard (kept for AuditDashboard.tsx)                          */
/* ---------------------------------------------------------------------- */

.audit-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.audit-keyword-highlight {
  background-color: #fff3cd;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 600;
  color: #856404;
}

.audit-split-pane {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  min-height: 600px;
}

.audit-severity-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid;
  font-weight: 600;
}

.audit-severity-high {
  background-color: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.audit-severity-medium {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.audit-severity-low {
  background-color: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

/* ---------------------------------------------------------------------- */
/* Double-up (paired) visits — parallel side-by-side layout               */
/* ---------------------------------------------------------------------- */

.logbook-card-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Remove the stacked look inside a pair — cards sit side by side,
   separated by a vertical divider instead of a top border */
.logbook-card-pair .logbook-card {
  border-top: none;
}

.logbook-card-pair .logbook-card + .logbook-card {
  border-left: 1px solid var(--lb-border);
}

/* Subtle highlight so paired rows stand out */
.logbook-card-pair {
  background: linear-gradient(to right, rgba(239, 233, 255, 0.25), rgba(239, 233, 255, 0.25));
  border-top: 2px solid var(--lb-paired);
}

/* Carer name header at the top of each half (like the profile view's
   "N.SUZAN'S LOGBOOK NOTE" / "P.CLARRY'S LOGBOOK NOTE") */
.logbook-card-carer-header {
  margin: -4px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--lb-border);
  font-size: 13px;
  font-weight: 700;
  color: var(--lb-navy-700);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                             */
/* ---------------------------------------------------------------------- */

@media (max-width: 1200px) {
  .audit-split-pane {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .logbook-filters-grid {
    grid-template-columns: 1fr 1fr;
  }

  .logbook-filter-panel {
    margin: -20px 20px 18px;
  }

  .logbook-groups,
  .logbook-hero,
  .logbook-form-header,
  .logbook-form-container,
  .logbook-pagination-bar {
    margin-left: 0;
    margin-right: 0;
  }

  .logbook-hero {
    padding: 28px 20px 24px;
  }

  .logbook-groups {
    padding: 0 20px;
  }

  .logbook-pagination-bar {
    margin: 18px 20px 20px;
  }

  .logbook-form-header {
    padding: 16px 20px;
  }

  .logbook-form-container {
    margin: 20px;
  }
}

@media (max-width: 768px) {
  .logbook-hero-title {
    font-size: 26px;
  }

  .logbook-stat-card {
    min-width: 140px;
  }

  .logbook-filter-panel {
    margin: -16px 16px 16px;
    padding: 16px 14px;
  }

  .logbook-groups {
    padding: 0 16px;
  }

  .logbook-pagination-bar {
    margin: 16px 16px 20px;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .logbook-pagination-summary,
  .logbook-pagination-controls {
    justify-content: center;
  }

  .logbook-hero {
    padding: 24px 16px 20px;
  }

  .logbook-filters-grid {
    grid-template-columns: 1fr;
  }

  .logbook-period-row {
    flex-direction: column;
    align-items: stretch;
  }

  .logbook-groupby-toggle {
    justify-content: space-between;
  }

  .logbook-results-row {
    flex-direction: column;
    align-items: stretch;
  }

  .logbook-action-buttons {
    justify-content: stretch;
  }

  .logbook-card-top {
    flex-direction: column;
  }

  .logbook-form-container {
    margin: 16px;
    padding: 16px;
  }

  .logbook-custom-dates {
    flex-direction: column;
  }

  .logbook-card-pair {
    grid-template-columns: 1fr;
  }

  .logbook-card-pair .logbook-card + .logbook-card {
    border-left: none;
    border-top: 1px solid var(--lb-border);
  }
}

@media (max-width: 480px) {
  .logbook-hero-title {
    font-size: 22px;
  }

  .logbook-stats-row {
    gap: 10px;
  }

  .logbook-stat-card {
    min-width: 100%;
  }

  .logbook-group-header {
    padding: 14px;
    flex-wrap: wrap;
  }

  .logbook-group-archived-badge {
    order: 3;
  }

  .logbook-card {
    padding: 14px;
  }
}/* =====================================================================
   Support Plan – design tokens
   ===================================================================== */
.sp-container {
  --sp-primary: #5b21b6;
  --sp-primary-dark: #4c1d95;
  --sp-primary-light: #7c3aed;
  --sp-primary-soft: #f5f3ff;
  --sp-primary-line: #ddd6fe;

  --sp-success: #0f766e;
  --sp-success-soft: #ccfbf1;
  --sp-warning: #b45309;
  --sp-warning-soft: #fef3c7;
  --sp-danger: #dc2626;

  --sp-ink: #111827;
  --sp-ink-2: #374151;
  --sp-muted: #6b7280;
  --sp-value: #0b4f9c; /* colour of entered data */
  --sp-border: #e5e7eb;
  --sp-border-strong: #d1d5db;
  --sp-surface: #ffffff;
  --sp-bg: #f4f5f9;

  --sp-radius: 14px;
  --sp-radius-sm: 10px;
  --sp-shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 4px 16px rgba(17, 24, 39, 0.05);
  --sp-focus: 0 0 0 4px rgba(124, 58, 237, 0.18);
  --sp-control-h: 44px;

  display: flex;
  /* --sp-fit-height is set by SupportPlan.tsx so the page always fits the
     space under the app header (web and Electron) and never gets its own
     full-page scrollbar. 90vh is only the fallback before it is measured. */
  height: var(--sp-fit-height, 90vh);
  min-height: 420px;
  position: relative;
  background: var(--sp-bg);
  color: var(--sp-ink);
  font-family: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.sp-container *,
.sp-container *::before,
.sp-container *::after {
  box-sizing: border-box;
}

.sp-container button:focus-visible,
.sp-container a:focus-visible {
  outline: 2px solid var(--sp-primary-light);
  outline-offset: 2px;
}

/* Thin, tidy scrollbars */
.sp-client-list,
.sp-form-container,
.sp-tabs {
  scrollbar-width: thin;
  scrollbar-color: #c4b5fd transparent;
}

/* =====================================================================
   Mobile bar (hidden on desktop)
   ===================================================================== */
.sp-mobile-bar {
  display: none;
}

.sp-backdrop {
  display: none;
}

/* =====================================================================
   Sidebar (expanded by default, collapses to a slim rail on desktop)
   ===================================================================== */
.sp-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sp-surface);
  border-right: 1px solid var(--sp-border);
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 14px 4px 16px;
}

.sp-sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sp-ink-2);
}

.sp-sidebar-title svg {
  color: var(--sp-primary);
}

/* Collapse / expand button (desktop) */
.sp-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: 1px solid var(--sp-primary-line);
  border-radius: var(--sp-radius-sm);
  background: var(--sp-primary-soft);
  color: var(--sp-primary-dark);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.sp-collapse-btn:hover {
  background: #ede9fe;
  border-color: var(--sp-primary-light);
}

/* Close button (mobile drawer only) */
.sp-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: var(--sp-ink-2);
  cursor: pointer;
}

/* Search icon shown only in the collapsed rail */
.sp-rail-search {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 8px auto 4px;
  border: 1px solid var(--sp-border-strong);
  border-radius: var(--sp-radius-sm);
  background: #fafafc;
  color: var(--sp-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sp-rail-search:hover {
  background: var(--sp-primary-soft);
  border-color: var(--sp-primary-line);
  color: var(--sp-primary-dark);
}

.sp-search-row {
  position: relative;
  display: flex;
  align-items: center;
  margin: 12px 12px 6px;
}

.sp-search-icon {
  position: absolute;
  left: 13px;
  display: flex;
  color: var(--sp-muted);
  pointer-events: none;
}

.sp-search-input {
  width: 100%;
  height: var(--sp-control-h);
  padding: 0 38px 0 38px;
  border: 1px solid var(--sp-border-strong);
  border-radius: var(--sp-radius-sm);
  background: #fafafc;
  font-size: 14px;
  color: var(--sp-ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.sp-search-input::placeholder {
  color: #9ca3af;
}

.sp-search-input:focus {
  background: #fff;
  border-color: var(--sp-primary-light);
  box-shadow: var(--sp-focus);
}

.sp-search-clear {
  position: absolute;
  right: 8px;
  display: flex;
  padding: 6px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--sp-muted);
  cursor: pointer;
}

.sp-search-clear:hover {
  background: var(--sp-border);
  color: var(--sp-ink);
}

/* "43 of 43 clients" */
.sp-count-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 6px 18px 8px;
  font-size: 12.5px;
  color: var(--sp-muted);
}

.sp-client-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 14px;
  border-top: 1px solid var(--sp-border);
  -webkit-overflow-scrolling: touch;
}

.sp-client-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin: 4px 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--sp-radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.sp-client-item:hover {
  background: #f7f7fb;
}

.sp-client-active {
  background: var(--sp-primary-soft) !important;
  border-color: var(--sp-primary-line) !important;
}

.sp-client-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sp-client-name-text {
  font-weight: 600;
  font-size: 14px;
  color: var(--sp-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-client-postcode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--sp-muted);
}

.sp-avatar {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sp-primary-soft);
  color: var(--sp-primary);
  border: 1px solid var(--sp-primary-line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sp-client-active .sp-avatar {
  background: var(--sp-primary);
  color: #fff;
  border-color: var(--sp-primary);
}

.sp-avatar-lg {
  width: 50px;
  height: 50px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.sp-list-message {
  padding: 28px 12px;
  text-align: center;
  color: var(--sp-muted);
}

.sp-list-message p {
  margin: 0 0 12px;
}

.sp-skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.sp-skeleton {
  height: 52px;
  border-radius: var(--sp-radius-sm);
  background: linear-gradient(90deg, #f1f2f6 25%, #e8e9f0 37%, #f1f2f6 63%);
  background-size: 400% 100%;
  animation: sp-shimmer 1.4s ease infinite;
}

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

/* Rail-only content is hidden unless the sidebar is collapsed (desktop) */
.sp-only-rail {
  display: none;
}

/* ---- Collapsed rail: desktop / tablet only ---- */
@media (min-width: 821px) {
  .sp-sidebar.sp-sidebar-collapsed {
    width: 76px;
  }

  .sp-sidebar-collapsed .sp-only-expanded {
    display: none !important;
  }

  .sp-sidebar-collapsed .sp-only-rail {
    display: inline-flex;
  }

  .sp-sidebar-collapsed .sp-sidebar-head {
    justify-content: center;
    padding: 16px 0 4px;
  }

  .sp-sidebar-collapsed .sp-collapse-btn {
    margin-left: 0;
  }

  .sp-sidebar-collapsed .sp-client-list {
    margin-top: 8px;
    padding: 10px 0 14px;
    overflow-x: hidden;
  }

  .sp-sidebar-collapsed .sp-client-item {
    justify-content: center;
    width: 52px;
    margin: 6px auto;
    padding: 8px 0;
  }

  .sp-sidebar-collapsed .sp-skeleton {
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border-radius: 50%;
  }

  .sp-sidebar-collapsed .sp-list-message {
    padding: 14px 4px;
    font-size: 11px;
  }

  .sp-sidebar-collapsed .sp-list-message .sp-btn {
    min-height: 34px;
    padding: 4px 8px;
    font-size: 12px;
  }
}

/* =====================================================================
   Main + header
   ===================================================================== */
.sp-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 24px;
  flex-wrap: wrap;
  margin: 14px 16px 0;
  padding: 16px 22px;
  border-radius: var(--sp-radius);
  background: linear-gradient(120deg, var(--sp-primary-dark), var(--sp-primary) 55%, var(--sp-primary-light));
  color: #fff;
  box-shadow: 0 8px 22px rgba(76, 29, 149, 0.25);
  position: relative;
  overflow: hidden;
}

.sp-header::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%);
  pointer-events: none;
}

.sp-header-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.sp-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 5px 0 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
}

.sp-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sp-header-side {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.sp-progress {
  min-width: 200px;
}

.sp-progress-label {
  margin-bottom: 7px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.88);
}

.sp-progress-label strong {
  color: #fff;
  font-size: 15px;
}

.sp-progress-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.sp-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5eead4, #99f6e4);
  transition: width 0.4s ease;
}

.sp-header-buttons {
  display: flex;
  gap: 8px;
}

.sp-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--sp-radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.1s;
}

.sp-action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.26);
}

.sp-action-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.sp-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* =====================================================================
   Tabs – every section, numbered 1–24
   ===================================================================== */
.sp-tabs {
  margin: 14px 16px 0;
  padding: 12px;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow);
}

.sp-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
}

.sp-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 14px 5px 6px;
  border: 1px solid var(--sp-border);
  border-radius: 999px;
  background: #fff;
  color: var(--sp-ink-2);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.sp-tab:hover {
  border-color: var(--sp-primary-line);
  background: var(--sp-primary-soft);
}

.sp-tab-active,
.sp-tab-active:hover {
  border-color: transparent;
  background: linear-gradient(135deg, var(--sp-primary-dark), var(--sp-primary-light));
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

.sp-tab-number {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eceef2;
  color: var(--sp-ink-2);
  font-size: 11.5px;
  font-weight: 700;
}

.sp-tab-number-with-data {
  background: var(--sp-success);
  color: #fff !important;
}

.sp-tab-active .sp-tab-number {
  background: rgba(255, 255, 255, 0.95);
  color: var(--sp-primary-dark);
}

.sp-tab-active .sp-tab-number-with-data {
  background: #5eead4;
  color: #064e3b !important;
}

.sp-tab-name {
  font-size: 13.5px;
}

/* =====================================================================
   Form container + section bar
   ===================================================================== */
.sp-form-container {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 28px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.sp-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 14px;
}

.sp-section-step {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sp-muted);
}

.sp-section-heading {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--sp-ink);
}

.sp-status {
  flex-shrink: 0;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.sp-status-done {
  background: var(--sp-success-soft);
  color: var(--sp-success);
}

.sp-status-todo {
  background: var(--sp-warning-soft);
  color: var(--sp-warning);
}

.sp-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

/* =====================================================================
   Form building blocks (used by the individual form components)
   ===================================================================== */
.sp-form {
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  padding: 28px;
  box-shadow: var(--sp-shadow);
}

.sp-form-title {
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--sp-primary-line);
  font-size: 20px;
  font-weight: 800;
  color: var(--sp-ink);
}

.sp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
  margin-bottom: 24px;
}

.sp-three-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 24px;
  margin-bottom: 24px;
}

.sp-form-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sp-form-group-full {
  grid-column: 1 / -1;
}

.sp-label {
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--sp-ink-2);
}

.sp-input,
.sp-textarea,
.sp-select {
  width: 100%;
  min-height: var(--sp-control-h);
  padding: 10px 14px;
  border: 1px solid var(--sp-border-strong);
  border-radius: var(--sp-radius-sm);
  background: #fff;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--sp-value);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.sp-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.sp-input::placeholder,
.sp-textarea::placeholder {
  color: #9ca3af;
}

.sp-input:hover,
.sp-textarea:hover,
.sp-select:hover {
  border-color: #b8bcc6;
}

.sp-input:focus,
.sp-textarea:focus,
.sp-select:focus {
  border-color: var(--sp-primary-light);
  box-shadow: var(--sp-focus);
}

.sp-input:disabled,
.sp-textarea:disabled,
.sp-select:disabled {
  background: #f3f4f6;
  color: var(--sp-muted);
  cursor: not-allowed;
}

.sp-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.sp-textarea-full-width {
  width: 100%;
  min-height: 43rem;
  resize: vertical;
}

/* Choices (checkbox / radio) */
.sp-checkbox-label,
.sp-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  cursor: pointer;
  font-size: 14px;
  color: var(--sp-ink-2);
}

.sp-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--sp-primary);
}

.sp-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.sp-radio-label {
  padding: 7px 16px 7px 12px;
  border: 1px solid var(--sp-border-strong);
  border-radius: 999px;
  background: #fff;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sp-radio-label:hover {
  border-color: var(--sp-primary-light);
}

.sp-radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--sp-primary);
}

.sp-radio-label:has(input:checked) {
  background: var(--sp-primary-soft);
  border-color: var(--sp-primary);
  color: var(--sp-primary-dark);
}

.sp-radio-label:has(input:focus-visible) {
  box-shadow: var(--sp-focus);
}

/* Save bar: sticks to the bottom so Save is always reachable */
.sp-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--sp-border);
}

.sp-required::after {
  content: " *";
  color: var(--sp-danger);
  font-weight: 700;
}

.sp-info-text {
  margin-bottom: 12px;
  font-size: 13px;
  font-style: italic;
  color: var(--sp-muted);
}

.sp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 12px;
}

.sp-field-group {
  display: flex;
  flex-direction: column;
  flex: 1 1 220px;
  min-width: 0;
}

.sp-offset {
  margin-right: auto;
  max-width: 90%;
}

/* Section header inside a form */
.sp-section-header {
  margin: 28px 0 18px;
  padding: 12px 16px;
  border-left: 4px solid var(--sp-primary);
  border-radius: 0 var(--sp-radius-sm) var(--sp-radius-sm) 0;
  background: linear-gradient(90deg, var(--sp-primary-soft), #fff);
  font-size: 15px;
  font-weight: 700;
  color: var(--sp-primary);
}

.sp-form-section {
  margin-bottom: 28px;
  padding: 22px;
  background: #fafbfc;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
}

.sp-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--sp-primary-line);
  font-size: 16px;
  font-weight: 700;
  color: var(--sp-primary-dark);
}

.sp-section-title::before {
  content: "";
  flex-shrink: 0;
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--sp-primary), var(--sp-primary-light));
}

/* Tables */
.sp-table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
}

.sp-table th,
.sp-table td {
  padding: 12px;
  border: 1px solid var(--sp-border);
  text-align: left;
}

.sp-table th {
  background: #f3f4f6;
  font-weight: 600;
  color: var(--sp-ink-2);
}

.sp-table-container {
  overflow-x: auto;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-sm);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.sp-data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14px;
}

.sp-data-table thead {
  background: linear-gradient(135deg, var(--sp-primary), var(--sp-primary-light));
  color: #fff;
}

.sp-data-table th {
  padding: 13px 12px;
  border: none;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.sp-data-table tbody tr {
  border-bottom: 1px solid var(--sp-border);
  transition: background 0.15s;
}

.sp-data-table tbody tr:hover {
  background: #fafaff;
}

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

.sp-data-table td {
  padding: 12px;
  vertical-align: middle;
  border: none;
}

.sp-select-small,
.sp-data-table input[type="date"] {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--sp-border-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: var(--sp-value);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sp-select-small:focus,
.sp-data-table input[type="date"]:focus {
  border-color: var(--sp-primary-light);
  box-shadow: var(--sp-focus);
}

.sp-data-table .sp-input {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 13px;
}

/* =====================================================================
   Buttons
   ===================================================================== */
.sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--sp-control-h);
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--sp-radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}

.sp-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.sp-btn-primary {
  background: linear-gradient(135deg, var(--sp-primary), var(--sp-primary-light));
  color: #fff;
  box-shadow: 0 4px 12px rgba(91, 33, 182, 0.28);
}

.sp-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--sp-primary-dark), var(--sp-primary));
}

.sp-btn-primary:disabled {
  background: #a5a9b4;
  box-shadow: none;
  cursor: not-allowed;
}

.sp-btn-secondary {
  background: #fff;
  color: var(--sp-ink-2);
  border-color: var(--sp-border-strong);
}

.sp-btn-secondary:hover:not(:disabled) {
  background: #f3f4f6;
}

.sp-btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sp-btn-add {
  min-width: 40px;
  min-height: 40px;
  padding: 6px 12px;
  border: none;
  border-radius: 10px;
  background: var(--sp-primary);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s;
}

.sp-btn-add:hover {
  background: var(--sp-primary-dark);
}

/* =====================================================================
   States
   ===================================================================== */
.sp-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 160px;
  padding: 16px;
  color: var(--sp-muted);
  font-size: 15px;
}

.sp-empty-main {
  flex: 1;
}

.sp-empty-card {
  max-width: 340px;
  text-align: center;
}

.sp-empty-card h2 {
  margin: 14px 0 6px;
  font-size: 18px;
  color: var(--sp-ink);
}

.sp-empty-card p {
  margin: 0;
}

.sp-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--sp-primary-soft);
  color: var(--sp-primary);
}

.sp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  min-height: 220px;
  color: var(--sp-primary);
  font-weight: 600;
}

.sp-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--sp-primary-line);
  border-top-color: var(--sp-primary);
  border-radius: 50%;
  animation: sp-spin 0.8s linear infinite;
}

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

/* Toast */
.sp-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  max-width: 380px;
  padding: 13px 20px;
  border-radius: var(--sp-radius-sm);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.22);
  animation: sp-slide-in 0.25s ease-out;
}

.sp-toast-success { background: #047857; }
.sp-toast-error { background: #b91c1c; }

@keyframes sp-slide-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Legacy helpers kept for compatibility */
.lbl {
  padding-bottom: 5px;
  padding-left: 10px;
}

/* =====================================================================
   Basic Information / Support Networks additions
   ===================================================================== */
.sp-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--sp-muted);
}

.sp-readonly,
.sp-input[readonly] {
  background: #f3f4f6;
  color: var(--sp-muted);
  cursor: not-allowed;
}

.sp-question {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--sp-ink-2);
  line-height: 1.5;
}

.sp-question-block {
  padding: 16px 0;
  border-bottom: 1px solid var(--sp-border);
}

.sp-question-block:last-child {
  border-bottom: none;
}

.sp-alert {
  display: flex;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--sp-radius-sm);
  border: 1px solid;
  font-size: 13.5px;
}

.sp-alert ul {
  margin: 4px 0 0 18px;
  padding: 0;
}

.sp-alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.sp-alert-warn  { background: var(--sp-warning-soft); border-color: #fde68a; color: #92400e; }
.sp-alert-info  { background: var(--sp-primary-soft); border-color: var(--sp-primary-line); color: var(--sp-primary-dark); }

.sp-dirty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--sp-warning-soft);
  color: #92400e;
  font-size: 12.5px;
  font-weight: 600;
}

.sp-dirty::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
}

.sp-saved-state {
  margin-right: auto;
  font-size: 12.5px;
  color: var(--sp-muted);
}

/* ---- visit cards ---- */
.sp-visit-card {
  margin-bottom: 14px;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.sp-visit-card-error { border-color: #fca5a5; }
.sp-visit-card-expired { opacity: 0.6; }

.sp-visit-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 11px 16px;
  background: #fafafc;
  border-bottom: 1px solid var(--sp-border);
}

.sp-visit-title { font-weight: 700; color: var(--sp-ink); }
.sp-visit-spacer { flex: 1; }

.sp-visit-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 0.7fr 0.9fr;
  gap: 14px;
  padding: 16px;
}

.sp-time-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sp-day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 16px;
  align-items: center;
}

.sp-chip {
  min-height: 34px;
  padding: 5px 14px;
  border: 1px solid var(--sp-border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--sp-ink-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sp-chip:hover { border-color: var(--sp-primary-light); }

.sp-chip-on {
  background: var(--sp-primary);
  border-color: var(--sp-primary);
  color: #fff;
}

.sp-variation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px dashed var(--sp-border);
  background: #fcfcfe;
}

.sp-variation .sp-input-compact {
  height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--sp-border-strong);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--sp-value);
  background: #fff;
}

.sp-variation small { color: var(--sp-muted); }

.sp-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.sp-badge-green  { background: #dcfce7; color: #166534; }
.sp-badge-blue   { background: #dbeafe; color: #1e40af; }
.sp-badge-indigo { background: #e0e7ff; color: #3730a3; }
.sp-badge-orange { background: #ffedd5; color: #9a3412; }
.sp-badge-red    { background: #fee2e2; color: #991b1b; }
.sp-badge-grey   { background: #f3f4f6; color: #6b7280; }

.sp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 5px 8px;
  border: none;
  border-radius: 8px;
  background: #f3f4f6;
  color: var(--sp-ink-2);
  cursor: pointer;
}

.sp-icon-btn:hover { background: #e5e7eb; }
.sp-icon-btn-danger { background: #fee2e2; color: #dc2626; }
.sp-icon-btn-danger:hover { background: #fecaca; }

.sp-add-dashed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 2px dashed var(--sp-primary-line);
  border-radius: var(--sp-radius-sm);
  background: var(--sp-primary-soft);
  color: var(--sp-primary);
  font-weight: 600;
  cursor: pointer;
}

.sp-add-dashed:hover { background: #ede9fe; }

/* =====================================================================
   Responsive – tablet
   ===================================================================== */
@media (max-width: 1100px) {
  .sp-three-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-sidebar { width: 260px; }
}

@media (max-width: 900px) {
  .sp-visit-grid { grid-template-columns: 1fr 1fr; }
}

/* =====================================================================
   Responsive – mobile (sidebar becomes a slide-in drawer)
   ===================================================================== */
@media (max-width: 820px) {
  .sp-container {
    display: block;
    height: auto;
    min-height: calc(100dvh - 60px);
    --sp-control-h: 48px;
  }

  /* top bar with the "Clients" button */
  .sp-mobile-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--sp-border);
  }

  .sp-mobile-clients-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid var(--sp-primary-line);
    border-radius: 999px;
    background: var(--sp-primary-soft);
    color: var(--sp-primary-dark);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
  }

  .sp-mobile-current {
    min-width: 0;
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--sp-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sp-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    width: min(88vw, 340px);
    max-width: none;
    height: 100dvh;
    border-right: none;
    box-shadow: 12px 0 40px rgba(17, 24, 39, 0.25);
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .sp-sidebar-open {
    transform: translateX(0);
  }

  /* the drawer always shows the full list: hide desktop collapse, show close */
  .sp-collapse-btn {
    display: none;
  }

  .sp-sidebar-close {
    display: inline-flex;
    margin-left: auto;
  }

  .sp-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    background: rgba(17, 24, 39, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }

  .sp-backdrop-show {
    opacity: 1;
    pointer-events: auto;
  }

  .sp-main {
    overflow: visible;
  }

  .sp-header {
    margin: 10px;
    padding: 14px;
    gap: 14px;
  }

  .sp-avatar-lg { width: 44px; height: 44px; font-size: 15px; }
  .sp-title { font-size: 18px; }

  .sp-header-side {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .sp-progress { min-width: 0; }

  .sp-header-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  /* tabs → compact, swipeable */
  .sp-tabs {
    margin: 0 10px;
    padding: 10px;
  }

  .sp-sections {
    flex-wrap: nowrap;
    margin: 0 -10px;
    padding: 2px 10px 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .sp-sections::-webkit-scrollbar { display: none; }

  .sp-tab {
    flex: 0 0 auto;
    min-height: 42px;
    scroll-snap-align: start;
  }

  .sp-form-container {
    overflow: visible;
    padding: 4px 10px 24px;
  }

  .sp-section-heading { font-size: 18px; }

  .sp-form,
  .sp-form-section {
    padding: 16px;
    border-radius: 12px;
  }

  .sp-form-title { font-size: 18px; margin-bottom: 18px; }
  .sp-form-grid,
  .sp-three-columns { grid-template-columns: 1fr; gap: 16px; }

  /* 16px stops iOS Safari zooming into fields */
  .sp-input,
  .sp-textarea,
  .sp-select,
  .sp-search-input { font-size: 16px; }

  .sp-textarea-full-width { min-height: 24rem; }

  .sp-radio-group { gap: 8px; }
  .sp-radio-label { flex: 1 1 auto; justify-content: flex-start; min-height: 44px; }

  .sp-offset { max-width: 100%; }
  .sp-field-group { flex-basis: 100%; margin-right: 0; }

  /* Save bar sticks to the bottom of the screen */
  .sp-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 16px -16px -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--sp-border);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 -6px 16px rgba(17, 24, 39, 0.06);
  }

  .sp-form-actions .sp-btn { flex: 1 1 auto; }

  .sp-pager .sp-btn { flex: 1 1 0; }

  .sp-visit-grid { grid-template-columns: 1fr; padding: 14px; }
  .sp-day-chips { padding: 0 14px 14px; }

  .sp-data-table { font-size: 13px; }
  .sp-data-table th,
  .sp-data-table td { padding: 10px 8px; }

  .sp-toast {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    max-width: none;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .sp-header-buttons .sp-action-btn { padding: 8px 6px; font-size: 12.5px; }
  .sp-section-bar { align-items: flex-start; }
  .sp-time-range { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .sp-container *,
  .sp-toast {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}/* Medication Management Styles */

.med-container {
    display: flex;
    gap: 1rem;
    height: 100%;
    padding: 1rem;
}

.med-sidebar {
    width: 15rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-right: 1px solid #a2b1abaa;
    padding-right: 1rem;
}

.med-search-box {
    padding: 0.5rem;
}

.med-client-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    max-height: calc(100vh - 155px);
}

.med-client-item {
    padding: 0.65rem;
    border-bottom: 1px solid #d5d6d8;
    cursor: pointer;
    transition: background-color 0.2s;
    background: white;
    border-top: none;
    border-left: none;
    border-right: none;
    width: 100%;
    text-align: left;
}

.med-client-item:hover {
    background-color: #f3f4f6;
}

.med-client-item.med-client-active {
    background-color: #99b7e897;
    color: rgb(34, 72, 108);
}

.med-client-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.med-client-info {
    font-size: 0.75rem;
    opacity: 0.8;
}

.med-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

.med-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.med-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.med-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0 0 0;
}

.med-header-buttons {
    display: flex;
    gap: 0.5rem;
}

.med-filter-bar {
    display: flex;
    gap: 1rem;
    padding: 0.3em;
    background: rgba(133, 160, 168, 0.219);
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.med-search-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.med-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.med-select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: white;
}

.med-table-container {
    flex: 1;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    max-height: 63vh;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.med-table {
    width: 100%;
    border-collapse: collapse;
}

.med-table thead {
    background-color: #002060;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.med-table-header th {
    padding: 0.55rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.775rem;
}

.med-table-row {
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.med-table-row:hover {
    background-color: #d4d4d4;
}

.med-table td {
    padding: 0.45rem;
    font-size: 0.875rem;
}

.med-medicine-name {
    color: #2563eb;
    font-weight: 500;
}

.med-actions {
    display: flex;
    gap: 0.5rem;
}

.med-btn-icon {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
    background: transparent;
    font-size: 1rem;
}

.med-btn-icon:hover {
    background-color: #e5e7eb;
}

.med-btn {
    padding: 0.3rem 0.7rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.med-btn-primary {
    background-color: #002060;
    color: white;
}

.med-btn-primary:hover {
    background-color: #2563eb;
}

.med-btn-secondary {
    background-color: #002060;
    color: white;
}

.med-btn-secondary:hover {
    background-color: #2563eb;
}

.med-loading {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}

.med-empty {
    padding: 3rem;
    text-align: center;
    color: #9ca3af;
    font-size: 1rem;
}

/* ================= MODALS ================= */

/* Overlay sits above the app navbar and always has breathing room */
.med-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    box-sizing: border-box;
}

.med-modal {
    background: rgb(234, 234, 234);
    border-radius: 0.5rem;
    max-width: 72rem;
    width: 95%;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.med-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #002060;
    color: #ffffff;
    flex-shrink: 0;
}

.med-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 800;
    color: #ffffff;
}

.med-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ffffff;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    transition: background-color 0.2s;
}

.med-modal-close:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.2);
}

.med-modal-close svg {
    color: #ffffff;
    stroke: #ffffff;
}

.med-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    min-height: 0;
    flex: 1 1 auto;
}

.med-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.med-form-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.med-form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.med-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.med-form-full {
    grid-column: 1 / -1;
}

.med-form-span-2 {
    grid-column: span 2;
}

.med-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.med-input,
.med-textarea {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    text-overflow: ellipsis;
}

.med-input:focus,
.med-textarea:focus,
.med-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.med-textarea {
    resize: vertical;
    font-family: inherit;
}

.med-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #cbcea3;
}

.med-form-actions-btn-Add {
    background-color: #002060;
    border-radius: 0.475rem;
}

.med-form-actions-btn-Cancel {
    background-color: #002060;
    border-radius: 0.475rem;
}

/* Call type checkboxes */
.med-call-types {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #f9fafb;
}

.med-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.med-checkbox-group input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.med-checkbox-group label {
    font-size: 0.875rem;
    cursor: pointer;
    margin: 0;
}

/* Days checkboxes */
.med-days-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #f9fafb;
}

/* ================= DETAILED VIEW (REDESIGNED) ================= */

.med-detail-modal {
    max-width: 90rem;
    background: #eef1f6;
}

.med-detail-wrap {
    --d-navy: #002060;
    --d-navy-soft: #dfe7f7;
    --d-ink: #1b2430;
    --d-muted: #6b7686;
    --d-line: #e3e8f0;
    --d-surface: #ffffff;
    --d-panel: #f5f7fb;
    --d-accent: #c21bb6;
    --d-accent-soft: #fbe8f9;
    --d-note: #fff6dd;
    --d-note-edge: #e0a919;

    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    color: var(--d-ink);
}

/* ---- Client header ---- */
.med-detail-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: var(--d-navy);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 32, 96, 0.25);
}

.med-detail-client {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
}

.med-detail-avatar {
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: #ffffff;
}

.med-detail-name {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
}

.med-detail-postcode {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: #b9c9ee;
}

.med-detail-client-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0;
}

.med-detail-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
}

.med-detail-info-item svg {
    flex: 0 0 auto;
    color: #b9c9ee;
}

.med-detail-info-label {
    color: #b9c9ee;
    font-weight: 400;
    margin: 0;
}

.med-detail-info-value {
    margin: 0;
    font-weight: 700;
    color: #ffffff;
}

/* ---- Section heading ---- */
.med-detail-section-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin: 0;
}

.med-detail-section-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--d-navy);
}

.med-detail-count {
    font-size: 0.85rem;
    color: var(--d-muted);
}

/* ---- Cards grid ---- */
.med-detail-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
    padding: 0;
    align-items: stretch;
}

.med-detail-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--d-line);
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--d-surface);
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.med-detail-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    background: var(--d-surface);
    color: var(--d-ink);
    border-bottom: 1px solid var(--d-line);
    border-top: 4px solid var(--d-navy);
}

.med-detail-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    min-width: 0;
}

.med-detail-card-icon {
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.6rem;
    background: var(--d-navy-soft);
    color: var(--d-navy);
    display: flex;
    align-items: center;
    justify-content: center;
}

.med-detail-card-title {
    margin: 0.1rem 0 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--d-ink);
    overflow-wrap: anywhere;
}

.med-detail-badge {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--d-accent-soft);
    color: var(--d-accent);
    border: 1px solid #f1b8ec;
    font-size: 0.72rem;
    font-weight: 600;
}

.med-detail-card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.1rem 1.1rem;
}

/* ---- Long instructions (dose / frequency) ---- */
.med-detail-instructions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
}

.med-detail-instruction {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.med-detail-instruction > svg {
    flex: 0 0 auto;
    margin-top: 0.15rem;
    color: var(--d-navy);
}

.med-detail-instruction-label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--d-muted);
    line-height: 1.2;
}

.med-detail-instruction-text {
    margin: 0.1rem 0 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--d-ink);
    overflow-wrap: anywhere;
}

/* ---- Short facts grid ---- */
.med-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1rem;
    margin: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--d-line);
}

.med-detail-field {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    min-width: 0;
    font-size: 0.875rem;
}

.med-detail-field > svg {
    flex: 0 0 auto;
    margin-top: 0.15rem;
    color: #8a96a8;
}

.med-detail-field-label {
    display: block;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--d-muted);
    line-height: 1.2;
}

.med-detail-field-value {
    display: block;
    margin: 0.1rem 0 0;
    font-weight: 600;
    color: var(--d-ink);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.med-detail-field-value.is-ongoing {
    color: #0f7a4f;
}

/* ---- Prescriber + ordering panel ---- */
.med-detail-order {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem 1rem;
    margin: 0;
    padding: 0.85rem 0.9rem;
    border-radius: 0.6rem;
    background: var(--d-panel);
}

/* ---- Notes ---- */
.med-detail-notes {
    margin-top: auto;
    padding: 0.7rem 0.9rem;
    border-top: none;
    border-left: 4px solid var(--d-note-edge);
    border-radius: 0.4rem;
    background: var(--d-note);
}

.med-detail-notes-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #7a5a00;
}

.med-detail-notes-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #4a3a00;
    overflow-wrap: anywhere;
}

@media (max-width: 480px) {
    .med-detail-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .med-detail-order {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ================= END DETAILED VIEW ================= */

/* Confirm modal */
.med-confirm-modal {
    background: white;
    border-radius: 0.5rem;
    max-width: 28rem;
    width: 90%;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.med-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

.med-btn-danger {
    background-color: #ef4444;
    color: white;
}

.med-btn-danger:hover {
    background-color: #dc2626;
}

/* Restore button */
.med-btn-restore {
    color: #10b981;
}

.med-btn-restore:hover {
    background-color: #d1fae5;
}

/* Toast notifications */
.med-toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 10001;
    animation: slideIn 0.3s ease-out;
}

.med-toast-success {
    background-color: #10b981;
    color: white;
}

.med-toast-error {
    background-color: #ef4444;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}/* ==========================================================================
   Policies Management – professional, mobile-first stylesheet
   ========================================================================== */

.policy-container {
  --pm-bg: #f1f3f8;
  --pm-surface: #ffffff;
  --pm-surface-2: #f7f8fc;
  --pm-border: #e3e7f0;
  --pm-border-strong: #cfd5e3;
  --pm-text: #172033;
  --pm-text-2: #4b5671;
  --pm-text-3: #7b869f;
  --pm-primary: #4f46e5;
  --pm-primary-dark: #4338ca;
  --pm-primary-soft: #eef0ff;
  --pm-accent: #7c3aed;
  --pm-success: #15803d;
  --pm-success-soft: #e8f7ee;
  --pm-warning: #b45309;
  --pm-warning-soft: #fff4e0;
  --pm-danger: #c62828;
  --pm-danger-soft: #fdeaea;
  --pm-radius-sm: 8px;
  --pm-radius: 12px;
  --pm-radius-lg: 16px;
  --pm-shadow-sm: 0 1px 2px rgba(23, 32, 51, 0.06);
  --pm-shadow: 0 1px 3px rgba(23, 32, 51, 0.08), 0 4px 14px rgba(23, 32, 51, 0.05);
  --pm-shadow-lg: 0 12px 40px rgba(23, 32, 51, 0.22);

  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: var(--pm-text);
  background: var(--pm-bg);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.policy-container *,
.policy-container *::before,
.policy-container *::after {
  box-sizing: border-box;
}

.policy-container button {
  font-family: inherit;
}

.policy-container button:focus-visible,
.policy-container input:focus-visible,
.policy-container select:focus-visible {
  outline: 2px solid var(--pm-primary);
  outline-offset: 2px;
}

/* ---------- Page header ---------- */
.policy-header {
  padding: 1rem 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.policy-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--pm-text);
}

.policy-subtitle {
  margin: 0.125rem 0 0;
  font-size: 0.875rem;
  color: var(--pm-text-3);
}

/* ---------- Stats ---------- */
.policy-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
}

.policy-stat-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  padding: 0.625rem 0.75rem;
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  box-shadow: var(--pm-shadow-sm);
}

.policy-stat-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--pm-primary-soft);
  color: var(--pm-primary);
}

.policy-stat-card.is-warning .policy-stat-icon {
  background: var(--pm-warning-soft);
  color: var(--pm-warning);
}

.policy-stat-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.policy-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.policy-stat-label {
  font-size: 0.75rem;
  color: var(--pm-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Toolbar ---------- */
.policy-toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  margin-top: 0.25rem;
  background: rgba(241, 243, 248, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}

.policy-search {
  grid-column: 1 / -1;
  position: relative;
}

.policy-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pm-text-3);
  pointer-events: none;
}

.policy-search-input,
.policy-filter-select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--pm-border-strong);
  border-radius: var(--pm-radius-sm);
  background: var(--pm-surface);
  color: var(--pm-text);
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.policy-search-input {
  padding: 0 0.75rem 0 2.25rem;
}

.policy-filter-select {
  padding: 0 0.75rem;
  cursor: pointer;
  min-width: 0;
}

.policy-search-input::placeholder {
  color: var(--pm-text-3);
}

.policy-search-input:focus,
.policy-filter-select:focus {
  outline: none;
  border-color: var(--pm-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.policy-view-toggle {
  display: inline-flex;
  height: 40px;
  padding: 3px;
  gap: 2px;
  background: var(--pm-surface);
  border: 1px solid var(--pm-border-strong);
  border-radius: var(--pm-radius-sm);
}

.policy-view-btn {
  width: 34px;
  border: none;
  background: transparent;
  color: var(--pm-text-3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.policy-view-btn:hover {
  background: var(--pm-surface-2);
  color: var(--pm-text);
}

.policy-view-btn.active {
  background: var(--pm-primary);
  color: #fff;
}

.policy-toolbar-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

.policy-btn {
  height: 40px;
  padding: 0 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-radius: var(--pm-radius-sm);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.policy-btn-primary {
  background: var(--pm-primary);
  color: #fff;
}

.policy-btn-primary:hover {
  background: var(--pm-primary-dark);
}

.policy-btn-secondary {
  background: var(--pm-surface);
  color: var(--pm-primary);
  border-color: var(--pm-border-strong);
}

.policy-btn-secondary:hover {
  background: var(--pm-primary-soft);
  border-color: var(--pm-primary);
}

/* ---------- Content ---------- */
.policy-content-wrapper {
  flex: 1;
  padding: 0.25rem 1rem 1.5rem;
}

.policy-loading,
.policy-empty {
  max-width: 460px;
  margin: 2rem auto;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-lg);
  box-shadow: var(--pm-shadow-sm);
  color: var(--pm-text-2);
}

.policy-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pm-primary-soft);
  color: var(--pm-primary);
  border-radius: 50%;
}

.policy-empty h3 {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
  color: var(--pm-text);
}

.policy-empty p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--pm-text-3);
}

.policy-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.75rem;
  border: 3px solid var(--pm-border);
  border-top-color: var(--pm-primary);
  border-radius: 50%;
  animation: policy-spin 0.8s linear infinite;
}

.policy-spinner-large {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: policy-spin 0.8s linear infinite;
}

.policy-spinner-small {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: policy-spin 0.8s linear infinite;
}

.spin {
  animation: policy-spin 0.8s linear infinite;
}

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

/* ---------- Visibility badges ---------- */
.visibility-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.visibility-all   { background: var(--pm-success-soft); color: var(--pm-success); border-color: #bfe6cd; }
.visibility-staff { background: #eaf2ff; color: #1d4ed8; border-color: #c7dafd; }
.visibility-admin { background: var(--pm-danger-soft); color: var(--pm-danger); border-color: #f6c9c9; }

/* ---------- Grid view ---------- */
.policy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
  margin-bottom: 1rem;
}

.policy-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1rem;
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  box-shadow: var(--pm-shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.policy-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--pm-success);
}

.policy-card[data-visibility="staff"]::before { background: #2563eb; }
.policy-card[data-visibility="admin"]::before { background: var(--pm-danger); }

.policy-card:hover {
  border-color: var(--pm-border-strong);
  box-shadow: var(--pm-shadow);
}

.policy-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.policy-card-icon-wrapper {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--pm-primary-soft);
  color: var(--pm-primary);
}

.policy-card-icon-svg {
  width: 20px;
  height: 20px;
}

.policy-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
  padding-top: 0.125rem;
}

.policy-card-category-badge {
  max-width: 100%;
  padding: 0.1875rem 0.5rem;
  border-radius: 999px;
  background: var(--pm-surface-2);
  border: 1px solid var(--pm-border);
  color: var(--pm-text-2);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.policy-card-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--pm-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.policy-card-version {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--pm-text-3);
}

.policy-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding-top: 0.75rem;
  margin-bottom: 0.875rem;
  border-top: 1px solid var(--pm-border);
}

.policy-card-info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--pm-text-2);
  min-width: 0;
}

.policy-card-info-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.policy-card-info-icon {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  color: var(--pm-text-3);
}

.policy-card-info-item.is-overdue,
.policy-card-info-item.is-overdue .policy-card-info-icon {
  color: var(--pm-danger);
  font-weight: 600;
}

.policy-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

.policy-action-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-radius: var(--pm-radius-sm);
  border: 1px solid var(--pm-border-strong);
  background: var(--pm-surface);
  color: var(--pm-text-2);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.policy-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.policy-btn-view {
  flex: 1;
  background: var(--pm-primary);
  border-color: var(--pm-primary);
  color: #fff;
}

.policy-btn-view:hover {
  background: var(--pm-primary-dark);
  border-color: var(--pm-primary-dark);
}

.policy-btn-download,
.policy-btn-edit,
.policy-btn-delete {
  width: 38px;
  flex-shrink: 0;
  padding: 0;
}

.policy-btn-download:hover:not(:disabled) { background: var(--pm-success-soft); border-color: var(--pm-success); color: var(--pm-success); }
.policy-btn-edit:hover                    { background: var(--pm-warning-soft); border-color: var(--pm-warning); color: var(--pm-warning); }
.policy-btn-delete:hover                  { background: var(--pm-danger-soft);  border-color: var(--pm-danger);  color: var(--pm-danger); }

/* ---------- List view ---------- */
.policy-list-container {
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  box-shadow: var(--pm-shadow-sm);
  overflow: hidden;
  margin-bottom: 1rem;
}

.policy-list-header {
  display: none;
}

.policy-list-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem 1rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--pm-border);
  transition: background 0.15s;
}

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

.policy-list-item:hover {
  background: var(--pm-surface-2);
}

.policy-list-cell {
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--pm-text-2);
}

.policy-list-title-cell,
.policy-list-actions-cell {
  grid-column: 1 / -1;
}

.policy-list-item .policy-list-cell[data-label]::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 0.125rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--pm-text-3);
}

.policy-list-title-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.policy-list-icon {
  flex-shrink: 0;
  color: var(--pm-primary);
}

.policy-list-title {
  flex: 1 1 160px;
  min-width: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--pm-text);
}

.policy-list-version {
  padding: 0.125rem 0.4375rem;
  border-radius: 6px;
  background: var(--pm-surface-2);
  border: 1px solid var(--pm-border);
  color: var(--pm-text-2);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.policy-list-category {
  display: inline-block;
  max-width: 100%;
  padding: 0.1875rem 0.5rem;
  border-radius: 999px;
  background: var(--pm-surface-2);
  border: 1px solid var(--pm-border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pm-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.policy-list-date,
.policy-list-updatedby {
  font-size: 0.8125rem;
  color: var(--pm-text-2);
}

.policy-list-date.overdue {
  color: var(--pm-danger);
  font-weight: 600;
}

.policy-list-actions {
  display: flex;
  gap: 0.375rem;
}

.policy-list-action-btn {
  flex: 1;
  height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--pm-radius-sm);
  border: 1px solid var(--pm-border-strong);
  background: var(--pm-surface);
  color: var(--pm-text-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.policy-list-action-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.policy-list-view-btn:hover     { background: var(--pm-primary-soft);  border-color: var(--pm-primary); color: var(--pm-primary); }
.policy-list-download-btn:hover:not(:disabled) { background: var(--pm-success-soft); border-color: var(--pm-success); color: var(--pm-success); }
.policy-list-edit-btn:hover     { background: var(--pm-warning-soft);  border-color: var(--pm-warning); color: var(--pm-warning); }
.policy-list-delete-btn:hover   { background: var(--pm-danger-soft);   border-color: var(--pm-danger);  color: var(--pm-danger); }

/* ---------- Pagination ---------- */
.policy-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.5rem 0 0;
}

.policy-pagination-info {
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--pm-text-3);
}

.policy-pagination-numbers {
  display: flex;
  gap: 0.25rem;
}

.policy-pagination-btn,
.policy-pagination-number {
  height: 36px;
  border-radius: var(--pm-radius-sm);
  border: 1px solid var(--pm-border-strong);
  background: var(--pm-surface);
  color: var(--pm-text);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.policy-pagination-btn { padding: 0 0.875rem; }

.policy-pagination-number {
  min-width: 36px;
  padding: 0 0.5rem;
}

.policy-pagination-btn:hover:not(:disabled),
.policy-pagination-number:hover {
  border-color: var(--pm-primary);
  color: var(--pm-primary);
}

.policy-pagination-number.active {
  background: var(--pm-primary);
  border-color: var(--pm-primary);
  color: #fff;
}

.policy-pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Modals ---------- */
.policy-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.policy-modal {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--pm-surface);
  border-radius: var(--pm-radius-lg) var(--pm-radius-lg) 0 0;
  box-shadow: var(--pm-shadow-lg);
  animation: policy-modal-in 0.2s ease-out;
}

@keyframes policy-modal-in {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.policy-modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--pm-surface);
  border-bottom: 1px solid var(--pm-border);
}

.policy-modal-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--pm-text);
}

.policy-modal-close,
.policy-viewer-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--pm-radius-sm);
  background: var(--pm-surface-2);
  color: var(--pm-text-2);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.policy-modal-close:hover,
.policy-viewer-close:hover {
  background: var(--pm-border);
  color: var(--pm-text);
}

.policy-form {
  padding: 1.25rem;
}

.policy-form-group {
  margin-bottom: 1rem;
  min-width: 0;
}

.policy-form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pm-text);
}

.policy-form-group input,
.policy-form-group select {
  width: 100%;
  min-height: 42px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--pm-border-strong);
  border-radius: var(--pm-radius-sm);
  background: var(--pm-surface);
  color: var(--pm-text);
  font-size: 16px; /* prevents iOS zoom on focus */
  transition: border-color 0.15s, box-shadow 0.15s;
}

.policy-form-group input[type="file"] {
  padding: 0.5rem;
  font-size: 0.8125rem;
  background: var(--pm-surface-2);
}

.policy-form-group input:focus,
.policy-form-group select:focus {
  outline: none;
  border-color: var(--pm-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.policy-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.policy-form-hint {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  color: var(--pm-text-3);
}

.policy-form-actions,
.policy-confirm-actions {
  display: flex;
  gap: 0.625rem;
  margin-top: 1.25rem;
}

.policy-btn-cancel,
.policy-btn-submit,
.policy-btn-delete-confirm {
  flex: 1;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--pm-radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.policy-btn-cancel {
  background: var(--pm-surface);
  border: 1px solid var(--pm-border-strong);
  color: var(--pm-text-2);
}

.policy-btn-cancel:hover:not(:disabled) {
  background: var(--pm-surface-2);
}

.policy-btn-submit {
  background: var(--pm-primary);
  border: 1px solid var(--pm-primary);
  color: #fff;
}

.policy-btn-submit:hover:not(:disabled) {
  background: var(--pm-primary-dark);
}

.policy-btn-submit:disabled,
.policy-btn-cancel:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Delete confirmation */
.policy-confirm-modal {
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 1.5rem;
  background: var(--pm-surface);
  border-radius: var(--pm-radius-lg);
  box-shadow: var(--pm-shadow-lg);
  text-align: center;
  animation: policy-modal-in 0.2s ease-out;
}

.policy-confirm-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--pm-danger-soft);
  color: var(--pm-danger);
}

.policy-confirm-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.policy-confirm-message {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: var(--pm-text-2);
}

.policy-btn-delete-confirm {
  background: var(--pm-danger);
  border: 1px solid var(--pm-danger);
  color: #fff;
}

.policy-btn-delete-confirm:hover {
  background: #a61f1f;
}

/* ---------- PDF viewer modal ---------- */
.policy-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(10, 14, 25, 0.88);
}

.policy-viewer {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  max-width: 1100px;
  overflow: hidden;
  background: var(--pm-surface);
}

.policy-viewer-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: var(--pm-surface);
  border-bottom: 1px solid var(--pm-border);
}

.policy-viewer-header h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--pm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.policy-viewer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.policy-viewer-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #525659;
}

.policy-pdf-loading,
.policy-pdf-error {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  color: #d4d8de;
}

.policy-pdf-error svg,
.pdf-viewer-error svg {
  color: #f87171;
}

.pdf-viewer-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #525659;
}

.pdf-viewer-toolbar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.5rem 0.75rem;
  background: #323639;
  color: #fff;
}

.pdf-toolbar-nav,
.pdf-toolbar-zoom {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.pdf-toolbar-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.pdf-toolbar-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.22); }
.pdf-toolbar-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.pdf-page-info,
.pdf-zoom-level {
  min-width: 56px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #e8e8e8;
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.pdf-file-name {
  margin-left: auto;
  max-width: 220px;
  font-size: 0.75rem;
  color: #aab0b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-canvas-container {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0.75rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.pdf-canvas {
  display: block;
  max-width: none;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  transition: opacity 0.15s ease;
}

.pdf-initial-loading,
.pdf-viewer-error {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2.5rem 1rem;
  text-align: center;
  color: #d4d8de;
}

/* ---------- Toasts ---------- */
.policy-toast-container {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.policy-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-left: 4px solid;
  border-radius: var(--pm-radius-sm);
  box-shadow: var(--pm-shadow-lg);
  animation: policy-toast-in 0.25s ease-out;
}

@keyframes policy-toast-in {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.policy-toast-success { border-left-color: var(--pm-success); }
.policy-toast-error   { border-left-color: var(--pm-danger); }
.policy-toast-warning { border-left-color: var(--pm-warning); }

.policy-toast-icon {
  flex-shrink: 0;
  display: flex;
}

.policy-toast-success .policy-toast-icon { color: var(--pm-success); }
.policy-toast-error   .policy-toast-icon { color: var(--pm-danger); }
.policy-toast-warning .policy-toast-icon { color: var(--pm-warning); }

.policy-toast-message {
  flex: 1;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pm-text);
}

.policy-toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--pm-text-3);
  cursor: pointer;
}

.policy-toast-close:hover {
  background: var(--pm-surface-2);
  color: var(--pm-text);
}

/* ==========================================================================
   Breakpoints
   ========================================================================== */

/* Small phones */
@media (max-width: 380px) {
  .policy-stat-card { padding: 0.5rem; gap: 0.375rem; }
  .policy-stat-icon { display: none; }
  .pdf-file-name { display: none; }
}

@media (max-width: 575px) {
  .pdf-file-name { display: none; }
}

/* ≥ 576px */
@media (min-width: 576px) {
  .policy-header,
  .policy-toolbar { padding-left: 1.25rem; padding-right: 1.25rem; }
  .policy-content-wrapper { padding-left: 1.25rem; padding-right: 1.25rem; }

  .policy-toolbar {
    grid-template-columns: 1fr auto;
  }

  .policy-toolbar-actions {
    grid-template-columns: repeat(2, auto);
    justify-content: end;
  }

  .policy-pagination-info { width: auto; margin-right: auto; text-align: left; }

  .policy-modal-overlay { align-items: center; padding: 1rem; }
  .policy-modal { border-radius: var(--pm-radius-lg); }

  .policy-toast-container { left: auto; width: 360px; top: 1rem; right: 1rem; }

  .policy-viewer-overlay { padding: 1rem; }
  .policy-viewer { height: 94vh; align-self: center; border-radius: var(--pm-radius-lg); }
  .policy-viewer-header h2 { font-size: 1.0625rem; }
}

/* ≥ 768px */
@media (min-width: 768px) {
  .policy-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.25rem;
  }

  .policy-stats { min-width: 440px; }

  .policy-title { font-size: 1.5rem; }

  .policy-toolbar {
    grid-template-columns: minmax(200px, 1fr) minmax(160px, 220px) auto auto;
    align-items: center;
  }

  .policy-search { grid-column: auto; }
  .policy-toolbar-actions { grid-column: auto; }

  .policy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

  .policy-form-row { grid-template-columns: 1fr 1fr; gap: 0.875rem; }

  /* List → table */
  .policy-list-header,
  .policy-list-item {
    display: grid;
    grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(112px, auto);
    align-items: center;
    gap: 0 1rem;
  }

  .policy-list-header {
    padding: 0.625rem 1rem;
    background: var(--pm-surface-2);
    border-bottom: 1px solid var(--pm-border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--pm-text-3);
  }

  .policy-list-item { padding: 0.75rem 1rem; }

  .policy-list-title-cell,
  .policy-list-actions-cell { grid-column: auto; }

  .policy-list-item .policy-list-cell[data-label]::before { display: none; }

  .policy-list-actions { justify-content: flex-end; }
  .policy-list-action-btn { flex: 0 0 auto; width: 36px; }
  .policy-list-title { flex: 1 1 auto; }
}

/* ≥ 992px */
@media (min-width: 992px) {
  .policy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .policy-header,
  .policy-toolbar,
  .policy-content-wrapper { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* ≥ 1280px */
@media (min-width: 1280px) {
  .policy-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .policy-container *,
  .policy-modal,
  .policy-confirm-modal,
  .policy-toast {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}/* ═══════════════════════════════════════════════
   Training / availability card
   ═══════════════════════════════════════════════ */
.HourGroupCalls .DayPlanEventCard {
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
}

.DayPlanEventCard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin: 6px 0;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

/* coloured accent bar on the left */
.DayPlanEventCard::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}

.DayPlanEventCard .EventIcon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.DayPlanEventCard .EventBody {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.DayPlanEventCard .EventTitle {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.DayPlanEventCard .EventLabel {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.DayPlanEventCard .EventMeta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.DayPlanEventCard .EventTime {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.DayPlanEventCard .EventDuration {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}

/* ── Training (warm brown, matches the Daily Rota bar) ── */
.DayPlanEventCard.is-training {
  background: linear-gradient(90deg, #fbf1e6 0%, #ffffff 70%);
  border-color: #e3c9a8;
}
.DayPlanEventCard.is-training::before { background: #a97a4a; }
.DayPlanEventCard.is-training .EventIcon { background: #f1dcc3; color: #7a4f22; }
.DayPlanEventCard.is-training .EventLabel { color: #a97a4a; }
.DayPlanEventCard.is-training .EventDuration { background: #f1dcc3; color: #7a4f22; }

/* ── Other unavailability (grey) ── */
.DayPlanEventCard.is-unavailable {
  background: linear-gradient(90deg, #f3f4f6 0%, #ffffff 70%);
  border-color: #d1d5db;
}
.DayPlanEventCard.is-unavailable::before { background: #6b7280; }
.DayPlanEventCard.is-unavailable .EventIcon { background: #e5e7eb; color: #374151; }
.DayPlanEventCard.is-unavailable .EventLabel { color: #6b7280; }
.DayPlanEventCard.is-unavailable .EventDuration { background: #e5e7eb; color: #374151; }

/* ── Phones: stack the time under the title ── */
@media (max-width: 520px) {
  .DayPlanEventCard { padding: 10px 12px; gap: 10px; }
  .DayPlanEventCard .EventIcon { width: 34px; height: 34px; border-radius: 10px; }
  .DayPlanEventCard .EventTitle { font-size: 13px; white-space: normal; }
  .DayPlanEventCard .EventTime { font-size: 12px; }
}

/* ═══════════════════════════════════════════════
   Colour key (the plain "Break Training Day off Overtime" text)
   ═══════════════════════════════════════════════ */
.TodayCallsLegend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 12px; color: #4b5563; }
.TodayCallsLegendItem { display: inline-flex; align-items: center; gap: 6px; }
.TodayCallsSwatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.TodayCallsSwatch.is-break { border: 1px solid #e0a800; background-image: repeating-linear-gradient(-45deg, #f5be28 0, #f5be28 3px, #fff3c4 3px, #fff3c4 6px); }
.TodayCallsSwatch.is-training { background: #e9d5c0; border: 1px dashed #a97a4a; }
.TodayCallsSwatch.is-dayoff { background: #2aa198; }
.TodayCallsSwatch.is-overtime { background: #c427ac; }
/* ============================================
   TODAY CALLS STYLES
   ============================================ */
   /* ═══════════════════════════════════════════════════════════
   ⚡ MY DAY PLAN — status banner, break cards, training chips
═══════════════════════════════════════════════════════════ */
/* Break card sitting inside the hourly timeline (spaced like a call card) */
.BreakCardInTimeline {
  margin: 8px 0;
}

/* Training calls get a blue accent edge so they stand out in time order */
.CallCard.is-training {
  box-shadow: inset 3px 0 0 #1d4ed8;
}
.TodayCallsDayPlan {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 0;
}

.DayPlanBanner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.DayPlanBanner.is-holiday  { background: linear-gradient(135deg, #f59e0b, #d97706); }
.DayPlanBanner.is-dayoff   { background: linear-gradient(135deg, #0d9488, #0f766e); }
.DayPlanBanner.is-overtime { background: linear-gradient(135deg, #b903a1, #910778); }
.DayPlanReason { font-weight: 500; opacity: 0.92; }

.DayPlanChips { display: flex; flex-wrap: wrap; gap: 6px; }
.DayPlanChip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fff7e6;
  color: #92400e;
  border: 1px solid #f3d08f;
}
.DayPlanChip.is-ok { background: #e7f6ee; color: #157347; border-color: #b7e2c9; }
.DayPlanChip.is-training { background: #e8f1ff; color: #1d4ed8; border-color: #bcd3fb; }
.DayPlanChip.is-training-pending { background: #f1e9fb; color: #6d28d9; border-color: #d9c6f4; }

.DayPlanBreaks { display: flex; flex-direction: column; gap: 6px; }
.DayPlanBreakCard {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #f59e0b;
  background: repeating-linear-gradient(45deg, #fff7e6 0 8px, #fde68a 8px 16px);
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 700;
}
.DayPlanBreakCard .BreakLabel { letter-spacing: 0.03em; }
.DayPlanBreakCard .BreakTime { margin-left: auto; font-weight: 600; color: #a15c07; }

.TrainingBadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid #bcd3fb;
}
.TodayCallsContainer {
  --tc-navy: #002060;
  --tc-magenta: #e820da;
  --tc-ink: #1b2430;
  --tc-muted: #66728a;
  --tc-line: #e4e8f1;
  --tc-surface: #ffffff;
  --tc-bg: #f3f5fa;
  --tc-teal: #1f8a7c;

  margin: 0 auto;
  padding: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--tc-bg);
  color: var(--tc-ink);
  min-height: 100vh;
}

/* ============================================
   LOCATION CONFIRM MODAL
   ============================================ */
.locationConfirmOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.location_modalCloseBtn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #a4aeaa;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.location_modalCloseBtn:hover {
  background: #ff4d4d;
  color: white;
}

.locationConfirmBox {
  background: rgb(236, 236, 236);
  padding: 20px;
  border-radius: 14px;
  width: 420px;
  max-width: 95%;
  position: relative;
}

.locationConfirmBox textarea {
  width: 100%;
  height: 100px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.locationConfirmBox h3 {
  margin-bottom: 10px;
  padding: 10px;
  color: #e92323;
}

.confirmButtons {
  display: flex;
  justify-content: flex-end;
  gap: 60px;
  margin-top: 10px;
}

.cancelBtn {
  background: #ccc;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
}

.confirmBtn {
  background: #ff6b00;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
}

/* ============================================
   DATE HEADER
   ============================================ */
.TodayCallsHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--tc-magenta) 50%, var(--tc-navy) 50%);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 10px rgba(0, 32, 96, 0.18);
}

.TodayCallsHeaderLeft {
  flex: 1;
}

.TodayCallsTitles {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.01em;
}

.TodayCallsHeaderRight {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: right;
}

.TodayCallsCurrentTime {
  font-size: 12px;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.TodayCallsHeaderRefreshBtn {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.TodayCallsHeaderRefreshBtn:hover {
  background-color: rgba(255, 255, 255, 0.35);
}

.TodayCallsHeaderRefreshBtn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.TodayCallsError {
  background-color: #fdecee;
  color: #8a1c28;
  border: 1px solid #f5c2c8;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
}

/* ============================================
   HOUR GROUPS
   ============================================ */
.TodayCallsHourGroups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.HourGroup {
  background: transparent;
}

.HourGroupHeader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 8px;
  background: none;
  border: none;
  color: var(--tc-navy);
}

.HourLabel {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

/* thin line that runs between the hour and the call count */
.HourGroupHeader::after {
  content: "";
  order: 2;
  flex: 1;
  height: 1px;
  background: var(--tc-line);
}

.CallCount {
  order: 3;
  font-size: 11px;
  font-weight: 600;
  color: var(--tc-muted);
  background: #e6eaf4;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.HourGroupCalls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0;
  margin: 0;
  background: transparent;
}

/* ============================================
   CALL CARD
   ============================================ */
.CallCard {
  --status: #8fa5fc;

  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--tc-surface);
  color: var(--tc-ink);
  border-radius: 14px;
  border: 1px solid var(--tc-line);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.07);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* status accent bar (colour comes from the call status in the component) */
.CallCard::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: var(--status);
}

.CallCard:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(16, 24, 40, 0.12);
}

.CallCard.double-call {
  border-color: #f0b8ec;
}

.CallCard.has-medication {
  border-left: 1px solid var(--tc-line);
}

.CallCardHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 16px;
  background: color-mix(in srgb, var(--status) 16%, #ffffff);
  border-bottom: 1px solid var(--tc-line);
}

.CallTypeGroup {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.CallType {
  font-size: 14px;
  font-weight: 800;
  color: var(--tc-ink);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.DoubleBadge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fbe8f9;
  color: #a3139a;
  border: 1px solid #f1b8ec;
  font-size: 10.5px;
  font-weight: 700;
}

.CallTime {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--tc-ink);
}

.TimeRange {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.Duration {
  font-size: 11px;
  font-weight: 600;
  color: var(--tc-muted);
  background: rgba(255, 255, 255, 0.75);
  padding: 1px 7px;
  border-radius: 999px;
}

.CallCardBody {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 10px 12px 10px 16px;
  background: transparent;
}

/* ---- client row: avatar + name + badge ---- */
.ClientRow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ClientAvatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #dfe7f7, #f3dcf1);
  color: var(--tc-navy);
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--status, #8fa5fc);
  user-select: none;
}

.ClientAvatarImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.Name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--tc-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.Postcode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--tc-muted);
}

.Postcode svg {
  flex: 0 0 auto;
}

.MedicationBadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #b42318;
  background: #fdecea;
  border: 1px solid #f7c6c0;
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: auto;
}

/* ---- address ---- */
.Address {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--tc-muted);
  min-width: 0;
}

.Address svg {
  flex: 0 0 auto;
}

.Address span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- footer: carers + action ---- */
.CardFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--tc-line);
}

.CarerInfo {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  padding: 0;
  background: none;
  font-size: 12px;
  color: var(--tc-muted);
}

.CarerInfo svg {
  flex: 0 0 auto;
}

.CarerLabel {
  font-weight: 600;
}

.CarerNames {
  font-weight: 600;
  color: var(--tc-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.CheckInOutButtons {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
  margin-left: auto;
  padding: 0;
  width: auto;
}

.CheckInBtn,
.CheckOutBtn,
.VisitCompleteBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 108px;
  max-width: 220px;
  padding: 7px 14px;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.CheckInBtn.enabled {
  background-color: var(--tc-teal);
  color: #ffffff;
}

.CheckInBtn.enabled:hover:not(:disabled) {
  background-color: #197266;
  transform: translateY(-1px);
}

/* not yet available: soft outline instead of a washed-out fill */
.CheckInBtn.enabled.readonly {
  background-color: #eaf5f3;
  color: var(--tc-teal);
  box-shadow: inset 0 0 0 1px #b9dcd6;
}

.CheckInBtn:disabled {
  cursor: not-allowed;
}

.CheckInBtn.disabled {
  background-color: #eef0f5;
  color: #8a94a8;
  cursor: not-allowed;
}

.CheckOutBtn {
  background-color: #f2560d;
  color: #ffffff;
}

.CheckOutBtn:hover:not(:disabled) {
  background-color: #d9480a;
  transform: translateY(-1px);
}

.CheckOutBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.VisitCompleteBtn {
  background-color: #e6f4ea;
  color: #1a6b32;
  box-shadow: inset 0 0 0 1px #b5dcc1;
  font-size: 12px;
  cursor: default;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */
.TodayCallsLoader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
}

.TodayCallsSpinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: TodayCallsSpin 1s linear infinite;
}

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

.TodayCallsEmpty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 16px;
}

.scroll-y {
  overflow-y: auto;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (min-width: 768px) {
  .HourGroupCalls {
    grid-template-columns: repeat(2, 1fr);
  }

  .TodayCallsContainer {
    padding: 20px;
  }
}

@media (min-width: 1024px) {
  .HourGroupCalls {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 380px) {
  .Name {
    font-size: 15px;
  }

  .MedicationBadge {
    font-size: 10px;
    padding: 3px 6px;
  }

  .CheckInBtn,
  .CheckOutBtn,
  .VisitCompleteBtn {
    min-width: 92px;
    padding: 7px 10px;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.CallCard:focus-visible,
.CheckInBtn:focus-visible,
.CheckOutBtn:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================
   CALL SUMMARY (unchanged)
   ============================================ */
.SummaryControls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 8px;
}

.DateRangeSelector {
  display: flex;
  gap: 15px;
}

.DateRangeSelector label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.DateRangeSelector input {
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.ViewModeSelector {
  display: flex;
  gap: 10px;
}

.ViewModeSelector button {
  padding: 8px 15px;
  border: 1px solid #ddd;
  background-color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.ViewModeSelector button.active {
  background-color: #4a6fdc;
  color: white;
  border-color: #4a6fdc;
}

.SummaryOverallTotals {
  margin-bottom: 30px;
}

.SummaryOverallTotals h2 {
  margin-bottom: 15px;
  color: #333;
}

.OverallTotalsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
}

.TotalCallsCard,
.DurationCategoryCard {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.TotalCallsCard h3,
.DurationCategoryCard h3 {
  margin: 0 0 10px 0;
  font-size: 12px;
  color: #666;
}

.TotalCallsNumber,
.DurationCategoryNumber {
  font-size: 14px;
  font-weight: bold;
  color: #279035;
}

.SummaryDetails {
  margin-top: 30px;
}

.SummaryDetails h2 {
  margin-bottom: 15px;
  color: #333;
}

.SummaryTableContainer {
  overflow-x: auto;
}

.SummaryTable {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.SummaryTable th,
.SummaryTable td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
}

.SummaryTable th {
  background-color: #f5f5f5;
  font-weight: 600;
  color: #333;
}

.SummaryTable tr:nth-child(even) {
  background-color: #f9f9f9;
}

.SummaryTable tr:hover {
  background-color: #f0f0f0;
}

.DayOfWeek {
  font-size: 12px;
  color: #666;
}

.TodayCallsHeaderSummaryBtn {
  background-color: #4a6edc4a;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 4px 10px;
  margin-right: 10px;
  border: 1px solid rgb(103, 140, 183);
  cursor: pointer;
  font-size: 11px;
}/* ============================================================
   FloatingChat.css — Floating Training Hub Button
   Critical rules:
   • overflow:visible on .fc-fab so the badge at top:-10px
     right:-10px is not clipped by the border-radius:50%
   • isolation:isolate creates a stacking context so the badge
     z-index is resolved independently of parent z-indexes
   ============================================================ */

/* ── FAB ─────────────────────────────────────────────────── */
.fc-fab {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 99999;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;

  /* CRITICAL — badge sits outside the circle; this prevents clipping */
  overflow: visible;

  /* Own stacking context so badge z-index always wins */
  isolation: isolate;

  box-shadow:
    0 4px 14px rgba(233, 30, 140, 0.45),
    0 1px 3px  rgba(0, 0, 0, 0.12);

  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;

  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.fc-fab:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 20px rgba(233, 30, 140, 0.55),
    0 2px 6px  rgba(0, 0, 0, 0.15);
}

.fc-fab:active {
  transform: scale(0.94);
}

/* ── Red count badge ─────────────────────────────────────── */
.fc-fab__badge {
  position: absolute;
  top:   -10px;
  right: -10px;

  /* Must be above the pulse ring and button face */
  z-index: 100000;

  background: #ff2020;
  color: #ffffff;

  font-size: 11px;
  font-weight: 800;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.3px;
  line-height: 1;

  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  padding: 0 5px;

  display: flex;
  align-items: center;
  justify-content: center;

  /* White ring so it pops against the pink button */
  border: 2.5px solid #ffffff;

  box-shadow:
    0 2px 8px  rgba(255, 32, 32, 0.65),
    0 0   0 1px rgba(255, 32, 32, 0.15);

  /* Pop-in on mount */
  animation: fc-badge-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;

  pointer-events: none;
  user-select: none;
}

@keyframes fc-badge-pop {
  0%   { transform: scale(0) rotate(-12deg); opacity: 0; }
  65%  { transform: scale(1.25) rotate(4deg); }
  100% { transform: scale(1)   rotate(0deg); opacity: 1; }
}

/* ── Pulse ring (only when badge is absent) ──────────────── */
.fc-fab__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(233, 30, 140, 0.4);
  animation: fc-pulse 2s ease-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes fc-pulse {
  0%   { transform: scale(1);    opacity: 0.7; }
  100% { transform: scale(1.55); opacity: 0;   }
}

/* ── Tooltip ─────────────────────────────────────────────── */
.fc-tooltip {
  position: fixed;
  bottom: 86px;
  left: 20px;
  z-index: 99998;

    background: linear-gradient(135deg, #E820DA 50%, #002060 50%);

  color: #ffffff;

  padding: 10px 14px;
  border-radius: 10px;
  max-width: 220px;

  display: flex;
  flex-direction: column;
  gap: 4px;

  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;

  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  animation: fc-tooltip-in 0.25s ease-out both;
  pointer-events: none;
}

.fc-tooltip-title {
  font-size: 13px;
  font-weight: 600;
}

.fc-tooltip-sub {
  font-size: 11px;
  font-weight: 700;
  color: #ff9ec4;
}

/* Arrow pointing down toward the button */
.fc-tooltip-arrow {
  position: absolute;
  bottom: -6px;
  left: 26px;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, #E820DA 50%, #002060 50%);
  transform: rotate(45deg);
  border-radius: 2px;
}

@keyframes fc-tooltip-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .fc-fab {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }

  .fc-fab__badge {
    min-width: 20px;
    height: 20px;
    font-size: 10px;
    top:   -8px;
    right: -8px;
    border-radius: 10px;
  }

  .fc-tooltip {
    bottom: 80px;
    right: 16px;
    font-size: 12px;
    padding: 8px 12px;
    max-width: 200px;
  }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .fc-fab        { transition: none; }
  .fc-fab__pulse { animation: none; }
  .fc-fab__badge { animation: none; }
  .fc-tooltip    { animation: none; }
}/* KPI Statistics Dashboard - Enhanced Mobile-First Responsive CSS */

/* Container */
.KPI-container {
  /* display: flex; */
  /* flex-direction: column; */
  background-color: #f3f4f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header */
.KPI-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.KPI-header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.KPI-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.KPI-icon-large {
  width: 24px;
  height: 24px;
  color: #3b82f6;
  stroke-width: 2;
}

.KPI-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.KPI-header-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* View Toggle */
.KPI-view-toggle {
  display: flex;
  gap: 4px;
  background-color: #f3f4f6;
  padding: 4px;
  border-radius: 8px;
}

.KPI-toggle-btn {
  padding: 8px 16px;
  border: none;
  background-color: transparent;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.KPI-toggle-active {
  background-color: #ffffff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Select Dropdowns */
.KPI-select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: #ffffff;
  color: #111827;
  font-size: 14px;
  cursor: pointer;
  min-width: 120px;
  transition: border-color 0.2s;
}

.KPI-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.KPI-export-btn {
  background-color: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
  font-weight: 500;
}

/* Main Content */
.KPI-main {
  flex: 1;
  width: 100%;
  margin: 0 auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Stats Cards Grid - Inspired by HR Section */
.KPI-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.KPI-stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.KPI-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Stats Card Icon */
.KPI-stat-icon {
  width: 25px;
  height: 25px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.KPI-stat-icon svg {
  width: 15px;
  height: 15px;
  color: white;
  stroke-width: 2;
}

.KPI-stat-icon.total-calls {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.KPI-stat-icon.completed {
  background: linear-gradient(135deg, #10b981, #059669);
}

.KPI-stat-icon.disabled {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.KPI-stat-icon.livein {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.KPI-stat-icon.total-time {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

/* Stats Card Content */
.KPI-stat-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
}

.KPI-stat-content h3 {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  margin: 0 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.KPI-stat-number {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 2px 0;
  line-height: 1;
}

.KPI-stat-desc {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

/* Content Card - Removed max-height to allow full-page scrolling */
.KPI-content-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.KPI-content-header {
  padding: 5px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.KPI-content-title {
  font-size: 14px;
  font-weight: 400;
  color: #111827;
  margin: 2px;
}

.KPI-content-desc {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* Removed overflow and flex constraints to allow natural page scrolling */
.KPI-content-body {
  display: flex;
  flex-direction: column;
}

/* Loading State */
.KPI-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 12px;
  padding: 40px;
}

.KPI-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: KPI-spin 0.8s linear infinite;
}

@keyframes KPI-spin {
  to {
    transform: rotate(360deg);
  }
}

.KPI-loading-text {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* Error State */
.KPI-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  padding: 40px;
}

.KPI-error-title {
  font-size: 18px;
  font-weight: 600;
  color: #ef4444;
  margin: 0 0 8px 0;
}

.KPI-error-text {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* Pagination Top Bar */
.KPI-pagination-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
  gap: 12px;
  background-color: #f9fafb;
  flex-shrink: 0;
}

.KPI-pagination-info {
  font-size: 14px;
  color: #4b5563;
  font-weight: 500;
}

.KPI-entries-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6b7280;
}

.KPI-entries-select {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: #ffffff;
  color: #111827;
  font-size: 14px;
  cursor: pointer;
}

.KPI-entries-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Table Wrapper - Removed max-height and overflow-y to allow full-page scrolling */
.KPI-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 350px;
}

/* Table */
.KPI-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1000px;
}

.KPI-table-header-row {
  background-color: #f9fafb;
}
.KPI-heads {
  position: sticky;
  top: 0; /* Sticks to the top of the scroll container */
  z-index: 2; /* Keeps it above table rows */
}
/* Apply sticky to each table header cell */
.KPI-table-header,
.KPI-table-subheader {
  position: sticky;
  top: 0;
  z-index: 3; /* stays above body rows */
  background-color: #f9fafb; /* prevents bleed-through */
}

/* For the second header row (subheaders), push them below the first row */
.KPI-table-subheader {
  top: 40px; /* adjust based on your first row height */
  background-color: #f3f4f6;
  z-index: 2;
}

/* Keep table scrollable */
.table-container {
  max-height: 400px; /* set the height you want */
  overflow-y: auto;
  overflow-x: auto; /* optional for horizontal scroll */
}

.KPI-table-header {
  padding: 5px;
  text-align: center;
  font-weight: 400;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
  background-color: #f9fafb; /* Must have a background, otherwise it looks transparent */
}

.KPI-table-group {
  border-left: 1px solid #d1d5db;
}

.KPI-table-subheader-row {
  background-color: #f3f4f6;
}

.KPI-table-subheader {
  padding: 10px 8px;
  text-align: center;
  font-weight: 500;
  color: #6b7280;
  font-size: 12px;
  border-bottom: 1px solid #e5e7eb;
  background-color: #f3f4f6;
}

.KPI-table-row {
  transition: background-color 0.2s;
}

.KPI-table-row:hover {
  background-color: #f9fafb;
}

.KPI-table-row-today {
  background-color: #ecfdf5;
}

.KPI-table-row-today:hover {
  background-color: #d1fae5;
}

.KPI-table-cell {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  font-size: 13px;
}

.KPI-table-date {
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
  position: sticky;
  left: 0;
  background-color: #ffffff;
  z-index: 5;
}

.KPI-table-row:hover .KPI-table-date {
  background-color: #f9fafb;
}

.KPI-table-row-today .KPI-table-date {
  background-color: #ecfdf5;
}

.KPI-table-row-today:hover .KPI-table-date {
  background-color: #d1fae5;
}

.KPI-cell-total {
  background-color: #eff6ff;
}

.KPI-cell-completed {
  background-color: #f0fdf4;
}

.KPI-cell-disabled {
  background-color: #fffbeb;
}

.KPI-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px;
  background-color: #10b981;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
}

/* Pagination Section - Inspired by HR Section */
.KPI-pagination-section {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 5px;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
  gap: 10px;
  flex-shrink: 0;
}

.KPI-pagination-info-desktop,
.KPI-pagination-info-mobile {
  font-size: 14px;
  color: #4b5563;
  font-weight: 500;
}

.KPI-pagination-info-desktop {
  display: none;
}

.KPI-pagination-info-mobile {
  display: block;
}

/* Pagination Navigation - Cleaner HR-style buttons */
.KPI-pagination-nav {
  position: relative;
  z-index: 0;
  display: inline-flex;
  border-radius: 6px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.KPI-pagination-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  transition: all 0.2s ease-in-out;
  outline: none;
  cursor: pointer;
  min-width: 40px;
}

.KPI-pagination-button:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.KPI-pagination-button:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.KPI-pagination-button:not(:first-child) {
  margin-left: -1px;
}

.KPI-pagination-button:hover:not(:disabled) {
  background-color: #f9fafb;
  transform: translateY(-1px);
}

.KPI-pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.KPI-pagination-button.active {
  z-index: 10;
  background-color: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

/* Chart Container Styles */
.KPI-charts-container {
  display: flex;
  flex-direction: row;
  gap: 5px;
  padding: 5px;
  /* Add these for scrolling */
  overflow-y: auto; /* Enables vertical scrolling */
  max-height: 60vh; /* Or set a specific height like 500px */
}

.KPI-chart-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.KPI-chart-title {
  font-size: 14px;
  font-weight: 400;
  color: #111827;
  margin: 10px;
}

/* Chart Action Buttons */
.KPI-chart-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.KPI-chart-action-btn:hover {
  background-color: #2563eb !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.KPI-btn-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
}

/* Individual Chart Download Buttons */
.KPI-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.KPI-chart-download-btn {
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.KPI-chart-download-btn:hover {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.KPI-chart-download-btn:hover svg {
  stroke: white;
}

.KPI-chart-download-btn svg {
  stroke: #6b7280;
  transition: stroke 0.2s ease;
}

/* Trends Tab Styles */
/* Trends Container */
.kpi-trends-container {
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding: 5px;
}

/* Trends Grid - Growth Indicators */
.kpi-trends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.kpi-trend-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.kpi-trend-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.kpi-trend-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.kpi-trend-icon {
  width: 20px;
  height: 20px;
  color: #3b82f6;
  stroke-width: 2;
}

.kpi-trend-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  margin: 0;
}

.kpi-trend-value {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
  line-height: 1;
}

.kpi-trend-unit {
  font-size: 14px;
  font-weight: 400;
  color: #64748b;
  margin-left: 4px;
}

.kpi-trend-change {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.kpi-trend-change.positive {
  color: #10b981;
}

.kpi-trend-change.negative {
  color: #ef4444;
}

.kpi-trend-arrow {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.kpi-trend-label {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
  margin-left: 4px;
}

/* Trends Charts Section */
.kpi-trends-charts {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Period Comparison Section */
.kpi-comparison-section {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
}

.kpi-comparison-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 20px 0;
}

.kpi-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.kpi-comparison-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}

.kpi-comparison-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.kpi-comparison-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kpi-comparison-value {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.kpi-comparison-period {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
}

.kpi-comparison-number {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

.kpi-comparison-arrow {
  font-size: 24px;
  color: #3b82f6;
  font-weight: 600;
}

/* Tablet Styles (768px and up) */
@media (min-width: 768px) {
  .KPI-header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
  }

  .KPI-title {
    font-size: 22px;
  }

  .KPI-stats-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .KPI-main {
    padding: 10px;
    gap: 4px;
  }

  .KPI-table {
    font-size: 14px;
  }

  .KPI-table-cell {
    font-size: 14px;
  }

  .KPI-pagination-section {
    flex-direction: row;
  }

  .KPI-pagination-info-desktop {
    display: block;
  }

  .KPI-pagination-info-mobile {
    display: none;
  }

  .KPI-charts-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .KPI-chart-card:last-child {
    grid-column: 1 / -1;
  }

  .KPI-stat-number {
    font-size: 28px;
  }

  .kpi-trends-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-trends-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-trends-charts .kpi-chart-card:last-child {
    grid-column: 1 / -1;
  }
}

/* Desktop Styles (1024px and up) */
@media (min-width: 1024px) {
  .KPI-stat-number {
    font-size: 32px;
  }

  .KPI-content-title {
    font-size: 24px;
  }

  .KPI-pagination-button {
    padding: 9px 16px;
  }

  .kpi-trends-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Large Desktop (1280px and up) */
@media (min-width: 1280px) {
  .KPI-main {
    padding: 10px;
  }
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .KPI-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .KPI-stat-card {
    padding: 12px;
    gap: 8px;
  }

  .KPI-stat-icon {
    width: 40px;
    height: 40px;
  }

  .KPI-stat-icon svg {
    width: 20px;
    height: 20px;
  }

  .KPI-stat-number {
    font-size: 20px;
  }

  .KPI-stat-content h3 {
    font-size: 10px;
  }

  .kpi-trends-grid {
    grid-template-columns: 1fr;
  }

  .kpi-trend-value {
    font-size: 28px;
  }

  .kpi-comparison-values {
    flex-direction: column;
    align-items: stretch;
  }

  .kpi-comparison-arrow {
    transform: rotate(90deg);
    align-self: center;
  }
}

/* Print Styles */
@media print {
  .KPI-header-controls,
  .KPI-view-toggle,
  .KPI-pagination-section,
  .KPI-pagination-top,
  .KPI-chart-download-btn {
    display: none !important;
  }

  .KPI-table {
    font-size: 10px;
  }

  .KPI-table-cell {
    padding: 6px 4px;
  }

  .KPI-charts-container {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .KPI-chart-card {
    page-break-inside: avoid;
    margin-bottom: 30px;
    box-shadow: none;
  }

  .chart-section {
    page-break-inside: avoid;
  }
}

/* Scrollbar Styling - Only for horizontal table scroll */
.KPI-table-wrapper::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.KPI-table-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 5px;
}

.KPI-table-wrapper::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

.KPI-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Firefox scrollbar */
.KPI-table-wrapper {
  scrollbar-width: thin;
  scrollbar-color: #888 #f1f1f1;
}
/* Full Page Layout */
.Scheduling-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  color: #333;
}

/* Top Navigation Bar */
.Scheduling-topNav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: linear-gradient(135deg, #6a4c93 0%, #8e6bb1 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  flex-shrink: 0;
  position: sticky;
  top: 0;
}

.Scheduling-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.Scheduling-logo h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.Scheduling-mobileMenuToggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.Scheduling-navItems {
  display: flex;
  gap: 8px;
}

.Scheduling-navItem {
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
}

.Scheduling-navItem:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.Scheduling-navItem-active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.Scheduling-userProfile {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.Scheduling-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Main Container */
.Scheduling-mainContainer {
  display: flex;
  min-height: calc(100vh - 64px);
  width: 100%;
  overflow: hidden;
}

/* Sidebar */
.Scheduling-sidebar {
  width: 280px;
  background: white;
  border-right: 1px solid #e0e6ed;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  max-height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
}

.Scheduling-sidebarSection {
  padding: 12px;
  border-bottom: 1px solid #e0e6ed;
  margin-bottom: 20px;
}

.Scheduling-sidebarSection h3 {
  margin: 0 0 16px 0;
  font-size: 12px;
  text-transform: uppercase;
  color: #8898aa;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Period Selector */
.Scheduling-periodSelector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.Scheduling-periodButton {
  padding: 10px;
  background: linear-gradient(135deg, #c923be 20%, #973390 100%);  
  border: 1px solid #e0e6ed;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #eaebf0;
  transition: all 0.2s ease;
}

.Scheduling-periodButton:hover {
  background: #525f7f;
}

.Scheduling-periodButton-active {
  background: #6a4c93;
  color: white;
  border-color: #6a4c93;
}

/* Date Range */
.Scheduling-dateRange {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Export Buttons */
.Scheduling-exportButton {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #c923be 20%, #973390 100%);
  border: 1px solid #e0e6ed;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #f3f4f7;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.Scheduling-exportButton:hover {
  background: #0e2946;
}

.Scheduling-exportButton:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.Scheduling-exportButton-email {
  background: linear-gradient(135deg, #c923be 20%, #973390 100%);
  color: white;
  border: none;
  font-weight: 600;
}

.Scheduling-exportButton-email:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6a3d8c 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.Scheduling-exportButton-email:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Stat Cards */
.Scheduling-statCard {
  background: #f4f5f7;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.Scheduling-statNumber {
  font-size: 24px;
  font-weight: 700;
  color: #32325d;
}

.Scheduling-statLabel {
  font-size: 12px;
  color: #8898aa;
  margin-top: 4px;
}

/* Main Content */
.Scheduling-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(95vh - 60px);
  padding: 12px 16px;
  width: calc(100% - 280px);
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 16px;
  padding-bottom: 60px;
}

.Scheduling-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-shrink: 0;
  gap: 12px;
}

.Scheduling-headerLeft {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.Scheduling-title {
  font-size: 20px;
  font-weight: 600;
  color: #32325d;
  margin: 0;
}

.Scheduling-dateRangeDisplay {
  font-size: 12px;
  color: #8898aa;
  background: #f4f5f7;
  padding: 4px 8px;
  border-radius: 16px;
  display: inline-block;
}

.Scheduling-headerRight {
  display: flex;
  gap: 12px;
}

/* Search */
.Scheduling-searchContainer {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid #e0e6ed;
  border-radius: 6px;
  overflow: hidden;
}

.Scheduling-searchInput {
  padding: 10px 16px;
  border: none;
  outline: none;
  font-size: 14px;
  width: 250px;
}

.Scheduling-searchButton {
  padding: 10px;
  background: #f4f5f7;
  border: none;
  cursor: pointer;
  font-size: 16px;
}

/* Alert */
.Scheduling-alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
  animation: slideDown 0.3s ease;
}

.Scheduling-alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tab Navigation */
.Scheduling-tabNavigation {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e0e6ed;
  flex-shrink: 0;
  overflow-x: auto;
}

.Scheduling-tab {
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: #8898aa;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.Scheduling-tab:hover {
  color: #525f7f;
}

.Scheduling-tab-active {
  color: #6a4c93;
  border-bottom-color: #6a4c93;
}

/* Tab Content */
.Scheduling-tabContent {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
}

/* Overview Cards */
.Scheduling-overview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.Scheduling-cardsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  width: 100%;
}

.Scheduling-overviewCard {
  background: white;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-left: 3px solid #6a4c93;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.Scheduling-overviewCard:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.Scheduling-cardHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.Scheduling-cardIcon {
  font-size: 24px;
}

.Scheduling-cardCount {
  font-size: 20px;
  font-weight: 700;
  color: #32325d;
}

.Scheduling-cardTitle {
  font-size: 12px;
  font-weight: 600;
  color: #525f7f;
  margin: 0 0 6px 0;
}

.Scheduling-cardPreview {
  font-size: 13px;
  color: #8898aa;
}

.Scheduling-previewItem {
  padding: 4px 0;
}

.Scheduling-moreIndicator {
  font-style: italic;
  margin-top: 8px;
}

/* Form Section */
.Scheduling-formSection {
  background: white;
  border-radius: 6px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.Scheduling-sectionTitle {
  font-size: 16px;
  font-weight: 600;
  color: #32325d;
  margin: 0 0 12px 0;
}

.Scheduling-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.Scheduling-formRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.Scheduling-formGroup {
  display: flex;
  flex-direction: column;
}

.Scheduling-label {
  margin-bottom: 4px;
  font-weight: 500;
  color: #525f7f;
  font-size: 11px;
}

.Scheduling-input, .Scheduling-select, .Scheduling-textarea {
  padding: 6px 10px;
  border: 1px solid #e0e6ed;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.2s ease;
  background: white;
}

.Scheduling-input:focus, .Scheduling-select:focus, .Scheduling-textarea:focus {
  border-color: #6a4c93;
  outline: none;
  box-shadow: 0 0 0 3px rgba(106, 76, 147, 0.1);
}

.Scheduling-textarea {
  resize: vertical;
  min-height: 50px;
}

.Scheduling-formActions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* Buttons */
.Scheduling-button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.Scheduling-button-primary {
  background: #6a4c93;
  color: white;
}

.Scheduling-button-primary:hover {
  background: #5a3d83;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(106, 76, 147, 0.3);
}

.Scheduling-button-secondary {
  background: #f4f5f7;
  color: #525f7f;
}

.Scheduling-button-secondary:hover {
  background: #e9ecef;
}

.Scheduling-button:disabled {
  background: #e9ecef;
  color: #8898aa;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Events Section */
.Scheduling-eventsSection {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.Scheduling-eventCategory {
  background: white;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.Scheduling-categoryTitle {
  font-size: 14px;
  font-weight: 600;
  color: #32325d;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Table */
.Scheduling-tableContainer {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 6px;
  border: 1px solid #e0e6ed;
  width: 100%;
}

.Scheduling-eventTable {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.Scheduling-eventTable th, .Scheduling-eventTable td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid #e0e6ed;
  font-size: 11px;
}

.Scheduling-eventTable th {
  background: #f4f5f7;
  font-weight: 600;
  color: #525f7f;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.Scheduling-eventTable tbody tr {
  transition: background-color 0.2s ease;
}

.Scheduling-eventTable tbody tr:hover {
  background: #f8f9fa;
}

.Scheduling-eventTable tbody tr:last-child td {
  border-bottom: none;
}

.Scheduling-actionButton {
  padding: 6px 12px;
  margin-right: 8px;
  border: 1px solid #e0e6ed;
  background: white;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.Scheduling-actionButton:hover {
  background: #f4f5f7;
}

.Scheduling-actionButton-danger {
  color: #f5365c;
  border-color: #f5365c;
}

.Scheduling-actionButton-danger:hover {
  background: #f5365c;
  color: white;
}

/* No Events */
.Scheduling-noEvents {
  text-align: center;
  padding: 20px 10px;
  color: #8898aa;
  font-size: 12px;
}

.Scheduling-noEventsIcon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* No Event Recorder */
.Scheduling-noEventRecorder {
  margin-bottom: 16px;
}

.Scheduling-noEventCard {
  background: linear-gradient(135deg, #f0f8f4 0%, #e8f5f0 100%);
  border-radius: 8px;
  padding: 14px;
  border-left: 4px solid #4CAF50;
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.1);
}

.Scheduling-noEventHeader {
  margin-bottom: 12px;
}

.Scheduling-noEventTitle {
  font-size: 14px;
  font-weight: 600;
  color: #2e7d32;
  margin: 0 0 4px 0;
}

.Scheduling-noEventDescription {
  font-size: 11px;
  color: #558b2f;
  margin: 0;
  line-height: 1.4;
}

.Scheduling-noEventForm {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.Scheduling-noEventForm .Scheduling-formGroup {
  flex: 1;
  margin-bottom: 0;
}

.Scheduling-noEventForm .Scheduling-input {
  width: 100%;
  min-width: 150px;
}

.Scheduling-noEventButton {
  flex-shrink: 0;
  background: #4CAF50;
  padding: 6px 14px;
}

.Scheduling-noEventButton:hover {
  background: #45a049;
}

.Scheduling-noEventsList {
  border-top: 1px solid rgba(76, 175, 80, 0.2);
  padding-top: 10px;
}

.Scheduling-noEventsListTitle {
  font-size: 11px;
  font-weight: 600;
  color: #2e7d32;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.Scheduling-noEventItems {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.Scheduling-noEventItem {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.6);
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 10px;
}

.Scheduling-noEventDate {
  color: #558b2f;
  font-weight: 500;
}

.Scheduling-noEventAddedBy {
  color: #7cb342;
}

/* Email Report Modal */
.Scheduling-modalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.Scheduling-modalContent {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 450px;
  width: 90%;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.Scheduling-modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e6ed;
}

.Scheduling-modalHeader h3 {
  font-size: 16px;
  font-weight: 600;
  color: #32325d;
  margin: 0;
}

.Scheduling-modalClose {
  background: none;
  border: none;
  font-size: 28px;
  color: #8898aa;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.Scheduling-modalClose:hover:not(:disabled) {
  color: #32325d;
}

.Scheduling-modalClose:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.Scheduling-modalBody {
  padding: 20px;
}

.Scheduling-modalBody p {
  font-size: 14px;
  color: #525f7f;
  margin: 0 0 12px 0;
}

.Scheduling-emailInput {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e0e6ed;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.Scheduling-emailInput:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.Scheduling-emailInput:disabled {
  background: #f4f5f7;
  color: #8898aa;
  cursor: not-allowed;
}

.Scheduling-modalFooter {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #e0e6ed;
  justify-content: flex-end;
}

.Scheduling-button-secondary {
  background: #f4f5f7;
  color: #525f7f;
}

.Scheduling-button-secondary:hover:not(:disabled) {
  background: #e9ecef;
}

/* Searchable Select Dropdown */
.Scheduling-searchableSelect {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.Scheduling-searchInput {
  padding: 6px 10px;
  border: 1px solid #e0e6ed;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.Scheduling-searchInput:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Scrollbar Styling */
.Scheduling-sidebar::-webkit-scrollbar,
.Scheduling-tabContent::-webkit-scrollbar {
  width: 6px;
}

.Scheduling-sidebar::-webkit-scrollbar-track,
.Scheduling-tabContent::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.Scheduling-sidebar::-webkit-scrollbar-thumb,
.Scheduling-tabContent::-webkit-scrollbar-thumb {
  background: #c1c7cd;
  border-radius: 3px;
}

.Scheduling-sidebar::-webkit-scrollbar-thumb:hover,
.Scheduling-tabContent::-webkit-scrollbar-thumb:hover {
  background: #a8b1ba;
}
/* Archived Events Styles */
.Scheduling-archivedHeader {
  margin-bottom: 20px;
}

.Scheduling-archivedDescription {
  color: #8898aa;
  font-size: 14px;
  margin: 8px 0 0 0;
}

.Scheduling-archivedEventsList {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.Scheduling-archivedEventCard {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid #6c757d;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.Scheduling-archivedEventHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.Scheduling-archivedEventTitle {
  font-size: 16px;
  font-weight: 600;
  color: #32325d;
  margin: 0;
}

.Scheduling-archivedEventDate {
  font-size: 12px;
  color: #8898aa;
  background: #e9ecef;
  padding: 4px 8px;
  border-radius: 12px;
}

.Scheduling-archivedEventDetails {
  margin-bottom: 12px;
}

.Scheduling-archivedEventDetails p {
  margin: 4px 0;
  font-size: 14px;
  color: #525f7f;
}

.Scheduling-archivedEventActions {
  display: flex;
  justify-content: flex-end;
}

.Scheduling-actionButton-restore {
  color: #28a745;
  border-color: #28a745;
}

.Scheduling-actionButton-restore:hover {
  background: #28a745;
  color: white;
}
/* Archived Events Styles */
.Scheduling-archivedHeader {
  margin-bottom: 20px;
}

.Scheduling-archivedDescription {
  color: #8898aa;
  font-size: 14px;
  margin: 8px 0 0 0;
}

.Scheduling-archivedEventsList {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.Scheduling-archivedEventCard {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid #6c757d;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.Scheduling-archivedEventHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.Scheduling-archivedEventTitle {
  font-size: 16px;
  font-weight: 600;
  color: #32325d;
  margin: 0;
}

.Scheduling-archivedEventDate {
  font-size: 12px;
  color: #8898aa;
  background: #e9ecef;
  padding: 4px 8px;
  border-radius: 12px;
}

.Scheduling-archivedEventDetails {
  margin-bottom: 12px;
}

.Scheduling-archivedEventDetails p {
  margin: 4px 0;
  font-size: 14px;
  color: #525f7f;
}

.Scheduling-archivedEventActions {
  display: flex;
  justify-content: flex-end;
}

.Scheduling-actionButton-restore {
  color: #28a745;
  border-color: #28a745;
}

.Scheduling-actionButton-restore:hover {
  background: #28a745;
  color: white;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .Scheduling-cardsGrid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .Scheduling-topNav {
    padding: 0 16px;
    height: 56px;
  }
  
  .Scheduling-logo h1 {
    font-size: 16px;
  }
  
  .Scheduling-mobileMenuToggle {
    display: block;
  }
  
  .Scheduling-navItems {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #6a4c93;
    flex-direction: column;
    padding: 16px;
    transform: translateX(-100%);
    opacity: 0;
    transition: all 0.3s ease;
    overflow-y: auto;
    z-index: 1000;
  }
  
  .Scheduling-navItems-mobile {
    transform: translateX(0);
    opacity: 1;
  }
  
  .Scheduling-sidebar {
    position: fixed;
    left: -280px;
    top: 56px;
    height: calc(100vh - 56px);
    z-index: 999;
    transition: left 0.3s ease;
    width: 280px;
    max-width: 80vw;
  }
  
  .Scheduling-sidebar-mobile {
    left: 0;
  }
  
  .Scheduling-mainContainer {
    min-height: calc(100vh - 56px);
  }
  
  .Scheduling-content {
    padding: 12px;
    width: 100%;
    overflow-y: auto;
  }
  
  .Scheduling-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  
  .Scheduling-title {
    font-size: 22px;
  }
  
  .Scheduling-headerRight {
    width: 100%;
  }
  
  .Scheduling-searchContainer {
    width: 100%;
  }
  
  .Scheduling-searchInput {
    width: 100%;
    flex: 1;
  }
  
  .Scheduling-formRow {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .Scheduling-cardsGrid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .Scheduling-tabNavigation {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px;
  }
  
  .Scheduling-tab {
    padding: 10px 16px;
    font-size: 12px;
  }
  
  .Scheduling-eventTable th,
  .Scheduling-eventTable td {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .Scheduling-overviewCard {
    padding: 16px;
  }
  
  .Scheduling-cardCount {
    font-size: 24px;
  }
  
  .Scheduling-formSection {
    padding: 16px;
  }
  
  .Scheduling-sectionTitle {
    font-size: 18px;
  }
  
  .Scheduling-actionButton {
    padding: 4px 8px;
    font-size: 11px;
    margin-right: 4px;
  }
}

@media (max-width: 480px) {
  .Scheduling-periodSelector {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .Scheduling-tabNavigation {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
  }
  
  .Scheduling-searchInput {
    width: 100%;
  }
  
  .Scheduling-userProfile {
    display: none;
  }
  
  .Scheduling-navItem {
    padding: 12px 16px;
    font-size: 13px;
  }
  
  .Scheduling-title {
    font-size: 18px;
  }
  
  .Scheduling-logo h1 {
    font-size: 14px;
  }
  
  .Scheduling-content {
    padding: 8px;
  }
  
  .Scheduling-cardsGrid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .Scheduling-overviewCard {
    padding: 12px;
  }
  
  .Scheduling-cardTitle {
    font-size: 14px;
  }
  
  .Scheduling-cardCount {
    font-size: 20px;
  }
}/* runs-tab.css */
.runs-tab {
    padding: 20px;
    font-family: Arial, sans-serif;
}

.tbrow th {
    background: #4f6b7a !important;
}

/* One-line layout for header elements */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.tab-navigation {
    display: flex;
    margin-bottom: 0;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    border-bottom: 2px solid #4285f4;
    color: #4285f4;
    font-weight: bold;
}

/* Current Schedule Styles */
.runs-tab-container {
    width: 100%;
}

.runs-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.runs-header h2 {
    margin: 0;
    white-space: nowrap;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    min-width: 250px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 8px 40px 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.date-selector label {
    font-weight: bold;
}

.date-selector input[type="date"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.check-schedule-btn,
.print-btn {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.check-schedule-btn:hover,
.print-btn:hover {
    background-color: #3367d6;
}

.check-schedule-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.schedule-alerts {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.alert {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.loading-indicator,
.error-message {
    text-align: center;
    padding: 20px;
    font-size: 16px;
}

.schedule-table-container {
    overflow-x: auto;
    margin-top: 10px;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
}

.schedule-bottom-border {
    border: 4px solid #ddd;
}

.client-last-row {
    border-bottom: 2.5px solid #acb7c0dc;
}

.client-no-calls-row {
    background: rgba(234, 233, 182, 0.826) !important;
}

.search-results-count {
    font-size: 12px;
    color: #666;
    margin-left: 5px;
}

.no-results-message {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin: 10px 0;
}

.schedule-table th,
.schedule-table td {
    padding: 1px;
    text-align: left;
    border: 1px solid #ddd;
    font-size: 13px;
}

.schedule-table th {
    background: linear-gradient(135deg, #415267, #455568);
    color: white;
    padding-top: 5px;
    padding-bottom: 5px;
}

.package-time-input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.call-category-select {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.status-ok {
    color: green;
    font-size: 18px;
}

.status-warning {
    color: orange;
    font-size: 18px;
}

.status-error {
    color: red;
    font-size: 18px;
}

/* Schedule Assistant Styles */
.schedule-assistant-container {
    width: 100%;
}

.schedule-assistant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.generate-rota-btn {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.generate-rota-btn:hover {
    background-color: #3367d6;
}

.historical-data-container,
.rota-suggestions-container {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.historical-data-table-container {
    overflow-x: auto;
    margin-top: 15px;
}

.historical-data-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
}

.historical-data-table th,
.historical-data-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
}

.historical-data-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.no-data-message,
.suggested-rota-placeholder {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.suggestion-message {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #e7f3fe;
    border-left: 4px solid #2196F3;
}

.api-error-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
}

.api-error-message {
    margin-bottom: 10px;
    font-family: monospace;
    white-space: pre-wrap;
}

.retry-btn {
    background-color: #721c24;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.retry-btn:hover {
    background-color: #5a1925;
}

/* Table row alternating colors */
.schedule-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.schedule-table tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

.schedule-table tbody tr:hover {
    background-color: #e6f7ff;
}

.historical-data-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.historical-data-table tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

.historical-data-table tbody tr:hover {
    background-color: #e6f7ff;
}

.call-category-select {
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.call-category-select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.schedule-table tbody tr[data-double-lock="1"] {
    border-left: 3px solid #ff6b6b;
}

.schedule-table tbody tr[data-double-lock="0"] {
    border-left: 3px solid #51cf66;
}

.carer-names {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #1c5788
}

.carer-name-cell {
    border-right: 2px solid #acb7c0dc !important;
}

.user-emoji {
    font-size: 14px;
}

.no-carer {
    color: #999;
    font-style: italic;
}

.location-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.location-btn:hover {
    background-color: #f0f0f0;
}

.no-location {
    color: #ccc;
}

.location-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.location-modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.location-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.location-modal-header h3 {
    margin: 0;
}

.location-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.location-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.location-map-container {
    margin-bottom: 20px;
}

.location-map {
    width: 100%;
    height: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.location-coords {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.location-info h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.location-full-address {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.location-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.location-detail-item {
    display: flex;
    justify-content: space-between;
}

.location-detail-label {
    font-weight: bold;
    margin-right: 10px;
}

.location-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

.location-modal-button {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.location-modal-button:hover {
    background-color: #3367d6;
}

.location-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.location-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.location-error {
    color: #e74c3c;
    text-align: center;
    padding: 20px;
}

.support-plan-visits {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 5px 0;
}

.support-plan-visit {
    display: flex;
    border-bottom: 1px solid #eee;
    padding-bottom: 1px;
}

.support-plan-visit:last-child {
    border-bottom: none;
}

.visit-type {
    margin-bottom: 3px;
    padding-left: 1px;
    color: #035196;
}

.visit-details {
    display: flex;
    gap: 10px;
    font-size: 0.85em;
}

.visit-length,
.visit-staff,
.visit-time {
    padding: 2px 5px;
    background-color: #f5f5f5;
    border-radius: 3px;
}

.no-support-plan {
    color: #999;
    font-style: italic;
    text-align: center;
}

.support-plan-container {
    width: 100%;
    height: 100%;
}

.support-plan-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    padding: 0;
    font-size: 0.9em;
}

.support-plan-header {
    background-color: #f8f9fa;
    font-weight: bold;
    text-align: left;
    padding: 4px 6px;
    border-bottom: 1px solid #ddd;
    color: #495057;
}

.support-plan-row {
    border-bottom: 1px solid #eee;
}

.support-plan-row:last-child {
    border-bottom: none;
}

.support-plan-cell {
    padding: 4px 6px;
    vertical-align: top;
}

.support-plan-cell.visit-type {
    white-space: nowrap;
}

.support-plan-cell.visit-length,
.support-plan-cell.visit-staff,
.support-plan-cell.visit-time {
    white-space: nowrap;
}

.no-support-plan {
    text-align: center;
    font-style: italic;
    color: #888;
    padding: 8px;
}

/* Print styles - Updated for better table printing */
@media print {
    .no-print {
        display: none !important;
    }

    .runs-tab {
        padding: 5px;
    }

    .header-container,
    .tab-navigation,
    .header-controls,
    .schedule-assistant-header,
    .header-buttons,
    .location-btn,
    .call-category-select {
        display: none !important;
    }

    .runs-tab-container,
    .schedule-assistant-container {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .schedule-table,
    .historical-data-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 10px;
    }

    .schedule-table th,
    .schedule-table td,
    .historical-data-table th,
    .historical-data-table td {
        border: 1px solid #ddd;
        padding: 3px;
        text-align: left;
    }

    .schedule-table-container,
    .historical-data-table-container {
        overflow: visible !important;
    }

    /* Replace emojis with text for printing */
    .status-ok::before {
        content: "OK";
        color: black;
        font-size: 10px;
    }

    .status-warning::before {
        content: "WARNING";
        color: black;
        font-size: 10px;
    }

    .status-error::before {
        content: "ERROR";
        color: black;
        font-size: 10px;
    }

    .user-emoji::before {
        content: "";
    }

    .location-btn::before {
        content: "";
    }

    /* Ensure all data is visible when printing */
    .schedule-table td,
    .historical-data-table td {
        white-space: normal;
        word-wrap: break-word;
    }

    /* Print headers for each page */
    .schedule-table thead {
        display: table-header-group;
    }

    .historical-data-table thead {
        display: table-header-group;
    }

    /* Avoid page breaks inside rows */
    .schedule-table tr,
    .historical-data-table tr {
        page-break-inside: avoid;
    }

    /* Print title and date */
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 10px;
        font-weight: bold;
    }
}

/* Add to your runs-tab.css file */

.schedule-alerts {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    background-color: #f9f9f9;
}

.schedule-alerts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.schedule-alerts-header h3 {
    margin: 0;
}

.email-alerts-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.email-alerts-btn:hover {
    background-color: #45a049;
}



.alert-count-info {
    margin-top: 10px;
    font-style: italic;
    color: #666;
}


.cancel-btn,
.send-email-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.cancel-btn {
    background-color: #f5f5f5;
    color: #333;
}

.cancel-btn:hover {
    background-color: #e0e0e0;
}

.send-email-btn {
    background-color: #4CAF50;
    color: white;
}

.send-email-btn:hover {
    background-color: #45a049;
}

.send-email-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Add to your runs-tab.css file */

.email-status {
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    font-weight: bold;
}

.email-status.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.email-status.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}
/* ========== REVIEW TAB STYLES ========== */
.review-container { padding: 12px; display: flex; flex-direction: column; gap: 12px; }

.review-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 15px; }
.review-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; }
.review-card b { font-size: 20px; color: #111827; }
.review-card span { font-size: 12px; color: #6b7280; }
.review-card-issues b { color: #dc2626; }

.review-signoff { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 12px; font-size: 13px; margin-bottom: 15px; }
.review-signoff-done { background: #ecfdf5; border-color: #a7f3d0; }
.review-signoff-info { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: #065f46; }
.review-signoff-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-notes-input { flex: 1; min-width: 200px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; }
.review-sign-btn { background-color: #4f46e5; color: #fff; border: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; }
.review-sign-btn:disabled { opacity: .6; cursor: not-allowed; }
.review-notes { color: #374151; }

.review-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; margin-bottom: 15px; }
.review-panel h3 { margin: 0 0 10px; font-size: 14px; color: #111827; display: flex; align-items: center; gap: 6px; }
.review-panel-missing { border-color: #fca5a5; background: #fef2f2; }

.review-table-container { overflow-x: auto; }
.review-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 800px; }
.review-table th { text-align: left; padding: 8px; border-bottom: 2px solid #d1d5db; color: #374151; background: #f9fafb; }
.review-table td { padding: 7px 8px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.review-empty { text-align: center; color: #6b7280; padding: 16px; }

.review-ok { color: #16a34a; }
.review-warn { color: #d97706; }
.review-bad { color: #dc2626; }
.review-cell { white-space: nowrap; }
.review-extra-chip { background: #ffedd5; color: #9a3412; border-radius: 10px; padding: 1px 6px; font-size: 10px; font-weight: 700; margin-left: 4px; }
.review-row-issue { background: #fffbeb; }
.review-row-expired { opacity: .55; }

.review-status { border-radius: 10px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.review-status-active { background: #dcfce7; color: #166534; }
.review-status-upcoming { background: #e0e7ff; color: #3730a3; }
.review-status-expired { background: #f3f4f6; color: #6b7280; }

@media (max-width: 900px) { .review-cards { grid-template-columns: repeat(2, 1fr); } }
/* ========== CLIENT ACCORDION (Review tab) ========== */
.review-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.review-panel-head h3 { margin: 0; font-size: 14px; }
.review-panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.review-mini-btn { background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.review-mini-btn:hover { background: #e5e7eb; }
.review-toggle-issues { display: flex; align-items: center; gap: 6px; color: #374151; font-weight: 600; cursor: pointer; }

.review-client-group { border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 8px; overflow: hidden; background: #fff; }
.review-client-group.has-issues { border-color: #fcd34d; }
.review-client-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; background: #f9fafb; border: none; cursor: pointer; text-align: left; font-size: 13px; }
.review-client-head:hover { background: #f3f4f6; }
.review-chevron { color: #6b7280; font-size: 11px; }
.review-client-name { font-weight: 700; color: #1d4ed8; }
.review-client-pc { color: #6b7280; font-size: 12px; }

.review-count-chip { background: #e5e7eb; color: #374151; border-radius: 10px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.chip-ok { background: #dcfce7; color: #166534; }
.chip-warn { background: #fef3c7; color: #92400e; }
.chip-bad { background: #fee2e2; color: #991b1b; }

.review-client-body { border-top: 1px solid #e5e7eb; padding: 10px; background: #fff; }
.review-missing-sub { margin-top: 10px; }
.review-missing-sub h4 { margin: 0 0 6px; font-size: 12px; color: #991b1b; }
.runs-issue-badge {
    background: #dc2626; color: #fff; border-radius: 10px;
    padding: 1px 7px; font-size: 11px; font-weight: 700; margin-left: 6px;
    animation: badge-pulse 2s infinite;
}
@keyframes badge-pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
/* ========== HISTORY BROWSER CARDS ========== */
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 10px; }
.history-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 12px; text-align: left; cursor: pointer; transition: all 0.2s;
    display: flex; flex-direction: column; gap: 8px;
}
.history-card:hover { border-color: #6366f1; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15); transform: translateY(-2px); }
.history-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.history-date-range { font-weight: 700; color: #111827; font-size: 13px; }
.history-card-body { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.history-row { display: flex; justify-content: space-between; }
.history-label { color: #6b7280; }
.history-notes { background: #f3f4f6; border-radius: 6px; padding: 6px 8px; font-size: 11px; color: #374151; font-style: italic; margin-top: 4px; }
.history-card-foot { border-top: 1px solid #e5e7eb; padding-top: 6px; color: #6366f1; font-weight: 600; font-size: 12px; text-align: center; }

/* Clickable history rows in the review panel */
.review-table-clickable tbody tr:hover { background: #eef2ff; }
.review-subtitle { font-size: 12px; color: #6b7280; font-style: italic; }/* GeoLocationTab.css - Updated for Better Map Display and Responsiveness */
.geo-location-tab {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 10px;
    background-color: #f5f5f5;
    box-sizing: border-box;
}

.geo-location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.geo-location-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-selector label {
    font-weight: bold;
}

.date-selector input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.geo-location-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    gap: 10px;
}

/* First Column - Carer List */
.geo-carer-list {
    width: 200px;
    background-color: white;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.geo-carer-list-header {
    padding: 10px;
    background-color: #960284;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.geo-carer-list-header h3 {
    margin: 0;
    color: #faf5f5;
    font-size: 1.1rem;
}

.carer-search-container {
    padding: 10px;
}

.carer-search {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.9rem;
}

.geo-carer-list-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.carer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.carer-item:hover {
    background-color: #f5f5f5;
}

.carer-item.selected {
    background-color: #e0f0ff;
    border-left: 4px solid #fb00ff;
}

.carer-info {
    flex: 1;
}

.carer-name {
    font-weight: bold;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.carer-details {
    font-size: 0.8rem;
    color: #666;
}

.carer-postcode {
    font-size: 0.75rem;
    color: #888;
}

/* Second Column - Calls List */
.calls-container {
    width: 280px;
    background-color: white;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calls-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.calls-header {
    padding: 10px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calls-header h3 {
    margin: 0;
    color: #5a76a2;
    font-size: 1.1rem;
}

.back-button {
    background-color: #215aa0;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8rem;
}

.back-button:hover {
    background-color: #0056b3;
}

.calls-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
}

.call-item {
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #eee;
    border-radius: 6px;
    background-color: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
}

.call-item:hover {
    background-color: #f0f0f0;
    border: 1px solid rgba(7, 145, 204, 0.53);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.call-item.selected {
    background-color: #e0f0ff;
    border: 1px solid #007bff;
}

.call-client {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1rem;
    color: #333;
}

.call-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.call-time {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
}

.call-postcode {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
}

.call-coords {
    font-size: 0.75rem;
    color: #007bff;
    margin-top: 3px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.call-checkin {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    flex-direction: column;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed #eee;
}

.call-checkout {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    flex-direction: column;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed #eee;
}

.bold {
    font-weight: bold;
    font-size: 18px;
    color: #287ade;
}

.location-details {
    align-items: center;
    font-size: 0.75rem;
    color: #6e6e6e;
}

.reverse-geocoded-postcode {
    margin-left: 5px;
    font-weight: 600;
    color: #333;
}

.call-assigned-to {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed #eee;
}

/* Third Column - Map */
.map-container {
    flex: 1;
    background-color: white;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.carer-journey-map-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.map-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.map-legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.legend-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 5px;
    color: white;
}

.journey-map {
    flex: 1;
    width: 100%;
}

.map-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    background-color: #f8f9fa;
}

.map-loading p {
    margin-top: 10px;
    color: #666;
}

.no-map-data {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    background-color: #f8f9fa;
    color: #666;
    font-style: italic;
}

/* Common Elements */
.no-carer-selected {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    background-color: #f0f0f0;
}

.no-carer-selected p {
    font-size: 1.1rem;
    color: #666;
}

.no-calls {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    font-size: 1rem;
    color: #666;
}

.error-message {
    margin-top: 10px;
    padding: 10px 15px;
    background-color: #ffeeee;
    border: 1px solid #ffcccc;
    border-radius: 4px;
    color: #ff0000;
}

/* Map Markers and Arrows */
.journey-number-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.journey-arrow {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #28a745;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    z-index: 999;
}

/* For better popup display */
.leaflet-popup-content-wrapper {
    border-radius: 6px;
}

.leaflet-popup-content {
    margin: 10px;
    line-height: 1.4;
}

.leaflet-popup-content strong {
    color: #333;
}

/* Custom tooltip styling */
.custom-tooltip {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.custom-tooltip::before {
    border-top-color: rgba(0, 0, 0, 0.8);
}

/* Number marker styling */
.number-marker {
    background: transparent !important;
    border: none !important;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .geo-carer-list {
        width: 180px;
    }

    .calls-container {
        width: 250px;
    }
}

@media (max-width: 1200px) {
    .geo-location-content {
        flex-wrap: wrap;
    }

    .geo-carer-list {
        width: 100%;
        max-height: 150px;
    }

    .calls-container {
        width: 100%;
        max-height: 200px;
        margin-bottom: 10px;
    }

    .map-container {
        width: 100%;
        height: 400px;
    }
}

@media (max-width: 768px) {
    .geo-location-tab {
        padding: 5px;
    }

    .geo-location-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .geo-location-header h2 {
        font-size: 1.2rem;
    }

    .map-legend {
        flex-wrap: wrap;
        gap: 5px;
    }

    .legend-item {
        font-size: 0.7rem;
    }

    .map-container {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .geo-location-header h2 {
        font-size: 1rem;
    }

    .map-container {
        height: 300px;
    }

    .calls-list-container {
        padding: 3px;
    }

    .call-item {
        padding: 8px;
        margin-bottom: 5px;
    }

    .call-client {
        font-size: 0.9rem;
    }

    .call-time,
    .call-postcode,
    .call-checkin,
    .call-checkout {
        font-size: 0.75rem;
    }
}

/* Spinner */
.policy-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border-left-color: #09f;
    margin: 20px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}/* ============================================================
   NotificationSection.css — Care Runner
   FIXED: Mobile + desktop scroll · Nudge UX · All sections
   ============================================================ */

/* ─── CSS VARIABLES ───────────────────────────────────────────── */
.ns-wrap {
  --purple:    #002060;
  --purple2:   #002060;
  --grad:      linear-gradient(135deg, #002060 0%, #002060 100%);
  --amber:     #d97706;
  --amber-bg:  #fffbeb;
  --amber-bd:  #fcd34d;
  --amber-dk:  #92400e;
  --green:     #059669;
  --green-bg:  #ecfdf5;
  --red:       #dc2626;
  --red-bg:    #fef2f2;
  --teal:      #0d9488;
  --teal-grad: linear-gradient(135deg, #0d9488, #065f46);
  --tx1:  #1e293b;
  --tx2:  #64748b;
  --tx3:  #94a3b8;
  --bg:   #f1f5f9;
  --bgc:  #ffffff;
  --bgi:  #f8fafc;
  --bd:   #e2e8f0;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --sh:   0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --sh-lg: 0 8px 32px rgba(0,0,0,.14);

  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  width: 100%;
  background: var(--bg);
  color: var(--tx1);
  box-sizing: border-box;
  position: relative;
  /* ★ NEVER restrict height or vertical overflow on the root wrap */
  overflow-x: hidden;
  overflow-y: visible;
  min-height: 100%;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── LOADING ─────────────────────────────────────────────────── */
.ns-loading {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px; min-height: 220px; color: var(--tx2);
}
.ns-spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--bd); border-top-color: var(--purple);
  border-radius: 50%; animation: ns-spin .7s linear infinite;
}
@keyframes ns-spin { to { transform: rotate(360deg); } }

/* ─── PAGE LOADING SPINNER ───────────────────────────────────── */
.ns-page-loading {
  width: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #f1f5f9);
}
.ns-page-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.ns-page-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #f1f5f9;
  border-top-color: #0d9488;
  border-right-color: #d97706;
  animation: ns-spin 0.8s linear infinite;
}
.ns-page-loading-inner p {
  color: #94a3b8;
  font-size: .88rem;
  margin: 0;
}

/* ─── TOP BAR ─────────────────────────────────────────────────── */
.ns-topbar {
  display: flex; align-items: stretch; justify-content: space-between;
  flex-wrap: wrap; gap: 0;
  background: var(--bgc); border-bottom: 1px solid var(--bd);
  position: sticky; top: 0; z-index: 20;
}
.ns-tabs { display: flex; gap: 0; flex: 1; min-width: 0; }
.ns-tab {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding:2px;
  background: none; border: none; border-bottom: 3px solid transparent;
  font-size: .93rem; font-weight: 500; color: var(--tx2);
  cursor: pointer; transition: color .2s, border-color .2s; white-space: nowrap;
  flex: 1;
}
.ns-tab:hover  { color: var(--purple); }
.ns-tab.active { color: var(--purple); border-bottom-color: var(--purple); }

.ns-tbadge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: .68rem; font-weight: 700;
}
.ns-tbadge.reminder { background: var(--teal); }

.ns-topbar-acts {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-left: 1px solid var(--bd);
}
.ns-btn-sm {
  padding: 7px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--bd); background: var(--bgc);
  font-size: .82rem; font-weight: 600; color: var(--tx2); cursor: pointer; transition: all .18s;
  white-space: nowrap;
}
.ns-btn-sm:hover { background: #f0f0ff; border-color: #c7d2fe; color: var(--purple); }
.ns-amber-btn {
  display: flex; align-items: center; gap: 7px; padding: 7px 14px;
  background: var(--amber-bg); border: 1.5px solid var(--amber-bd);
  border-radius: var(--r-sm); color: var(--amber-dk);
  font-size: .83rem; font-weight: 700; cursor: pointer; transition: all .2s; white-space: nowrap;
}
.ns-amber-btn:hover { background: #fef3c7; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(217,119,6,.12); }
.ns-apulse { width: 8px; height: 8px; border-radius: 50%; background: #ef9f27; animation: ns-pulse 1.5s ease-in-out infinite; }
@keyframes ns-pulse { 0%,100%{opacity:1}50%{opacity:.3} }

/* ─── LAYOUT ──────────────────────────────────────────────────── */
.ns-layout {
  display: flex;
  gap: 3px;
  padding: 3px;
  align-items: flex-start;
  /* ★ FIX: No height restriction — let content grow and page scroll */
  width: 100%;
}
.ns-col-form {
  flex: 3;
  min-width: 0;
  /* ★ FIX: No overflow restriction on column */
}
.ns-col-list {
  flex: 2;
  min-width: 0;
}
.ns-full { flex: 1 1 100% !important; }

/* ─── CARD ────────────────────────────────────────────────────── */
/* ★ FIX: overflow:hidden was clipping scroll containers.
   Use overflow:visible so inner scroll areas work correctly. */
.ns-card,
.ns-card-flex {
  background: var(--bgc);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  display: flex;
  flex-direction: column;
  /* ★ CRITICAL: changed from overflow:hidden to overflow:visible
     so inner scrollable containers are not clipped */
  overflow: visible;
  /* Clip the border-radius on the direct children using a pseudo approach */
}
/* Re-apply border-radius clip only to card's own background via ::before */
.ns-card { position: relative; }

/* Keep overflow:hidden only where we need border-radius clipping (the shell) */
.ns-card-shell {
  overflow: hidden;
  border-radius: var(--r-lg);
}

.ns-card-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--bd);
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f0ff 100%);
  flex-shrink: 0;
  /* ★ FIX: Ensure header stays at top */
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.ns-card-hd h2 { font-size: 1.1rem; font-weight: 700; color: var(--tx1); }
.ns-hbadge {
  padding: 3px 12px; border-radius: 20px; background: var(--grad);
  color: #fff; font-size: .76rem; font-weight: 700;
}
.ns-hbadge.reminder { background: var(--teal-grad); }

/* ─── SUB TABS ────────────────────────────────────────────────── */
.ns-sub-tabs {
  display: flex;
  border-bottom: 2px solid var(--bd);
  background: var(--bgc);
  flex-shrink: 0;
  overflow-x: auto;
}
.ns-stab {
  flex: 1;
  padding: 11px 14px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: .88rem;
  font-weight: 600;
  color: var(--tx2);
  cursor: pointer;
  transition: all .18s;
  margin-bottom: -2px;
  white-space: nowrap;
  min-width: 0;
}
.ns-stab:hover  { color: var(--purple); }
.ns-stab.active { color: var(--purple); border-bottom-color: var(--purple); background: #faf8ff; }

/* ─── SUB-TAB BADGE ──────────────────────────────────────────── */
.ns-stab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--purple);
  color: #fff;
  font-size: .64rem;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}
.ns-stab.active .ns-stab-badge {
  background: #fff;
  color: var(--purple);
}

/* ─── SCROLL CONTAINERS ──────────────────────────────────────── */

/* ★ FIX: Form scroll — natural height on desktop, scrolls internally */
.ns-form-scroll {
  padding: 14px 16px;
  overflow-y: auto;
  /* ★ FIX: Use a more generous height so the Send button is always reachable */
  max-height: calc(90vh - 140px);
  scrollbar-width: thin;
  scrollbar-color: var(--bd) transparent;
  margin-bottom: 12px;
  padding-bottom: 12px;
}
.ns-form-scroll::-webkit-scrollbar { width: 5px; }
.ns-form-scroll::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 4px; }

/* ★ FIX: List scroll — proper height with fallback */
.ns-list-scroll {
  padding: 14px 16px;
  overflow-y: auto;
  /* ★ FIX: Generous height — was calc(100vh - 310px) which was too small */
  max-height: calc(100vh - 240px);
  min-height: 220px;
  scrollbar-width: thin;
  scrollbar-color: var(--bd) transparent;
}
.ns-list-scroll::-webkit-scrollbar { width: 5px; }
.ns-list-scroll::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 4px; }

/* ─── DATE FILTER BAR ────────────────────────────────────────── */
.ns-filter-bar {
  padding: 8px 14px 6px;
  border-bottom: 1px solid var(--bd);
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-shrink: 0;
  background: var(--bgc);
}
.ns-filter-search {
  position: relative; display: flex; align-items: center;
}
.ns-filter-icon { position: absolute; left: 10px; font-size: 13px; pointer-events: none; }
.ns-filter-search input {
  width: 100%; padding: 8px 32px;
  border: 1.5px solid var(--bd); border-radius: var(--r-sm);
  font-size: .88rem; background: var(--bgi); color: var(--tx1); font-family: inherit;
  transition: border-color .2s;
}
.ns-filter-search input:focus { outline: none; border-color: var(--purple); background: #fff; }
.ns-filter-search input::placeholder { color: var(--tx3); }
.ns-filter-clear {
  position: absolute; right: 9px; background: none; border: none;
  font-size: 1rem; cursor: pointer; color: var(--tx3); line-height: 1;
}
.ns-filter-clear:hover { color: var(--tx1); }

.ns-filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.ns-fpill {
  padding: 5px 13px; border-radius: 20px; font-size: .78rem; font-weight: 600;
  border: 1.5px solid var(--bd); background: var(--bgi); color: var(--tx2);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.ns-fpill:hover  { background: #f0f0ff; border-color: #c7d2fe; color: var(--purple); }
.ns-fpill.active { background: var(--grad); border-color: transparent; color: #fff; }

/* ─── CUSTOM DATE SELECTORS ──────────────────────────────────── */
.ns-date-selectors {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  padding: 10px 14px; background: #f8f9ff;
  border: 1.5px solid #c7d2fe; border-radius: var(--r-md);
  animation: ns-fi .15s ease;
}
@keyframes ns-fi { from{opacity:0}to{opacity:1} }
.ns-date-sel-group {
  display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 100px;
}
.ns-date-sel-group label {
  font-size: .75rem; font-weight: 700; color: var(--tx2);
  text-transform: uppercase; letter-spacing: .04em;
}
.ns-date-sel {
  padding: 8px 10px;
  border: 1.5px solid var(--bd); border-radius: var(--r-sm);
  font-size: .88rem; font-family: inherit; color: var(--tx1);
  background: #fff; cursor: pointer;
  transition: border-color .2s;
}
.ns-date-sel:focus { outline: none; border-color: var(--purple); }
.ns-date-sel:disabled { opacity: .45; cursor: not-allowed; background: var(--bgi); }

/* ─── SEARCH INPUT ───────────────────────────────────────────── */
.ns-search-in {
  margin-bottom: 10px !important;
  padding-left: 34px !important;
}

/* ─── TYPE ROW ────────────────────────────────────────────────── */
.ns-type-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 10px; }
.ns-type-btn {
  display: flex; flex-direction: row; align-items: center; gap: 5px; justify-content: center;
  padding: 2px; background: var(--bgi); border: 2px solid var(--bd);
  border-radius: var(--r-md); cursor: pointer; font-size: .86rem; font-weight: 500;
  color: var(--tx2); transition: all .18s;
}
.ns-type-btn:hover  { background: #f0f0ff; border-color: #c7d2fe; color: var(--purple); }
.ns-type-btn.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(102,126,234,.3); }
.ns-type-icon { font-size: 0.88rem; }

/* ─── RECIPIENT SELECTOR ──────────────────────────────────────── */
.ns-recip { margin-bottom: 20px; }
.ns-sec-lbl {
  font-size: .78rem; font-weight: 700; color: var(--tx2);
  text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 7px;
}
.ns-chips-scroll {
  display: flex; flex-direction: column; gap: 7px;
  max-height: 200px; overflow-y: auto; padding: 3px 2px;
  scrollbar-width: thin; scrollbar-color: var(--bd) transparent;
}
.ns-chips-scroll::-webkit-scrollbar { width: 4px; }
.ns-chips-scroll::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 4px; }
.ns-chips-grid {
  display: grid; grid-template-columns: repeat(2,1fr); gap: 7px;
  max-height: 200px; overflow-y: auto; padding: 2px;
  scrollbar-width: thin; scrollbar-color: var(--bd) transparent;
}
.ns-chips-grid::-webkit-scrollbar { width: 4px; }
.ns-chips-grid::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 4px; }
.ns-no-results { font-size: .84rem; color: var(--tx3); padding: 10px; text-align: center; }
.ns-chip {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  background: var(--bgi); border: 1.5px solid var(--bd);
  border-radius: var(--r-sm); cursor: pointer; transition: all .15s;
  user-select: none;
}
.ns-chip:hover { background: #f0f0ff; border-color: #c7d2fe; }
.ns-chip.on    { background: linear-gradient(135deg,#f5e8ff,#ede0ff); border-color: var(--purple); box-shadow: 0 0 0 2px rgba(201,35,190,.12); }
.ns-chip:focus { outline: 2px solid var(--purple); outline-offset: 2px; }
.ns-chip-av {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700;
}
.ns-chip-av.grp { background: linear-gradient(135deg,#48bb78,#38a169); }
.ns-chip-img  { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ns-chip-tick {
  width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0;
  border: 2px solid var(--bd); background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 900; color: transparent; transition: all .15s;
}
.ns-chip.on .ns-chip-tick { background: var(--purple); border-color: var(--purple); color: #fff; }
.ns-chip-name { display: block; font-weight: 600; color: var(--tx1); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-chip-role { display: block; font-size: .7rem; color: var(--tx3); }
.ns-online    { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-left: auto; }
.ns-online.on  { background: #22c55e; }
.ns-online.off { background: var(--bd); }
.ns-selct { text-align: right; font-size: .8rem; font-weight: 600; color: var(--purple); margin-top: 6px; }
.ns-company-info {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  background: #eff6ff; border-left: 4px solid var(--purple);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: .88rem; color: #1e40af; font-weight: 500; margin-bottom: 20px;
}

/* ─── FORM ELEMENTS ───────────────────────────────────────────── */
.ns-fg             { margin-bottom: 12px; position: relative; }
.ns-fg label       { display: block; font-size: .85rem; font-weight: 600; color: var(--tx1); margin-bottom: 4px; }
.ns-req            { color: #dc2626; margin-left: 2px; }
.ns-input, .ns-textarea, .ns-select {
  width: 100%; padding: 10px 13px;
  background: var(--bgi); border: 2px solid var(--bd); border-radius: var(--r-sm);
  font-family: inherit; font-size: .93rem; color: var(--tx1);
  transition: border-color .2s, box-shadow .2s;
}
.ns-input:focus, .ns-textarea:focus, .ns-select:focus {
  outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(102,126,234,.1); background: #fff;
}
.ns-input::placeholder, .ns-textarea::placeholder { color: var(--tx3); }
.ns-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.ns-cc { position: absolute; bottom: -17px; right: 0; font-size: .72rem; color: var(--tx3); }
.ns-select { cursor: pointer; }
.ns-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ns-checks   { display: flex; flex-direction: column; gap: 9px; margin-bottom: 6px; }

/* ─── CUSTOM CHECKBOX ROW ────────────────────────────────────── */
.ns-ack-check-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 14px; background: #f8f9ff;
  border: 1.5px solid #c7d2fe; border-radius: var(--r-sm);
  cursor: pointer; transition: all .15s; user-select: none; margin-bottom: 4px;
}
.ns-ack-check-row:hover { background: #f0e8ff; border-color: var(--purple); }
.ns-ack-check-row.amber-row { background: var(--amber-bg); border-color: var(--amber-bd); }
.ns-ack-check-row.amber-row:hover { background: #fef3c7; }
.ns-ack-check-row.sm {
  padding: 8px 12px; background: var(--bgi); border-color: var(--bd);
}
.ns-ack-check-row.sm:hover { background: #f0f0ff; border-color: var(--purple); }

.ns-ack-checkbox {
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  border: 2px solid var(--bd); background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 900; color: transparent;
  transition: all .15s; margin-top: 1px;
}
.ns-ack-checkbox.checked { background: var(--purple); border-color: var(--purple); color: #fff; }
.ns-ack-checkbox.amber.checked { background: var(--amber); border-color: var(--amber); color: #fff; }
.ns-ack-checkbox.sm { width: 17px; height: 17px; border-radius: 4px; font-size: .7rem; }
.ns-ack-check-text {
  font-size: .86rem; font-weight: 500; color: var(--tx1); line-height: 1.5; flex: 1;
}

/* ─── SEND BUTTON ─────────────────────────────────────────────── */
.ns-send-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px; margin-top: 18px;
  background: var(--grad); border: none; border-radius: var(--r-md);
  color: #fff; font-size: .97rem; font-weight: 700; cursor: pointer;
  transition: all .22s; box-shadow: 0 4px 14px rgba(102,126,234,.38);
}
.ns-send-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102,126,234,.48); }

/* ─── NOTIFICATION & REMINDER CARDS ──────────────────────────── */
.ns-ncard {
  position: relative; padding: 10px 12px;
  border: 1.5px solid var(--bd); border-radius: var(--r-md);
  background: #fff; margin-bottom: 8px; transition: box-shadow .2s, transform .2s;
}
.ns-ncard:last-child { margin-bottom: 0; }
.ns-ncard:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); transform: translateX(3px); }
.ns-ncard.unread { background: linear-gradient(135deg,#f8f9ff,#f0f4ff); border-color: #c7d2fe; }
.ns-ncard.read   { opacity: .85; }
.ns-ncard.amber  { border-left: 4px solid var(--amber); background: var(--amber-bg); border-radius: 0 var(--r-md) var(--r-md) 0; }
.ns-ncard.system { border-left: 4px solid var(--purple); background: #f8f9ff; border-radius: 0 var(--r-md) var(--r-md) 0; }
.ns-ncard.reminder   { border-left: 4px solid var(--teal); border-radius: 0 var(--r-md) var(--r-md) 0; }
.ns-ncard.emergency  { border-left: 4px solid var(--red); border-radius: 0 var(--r-md) var(--r-md) 0; }

.ns-dpulse {
  position: absolute; top: 15px; right: 15px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--purple);
  animation: ns-dp 2s ease-in-out infinite;
}
.ns-dpulse.reminder { background: var(--teal); }
@keyframes ns-dp { 0%,100%{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(1.2)} }

.ns-ncard-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.ns-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .71rem; font-weight: 700; }
.ns-badge.amber      { background: #fef3c7; color: var(--amber-dk); }
.ns-badge.system     { background: #ede9fe; color: #5b21b6; }
.ns-badge.company    { background: #faf5ff; color: #6b21a8; border: 1px solid #ddd6fe; }
.ns-badge.group      { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.ns-badge.individual { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.ns-badge.reminder   { background: #ccfbf1; color: #115e59; border: 1px solid #99f6e4; }
.ns-ntime  { font-size: .75rem; color: var(--tx3); font-weight: 500; }
.ns-sched  { padding: 2px 7px; background: var(--bgi); border: 1px solid var(--bd); border-radius: 20px; font-size: .69rem; color: var(--tx3); }
.ns-ntitle { font-size: .97rem; font-weight: 700; color: var(--tx1); margin-bottom: 4px; line-height: 1.4; }
.ns-nmsg   { font-size: .86rem; color: var(--tx2); line-height: 1.6; margin-bottom: 8px; }
.ns-nmeta  { font-size: .75rem; color: var(--tx3); margin-bottom: 9px; }
.ns-sender-row    { display: flex; align-items: center; gap: 6px; }
.ns-sender-av     { width: 20px; height: 20px; border-radius: 50%; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .6rem; font-weight: 700; flex-shrink: 0; }
.ns-sender-av-img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ns-ack-warn { display: flex; align-items: flex-start; gap: 7px; padding: 8px 11px; background: #fffbeb; border: 1px solid var(--amber-bd); border-radius: var(--r-sm); font-size: .78rem; color: var(--amber-dk); font-weight: 500; margin-bottom: 9px; line-height: 1.5; }
.ns-awi { width: 16px; height: 16px; border-radius: 50%; background: var(--amber); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 900; flex-shrink: 0; margin-top: 1px; }
.ns-acked { font-size: .79rem; font-weight: 700; color: var(--green); background: var(--green-bg); padding: 4px 9px; border-radius: var(--r-sm); margin-bottom: 7px; display: inline-block; }
.ns-nacts { display: flex; flex-wrap: wrap; gap: 7px; }
.ns-act {
  padding: 5px 13px; background: var(--bgi); border: 1px solid var(--bd);
  border-radius: var(--r-sm); font-size: .79rem; font-weight: 600;
  color: var(--tx2); cursor: pointer; transition: all .15s;
}
.ns-act:hover    { background: #f0f0ff; border-color: #c7d2fe; color: var(--purple); }
.ns-act.primary  { background: var(--grad); color: #fff; border-color: transparent; }
.ns-act.primary:hover { opacity: .9; }
.ns-act.amber    { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber-dk); }
.ns-act.amber:hover { background: #fef3c7; border-color: var(--amber); }
.ns-empty { text-align: center; padding: 44px 20px; color: var(--tx3); font-size: .93rem; }

/* ─── UK TIME INLINE LABEL ───────────────────────────────────── */
.ns-time-uk {
  font-size: .7rem; color: var(--tx3); opacity: .8;
}

/* ─── BUTTONS ─────────────────────────────────────────────────── */
.ns-btn {
  padding: 9px 18px; border-radius: var(--r-sm);
  font-size: .88rem; font-weight: 600; cursor: pointer; border: none; transition: all .18s;
}
.ns-btn.primary  { background: var(--grad); color: #fff; }
.ns-btn.primary:hover { opacity: .9; }
.ns-btn.primary:disabled,
.ns-btn.disabled { opacity: .4; cursor: not-allowed; }
.ns-btn.amber    { background: #d97706; color: #fff; }
.ns-btn.amber:hover { background: #b45309; }
.ns-btn.amber:disabled { opacity: .4; cursor: not-allowed; }
.ns-btn.ghost    { background: var(--bgi); border: 1px solid var(--bd); color: var(--tx2); }
.ns-btn.ghost:hover { background: #f1f5f9; }
.ns-btn.outline  { background: transparent; border: 1.5px solid var(--purple); color: var(--purple); }
.ns-btn.outline:hover { background: #eff6ff; }
.ns-btn.full-w   { width: 100%; text-align: center; }
.ns-btn.danger   { background: var(--red); color: #fff; border: none; }
.ns-btn.danger:hover { background: #b91c1c; }
.ns-btn.outline-danger {
  background: transparent; border: 1.5px solid var(--red); color: var(--red);
  padding: 9px 18px; border-radius: var(--r-sm);
  font-size: .88rem; font-weight: 600; cursor: pointer; transition: all .18s;
}
.ns-btn.outline-danger:hover { background: #fef2f2; }

/* ─── SENT NOTIFICATION CARDS ────────────────────────────────── */
.ns-sent-card {
  border-left: 4px solid var(--purple);
  border-radius: 0 var(--r-md) var(--r-md) 0 !important;
}
.ns-sent-card.amber    { border-left-color: var(--amber); }
.ns-sent-card.reminder { border-left-color: var(--teal); }
.ns-sent-card.company  { border-left-color: #973390; }
.ns-sent-card.group    { border-left-color: #38a169; }

/* ─── INLINE MINI STATS ──────────────────────────────────────── */
.ns-sent-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 6px;
  margin: 10px 0 6px;
}
.ns-sent-stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 7px 6px; background: var(--bgi);
  border: 1px solid var(--bd); border-radius: var(--r-sm); text-align: center;
}
.ns-sent-stat.green { background: var(--green-bg); border-color: #bbf7d0; }
.ns-sent-stat.red   { background: var(--red-bg);   border-color: #fca5a5; }
.ns-sent-stat.teal  { background: #ccfbf1;          border-color: #99f6e4; }
.ns-sent-stat-n {
  font-size: 1.35rem; font-weight: 800; color: var(--tx1); line-height: 1;
}
.ns-sent-stat-l {
  font-size: .65rem; font-weight: 600; color: var(--tx2);
  text-transform: uppercase; letter-spacing: .03em; margin-top: 2px;
}

/* ─── READ PROGRESS BAR ──────────────────────────────────────── */
.ns-sent-progress-wrap {
  height: 5px; background: var(--bd); border-radius: 3px;
  overflow: hidden; margin: 6px 0 2px;
}
.ns-sent-progress-bar {
  height: 100%; background: var(--grad); border-radius: 3px;
  transition: width .4s ease; min-width: 2px;
}
.ns-sent-progress-bar.reminder { background: var(--teal-grad); }
.ns-sent-progress-label {
  display: flex; justify-content: space-between;
  font-size: .7rem; color: var(--tx3); margin-bottom: 4px;
}

/* ─── NUDGE INFO BOX ─────────────────────────────────────────── */
.ns-nudge-info {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 12px; background: #fffbeb;
  border: 1px solid var(--amber-bd); border-radius: var(--r-sm);
  font-size: .78rem; color: var(--amber-dk); line-height: 1.5;
  margin: 8px 0 0;
}
.ns-nudge-info-icon {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--amber); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 900; flex-shrink: 0; margin-top: 1px;
}

/* ─── GROUPS PANEL ───────────────────────────────────────────── */
.ns-groups-panel { padding: 4px 0; }
.ns-groups-panel-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.ns-group-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; margin-bottom: 8px;
  background: var(--bgi); border: 1.5px solid var(--bd);
  border-radius: var(--r-md); transition: all .15s;
}
.ns-group-row:hover { border-color: var(--purple); background: #f8f0ff; }
.ns-group-row.amber-group {
  border-left: 4px solid var(--amber); background: var(--amber-bg);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.ns-group-row.amber-group:hover { background: #fef3c7; }
.ns-group-av {
  width: 36px; height: 36px; border-radius: 50%; background: var(--grad);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; flex-shrink: 0;
}
.ns-group-row.amber-group .ns-group-av { background: linear-gradient(135deg, #d97706, #f59e0b); }
.ns-group-info {
  display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0;
}
.ns-group-name { font-weight: 700; font-size: .92rem; color: var(--tx1); }
.ns-group-desc {
  font-size: .78rem; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ns-group-meta { font-size: .72rem; color: var(--tx3); }

/* ─── GROUP MANAGE MODAL — inner tabs ───────────────────────── */
.ns-group-tabs { display: flex; gap: 4px; margin: 0 4px; }
.ns-gtab {
  padding: 5px 14px; border-radius: 20px; font-size: .82rem; font-weight: 600;
  border: 1.5px solid var(--bd); background: var(--bgi); color: var(--tx2);
  cursor: pointer; transition: all .15s;
}
.ns-gtab:hover  { background: #f0f0ff; border-color: var(--purple); color: var(--purple); }
.ns-gtab.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.ns-group-info-meta {
  font-size: .78rem; color: var(--tx3); padding: 8px 12px;
  background: var(--bgi); border-radius: var(--r-sm); margin-bottom: 14px; border: 1px solid var(--bd);
}
.ns-member-row { cursor: default; }
.ns-member-row:hover { background: #f8f0ff; border-color: #c7d2fe; }
.ns-remove-btn {
  width: 26px; height: 26px; border-radius: 50%; background: #fee2e2;
  border: none; color: var(--red); font-size: .82rem; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.ns-remove-btn:hover { background: var(--red); color: #fff; }

/* ─── DELETE CONFIRM BOX ─────────────────────────────────────── */
.ns-del-confirm {
  padding: 14px; background: #fef2f2; border: 1.5px solid #fca5a5;
  border-radius: var(--r-md); margin-top: 12px;
}
.ns-del-confirm p { font-size: .86rem; color: #991b1b; margin-bottom: 12px; line-height: 1.5; }
.ns-del-btns { display: flex; gap: 8px; }

/* ─── OVERLAYS & MODALS ───────────────────────────────────────── */
.ns-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.46);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px; animation: ns-fi .16s ease;
}
.ns-modal {
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  width: 100%; max-width: 500px; max-height: 90vh;
  overflow: hidden; display: flex; flex-direction: column;
  animation: ns-su .2s ease;
}
.ns-modal.wide { max-width: 580px; }
@keyframes ns-su { from{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1} }
.ns-mh {
  padding: 14px 18px; border-bottom: 1px solid var(--bd);
  background: linear-gradient(135deg,#f8f9ff,#f0f4ff);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.ns-mh.amber { background: var(--amber-bg); border-bottom-color: var(--amber-bd); }
.ns-mh h3    { font-size: 1.05rem; font-weight: 700; color: var(--tx1); }
.ns-mh-icon  { font-size: 1.2rem; }
.ns-role-tag { margin-left: auto; font-size: .7rem; font-weight: 700; padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: 20px; }
.ns-close {
  margin-left: auto; background: none; border: none; font-size: 1.35rem;
  cursor: pointer; color: var(--tx3); width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.ns-close:hover { background: var(--bgi); color: var(--tx1); }
.ns-mb {
  padding: 14px 18px; overflow-y: auto; flex: 1;
  scrollbar-width: thin; scrollbar-color: var(--bd) transparent;
}
.ns-mb::-webkit-scrollbar { width: 4px; }
.ns-mb::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 4px; }
.ns-mf {
  padding: 12px 18px; border-top: 1px solid var(--bd);
  display: flex; gap: 8px; justify-content: flex-end;
  flex-shrink: 0; background: var(--bgi);
}
.ns-preview { padding: 11px 14px; background: var(--bgi); border: 1px solid var(--bd); border-radius: var(--r-sm); margin-bottom: 14px; }
.ns-preview strong { display: block; font-size: .93rem; margin-bottom: 3px; }
.ns-preview p { font-size: .85rem; color: var(--tx2); line-height: 1.5; }
.ns-warn-box { display: flex; gap: 10px; padding: 12px 14px; background: #fffbeb; border: 1px solid var(--amber-bd); border-radius: var(--r-sm); margin-bottom: 14px; }
.ns-wi { width: 20px; height: 20px; border-radius: 50%; background: var(--amber); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 900; flex-shrink: 0; margin-top: 2px; }
.ns-warn-box strong { display: block; font-size: .85rem; color: var(--amber-dk); margin-bottom: 3px; }
.ns-warn-box p { font-size: .8rem; color: #92400e; line-height: 1.5; }
.ns-amber-danger { padding: 9px 13px; background: #fee2e2; border: 1px solid #fca5a5; border-radius: var(--r-sm); font-size: .8rem; font-weight: 600; color: #991b1b; margin-bottom: 16px; line-height: 1.4; }
.ns-radio-row { display: flex; gap: 18px; margin-bottom: 10px; }
.ns-radio { display: flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 500; cursor: pointer; }
.ns-radio input { accent-color: var(--purple); }

/* ─── STATS MODAL ────────────────────────────────────────────── */
.ns-stats-sub  { font-size: .87rem; color: var(--tx2); margin-bottom: 14px; font-style: italic; }
.ns-stats-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin-bottom: 18px; }
.ns-stat  { display: flex; flex-direction: column; align-items: center; padding: 13px; background: var(--bgi); border-radius: var(--r-sm); border: 1px solid var(--bd); }
.ns-stat.green { background: var(--green-bg); border-color: #bbf7d0; }
.ns-stat.red   { background: var(--red-bg); border-color: #fca5a5; }
.ns-stat-n { font-size: 1.7rem; font-weight: 800; color: var(--tx1); }
.ns-stat span:last-child { font-size: .74rem; font-weight: 600; color: var(--tx2); text-transform: uppercase; letter-spacing: .04em; }
.ns-stats-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.ns-srow { display: flex; align-items: center; gap: 9px; padding: 9px 13px; background: var(--bgi); border-radius: var(--r-sm); border: 1px solid var(--bd); }
.ns-sav  { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.ns-snm  { flex: 1; font-size: .86rem; font-weight: 600; }
.ns-spills { display: flex; gap: 5px; flex-wrap: wrap; }
.ns-pill { padding: 2px 8px; border-radius: 20px; font-size: .7rem; font-weight: 700; }
.ns-pill.read    { background: var(--green-bg); color: #166534; }
.ns-pill.unread  { background: #fff7ed; color: #9a3412; }
.ns-pill.ack     { background: var(--green-bg); color: #166534; }
.ns-pill.pending { background: var(--red-bg); color: #991b1b; }

/* ─── NUDGE EXPLANATION IN STATS MODAL ──────────────────────── */
.ns-nudge-explain {
  padding: 10px 14px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--r-sm);
  font-size: .78rem;
  color: #0369a1;
  line-height: 1.6;
  margin-bottom: 10px;
}

/* ─── TOAST ───────────────────────────────────────────────────── */
.ns-toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  padding: 11px 22px; border-radius: var(--r-md);
  font-size: .88rem; font-weight: 600; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 2000;
  animation: ns-ti .22s ease, ns-to .28s ease 2.9s forwards;
  max-width: 90vw;
  text-align: center;
}
.ns-toast.success { background: #1e293b; color: #f8fafc; }
.ns-toast.error   { background: #dc2626; color: #fff; }
.ns-toast.amber   { background: #d97706; color: #fff; }
.ns-toast.info    { background: #0369a1; color: #fff; }
@keyframes ns-ti { from{opacity:0;transform:translateX(-50%) translateY(10px)}to{opacity:1;transform:translateX(-50%) translateY(0)} }
@keyframes ns-to { to{opacity:0;transform:translateX(-50%) translateY(10px)} }

/* ─── RESPONSIVE: TABLET (≤1024px) ───────────────────────────── */
@media (max-width: 1024px) {
  /* ★ FIX: Stack columns, allow everything to expand naturally */
  .ns-layout {
    flex-direction: column;
    padding: 3px;
    gap: 3px;
    /* No height restriction — page scrolls */
  }
  .ns-col-form, .ns-col-list, .ns-full {
    width: 100%;
    flex: unset;
  }

  /* ★ FIX: Form expands fully — no scroll container, page handles it */
  .ns-form-scroll {
    max-height: none;
    overflow-y: visible;
    padding: 12px 14px;
  }

  /* ★ FIX: List scroll — reasonable fixed height */
  .ns-list-scroll {
    max-height: 500px;
    min-height: 200px;
    padding: 12px 14px;
  }
}

/* ─── RESPONSIVE: MOBILE (≤768px) ────────────────────────────── */
@media (max-width: 768px) {
  /* ★ FIX: Ensure page can scroll vertically */
  html, body {
    overflow-x: hidden;
    /* Do NOT set overflow-y — let it default to auto/scroll */
  }

  .ns-topbar {
    flex-direction: column; align-items: stretch; padding: 0;
    position: sticky; top: 0; z-index: 20;
  }
  .ns-tabs { border-bottom: 1px solid var(--bd); }
  .ns-tab  { padding: 2px; font-size: .85rem; }
  .ns-topbar-acts {
    border-left: none; border-top: 1px solid var(--bd);
    padding: 8px 12px; justify-content: flex-end; flex-wrap: wrap; gap: 6px;
  }

  .ns-layout  { padding: 3px; gap: 3px; }
  .ns-card-hd { padding: 10px 12px; }
  .ns-filter-bar { padding: 6px 10px 4px; }

  /* ★ FIX: Form fully natural — no scroll clipping on mobile */
  .ns-form-scroll {
    padding: 12px 14px;
    max-height: none;
    overflow-x: visible;
    margin-bottom: 8px;
  }

  /* ★ FIX: List scroll — 65vh is generous enough on mobile */
  .ns-list-scroll {
    max-height: 65vh;
    min-height: 180px;
    padding: 10px 12px;
  }

  .ns-type-row { gap: 6px; }
  .ns-type-btn { padding: 6px; font-size: .8rem; }
  .ns-type-icon { font-size: 1.2rem; }
  .ns-form-row { grid-template-columns: 1fr; }
  .ns-send-btn { padding: 11px 14px; font-size: .9rem; margin-top: 12px; }

  .ns-modal    { max-width: 100%; max-height: 94vh; margin: 0; }
  .ns-mh, .ns-mb { padding: 12px 14px; }
  .ns-mf { padding: 10px 14px; flex-direction: column-reverse; }
  .ns-btn { width: 100%; text-align: center; }

  .ns-stats-grid { grid-template-columns: 1fr 1fr; }
  .ns-sent-stats { grid-template-columns: repeat(2, 1fr); }

  .ns-date-selectors { gap: 8px; }
  .ns-date-sel-group { min-width: 0; flex: 1; }
  .ns-fpill { padding: 4px 10px; font-size: .73rem; }

  .ns-group-row { flex-wrap: wrap; }
  .ns-group-info { min-width: 0; flex: 1; }
  .ns-gtab { padding: 4px 10px; font-size: .78rem; }
  .ns-del-btns { flex-direction: column; }
  .ns-del-btns .ns-btn { width: 100%; text-align: center; }

  .ns-sub-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ns-stab { padding: 10px 10px; font-size: .8rem; white-space: nowrap; }
}

/* ─── RESPONSIVE: SMALL MOBILE (≤480px) ─────────────────────── */
@media (max-width: 480px) {
  .ns-tab    { font-size: .78rem; padding: 2px; }
  .ns-topbar-acts { justify-content: space-between; padding: 6px 10px; }
  .ns-amber-btn   { flex: 1; justify-content: center; font-size: .78rem; }
  .ns-layout  { padding: 3px; gap: 3px; }
  .ns-card-hd { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; }
  .ns-type-row { grid-template-columns: 1fr; gap: 6px; }
  .ns-type-btn { flex-direction: row; justify-content: flex-start; padding: 8px 10px; gap: 8px; }
  .ns-ncard   { padding: 10px 12px; }
  .ns-ntitle  { font-size: .88rem; margin-bottom: 3px; }
  .ns-nmsg    { font-size: .8rem; margin-bottom: 6px; }
  .ns-chips-grid { grid-template-columns: 1fr; }
  .ns-sent-stats { grid-template-columns: repeat(2, 1fr); gap: 5px; }
  .ns-sent-stat-n { font-size: 1.1rem; }
  .ns-sent-stat-l { font-size: .6rem; }
  .ns-stab { padding: 8px 7px; font-size: .74rem; }

  /* Date selectors stack vertically on tiny screens */
  .ns-date-selectors { flex-direction: column; gap: 6px; padding: 8px 10px; }
  .ns-date-sel-group { min-width: unset; width: 100%; }

  .ns-toast {
    left: 10px; right: 10px; transform: none; white-space: normal;
    text-align: center; bottom: 12px; font-size: .85rem;
  }
  @keyframes ns-ti { from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)} }
  @keyframes ns-to { to{opacity:0;transform:translateY(10px)} }

  .ns-filter-pills { gap: 3px; }
  .ns-fpill { padding: 3px 7px; font-size: .68rem; }
  .ns-groups-panel-header { flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 2px; }
  .ns-group-row { padding: 9px 10px; margin-bottom: 6px; }
  .ns-group-av  { width: 28px; height: 28px; font-size: .72rem; }
  .ns-group-name { font-size: .82rem; }
}
/* FeedsScreen.css – professional, compact, responsive. Everything is scoped to .fd-root */

.fd-root {
  --fd-navy: #002060;
  --fd-blue: #1650c7;
  --fd-ink: #1b2430;
  --fd-muted: #64748b;
  --fd-line: #e2e8f0;
  --fd-bg: #f6f8fc;
  --fd-surface: #fff;

  --c-critical: #dc2626; --c-critical-soft: #fef2f2;
  --c-high: #ea580c;     --c-high-soft: #fff7ed;
  --c-medium: #d97706;   --c-medium-soft: #fffbeb;
  --c-low: #059669;      --c-low-soft: #ecfdf5;

  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 14px 16px 28px;
  box-sizing: border-box;
  color: var(--fd-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13.5px;
}

.fd-root *, .fd-root *::before, .fd-root *::after { box-sizing: border-box; }
.fd-root { min-width: 0; }

/* ---------- Single-line bar ---------- */
.fd-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--fd-line);
  border-radius: 12px;
  background: var(--fd-surface);
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}

.fd-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* wide screens: everything on ONE line */
@media (min-width: 1450px) {
  .fd-bar-row { flex-wrap: nowrap; }
}

.fd-bar-title { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.fd-bar-title h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--fd-navy); white-space: nowrap; }

.fd-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--c-medium-soft);
  color: var(--c-medium);
  border: 1px solid #fde7b0;
}

.fd-header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ---------- Buttons ---------- */
.fd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.fd-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(16,24,40,.14); }
.fd-btn:disabled { opacity: .55; cursor: not-allowed; }
.fd-btn-sm { min-height: 30px; padding: 4px 12px; font-size: 12.5px; }

.fd-btn-primary { background: var(--fd-navy); color: #fff; }
.fd-btn-primary:hover:not(:disabled) { background: #0a3190; }
.fd-btn-success { background: #059669; color: #fff; }
.fd-btn-success:hover:not(:disabled) { background: #047857; }
.fd-btn-ghost { background: #fff; color: #344054; border-color: var(--fd-line); }
.fd-btn-ghost:hover:not(:disabled) { background: #f1f5f9; }

.fd-spin { animation: fdSpin .8s linear infinite; }
@keyframes fdSpin { to { transform: rotate(360deg); } }

/* ---------- KPI chips (inline) ---------- */
.fd-kpis { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }

.fd-stat {
  --tone: #94a3b8;
  --tone-soft: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--fd-line);
  border-left: 4px solid var(--tone);
  border-radius: 9px;
  background: var(--tone-soft);
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}

.fd-stat:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(16,24,40,.1); }
.fd-stat.is-active { box-shadow: 0 0 0 2px var(--fd-navy); }
.fd-stat.tone-danger { --tone: var(--c-critical); --tone-soft: var(--c-critical-soft); }
.fd-stat.tone-warn { --tone: var(--c-high); --tone-soft: var(--c-high-soft); }

.fd-stat-value { font-size: 17px; font-weight: 800; line-height: 1; color: var(--tone); font-variant-numeric: tabular-nums; }
.fd-stat.tone-neutral .fd-stat-value { color: var(--fd-ink); }
.fd-stat-label { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--fd-muted); }

/* ---------- Controls ---------- */
.fd-search { position: relative; flex: 1 1 180px; min-width: 140px; }
.fd-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--fd-muted); pointer-events: none; }

.fd-search input {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 33px;
  border: 1px solid var(--fd-line);
  border-radius: 8px;
  background: var(--fd-bg);
  color: var(--fd-ink);
  font-family: inherit;
  font-size: 13.5px;
}

.fd-search input:focus,
.fd-select:focus {
  outline: none;
  background: #fff;
  border-color: #3b6cf0;
  box-shadow: 0 0 0 3px rgba(59,108,240,.15);
}

.fd-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--fd-muted);
  cursor: pointer;
}
.fd-search-clear:hover { background: #e8edf6; color: var(--fd-navy); }

.fd-segmented {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border-radius: 9px;
  background: #eaeff8;
}

.fd-segmented button {
  height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #475467;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.fd-segmented button:hover { color: var(--fd-navy); }
.fd-segmented button.active { background: var(--fd-navy); color: #fff; box-shadow: 0 1px 3px rgba(0,32,96,.3); }

.fd-select {
  flex: 0 0 auto;
  height: 36px;
  max-width: 140px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--fd-line);
  border-radius: 8px;
  background-color: var(--fd-bg);
  color: var(--fd-ink);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.fd-select:disabled { opacity: .5; cursor: not-allowed; }

.fd-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px dashed var(--fd-line); }
.fd-date-group { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--fd-muted); }

/* ---------- Count line ---------- */
.fd-count { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 12.5px; color: var(--fd-muted); }
.fd-count strong { color: var(--fd-ink); }
.fd-link {
  margin-left: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--fd-blue);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.fd-link:hover { text-decoration: underline; }

/* ---------- List + rows ---------- */
.fd-list { display: flex; flex-direction: column; gap: 8px; }

.fd-row {
  --sev: #94a3b8;
  --sev-soft: #f1f5f9;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--fd-line);
  border-radius: 12px;
  background: var(--fd-surface);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.fd-row:hover { box-shadow: 0 4px 14px rgba(16,24,40,.09); border-color: #cfd8e8; }

.fd-row.sev-critical { --sev: var(--c-critical); --sev-soft: var(--c-critical-soft); }
.fd-row.sev-high     { --sev: var(--c-high);     --sev-soft: var(--c-high-soft); }
.fd-row.sev-medium   { --sev: var(--c-medium);   --sev-soft: var(--c-medium-soft); }
.fd-row.sev-low      { --sev: var(--c-low);      --sev-soft: var(--c-low-soft); }
.fd-row.is-resolved  { background: #fafbfd; }
.fd-row.is-resolved .fd-main,
.fd-row.is-resolved .fd-icon { opacity: .7; }

.fd-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--sev); }

.fd-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--sev-soft);
  color: var(--sev);
}

.fd-main { min-width: 0; }

.fd-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fd-title { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--fd-ink); line-height: 1.3; }

.fd-sev {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--sev-soft);
  color: var(--sev);
  border: 1px solid color-mix(in srgb, var(--sev) 35%, transparent);
  font-size: 11px;
  font-weight: 700;
}

.fd-unread { width: 8px; height: 8px; border-radius: 50%; background: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.18); }

.fd-msg {
  margin: 3px 0 6px;
  color: #475467;
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.fd-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--fd-bg);
  border: 1px solid var(--fd-line);
  color: #475467;
  font-size: 12px;
  font-weight: 500;
}
.fd-chip b { font-weight: 800; }
.fd-chip b.up { color: var(--c-critical); }
.fd-chip b.down { color: var(--c-low); }

.fd-time { margin-left: 2px; font-size: 12px; color: #94a3b8; }

.fd-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 200px; cursor: default; }
.fd-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Status pills ---------- */
.fd-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.fd-status.new { background: var(--c-high-soft); color: var(--c-high); }
.fd-status.pending { background: #fef3c7; color: #b45309; }
.fd-status.resolved { background: var(--c-low-soft); color: var(--c-low); }

/* ---------- Load more / empty / skeleton ---------- */
.fd-more {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 8px 18px;
  border: 1px solid var(--fd-line);
  border-radius: 999px;
  background: #fff;
  color: var(--fd-navy);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.fd-more:hover { background: var(--fd-bg); }

.fd-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--fd-muted); }
.fd-empty-card { padding: 44px 20px; border: 1px dashed #cfd8e8; border-radius: 12px; background: #fff; }
.fd-empty h3 { margin: 4px 0 0; font-size: 16px; color: var(--fd-ink); }
.fd-empty p { margin: 0 0 6px; max-width: 460px; font-size: 13px; line-height: 1.5; }

.fd-skel {
  height: 92px;
  border-radius: 12px;
  background: linear-gradient(90deg, #eef2f8 25%, #f7f9fc 50%, #eef2f8 75%);
  background-size: 200% 100%;
  animation: fdShimmer 1.2s ease-in-out infinite;
}
@keyframes fdShimmer { to { background-position: -200% 0; } }

/* ---------- Modal ---------- */
.fd-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(2px);
}

.fd-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 28px);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15,23,42,.35);
  animation: fdPop .15s ease-out;
}
@keyframes fdPop { from { transform: scale(.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.fd-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(160deg, #002060 0%, #0a3190 100%);
  color: #fff;
}
.fd-modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: #fff; }

.fd-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff;
  cursor: pointer;
}
.fd-modal-close:hover { background: rgba(255,255,255,.28); }

.fd-modal-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow-y: auto; min-height: 0; }

.fd-banner {
  --sev: #94a3b8; --sev-soft: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--sev);
  border-radius: 10px;
  background: var(--sev-soft);
}
.fd-banner.sev-critical { --sev: var(--c-critical); --sev-soft: var(--c-critical-soft); }
.fd-banner.sev-high     { --sev: var(--c-high);     --sev-soft: var(--c-high-soft); }
.fd-banner.sev-medium   { --sev: var(--c-medium);   --sev-soft: var(--c-medium-soft); }
.fd-banner.sev-low      { --sev: var(--c-low);      --sev-soft: var(--c-low-soft); }
.fd-banner .fd-icon { background: #fff; }
.fd-banner h4 { margin: 2px 0 0; font-size: 15px; color: var(--fd-ink); }
.fd-banner-sev { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--sev); }

.fd-modal-msg { margin: 0; font-size: 14px; line-height: 1.6; color: #475467; }

.fd-subhead { margin: 4px 0 -4px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--fd-muted); }

.fd-dl {
  display: grid;
  grid-template-columns: minmax(110px, 160px) minmax(0, 1fr);
  margin: 0;
  border: 1px solid var(--fd-line);
  border-radius: 10px;
  overflow: hidden;
}
.fd-dl dt, .fd-dl dd { margin: 0; padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--fd-line); }
.fd-dl dt { background: var(--fd-bg); font-weight: 600; color: var(--fd-muted); }
.fd-dl dd { color: var(--fd-ink); word-break: break-word; }
.fd-dl dt:last-of-type, .fd-dl dd:last-of-type { border-bottom: none; }

.fd-statusbox { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--fd-line); background: var(--fd-bg); }
.fd-statusbox.resolved { background: var(--c-low-soft); border-color: #a7e3c8; }
.fd-statusbox.new { background: var(--c-high-soft); border-color: #fdc79e; }
.fd-statusbox.pending { background: #fffbeb; border-color: #fde7b0; }

.fd-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  background: var(--fd-bg);
  border-top: 1px solid var(--fd-line);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .fd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .fd-root { padding: 10px 10px 24px; gap: 10px; }

  .fd-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; padding: 12px 12px 12px 16px; }
  .fd-side {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    min-width: 0;
    padding-top: 8px;
    border-top: 1px dashed var(--fd-line);
  }

  .fd-segmented { width: 100%; }
  .fd-segmented button { flex: 1 1 0; padding: 0 6px; }
  .fd-select { flex: 1 1 140px; }
  .fd-search input, .fd-select { font-size: 14px; }

  .fd-overlay { align-items: flex-end; padding: 6px; }
  .fd-modal { max-width: none; border-radius: 14px 14px 8px 8px; }
  .fd-dl { grid-template-columns: minmax(96px, 120px) minmax(0, 1fr); }
  .fd-modal-foot .fd-btn { flex: 1 1 0; }
}

@media (max-width: 420px) {
  .fd-stat-value { font-size: 20px; }
  .fd-title { font-size: 14px; }
  .fd-actions { width: 100%; }
  .fd-actions .fd-btn { flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fd-root *, .fd-modal, .fd-skel { animation: none !important; transition: none !important; }
}

/* ---------- Single-line bar: smaller screens ---------- */
@media (max-width: 1449px) {
  .fd-bar-title { flex: 1 1 100%; }
  .fd-kpis { flex: 1 1 100%; }
  .fd-stat { flex: 1 1 0; justify-content: center; }
}

@media (max-width: 720px) {
  .fd-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .fd-stat { height: 40px; }
  .fd-search { flex: 1 1 100%; }
  .fd-select { max-width: none; }
  .fd-header-actions { width: 100%; }
  .fd-header-actions .fd-btn { width: 100%; }
}

/* =========================================
FAITHSWALK HEALTHY CARE SERVICES
Premium Chat — Light Default, Dark Mode
========================================= */

/* =========================================
CSS VARIABLES
========================================= */
:root {
  --header-height: 30px;
}

@media (max-width: 768px) {
  :root {
    --header-height: 50px;
  }
}
/* ============================================================
   MessageComponent ADDITIONS — append to your MessageComponent.css
   ============================================================ */
   /* ============================================================
   APPEND THESE STYLES TO THE BOTTOM OF MessageComponent.css
   ============================================================ */

   
/* ──────────────────────────────────────────────────────────
   CONTEXT MENU — proper light & dark mode theming
   ────────────────────────────────────────────────────────── */
/* @keyframes ctxFadeIn {
  from { opacity:0; transform:scale(0.95) translateY(-6px); }
  to   { opacity:1; transform:scale(1)    translateY(0);    }
}
@keyframes recPulse {
  0%,100% { opacity:1;   transform:scale(1);   }
  50%     { opacity:0.4; transform:scale(1.3); }
}

.sms-ctx-menu {
  position: fixed;
  z-index: 10000;
  min-width: 220px;
  background: var(--sms-bg-elevated);
  border: 1px solid var(--sms-border);
  border-radius: 14px;
  box-shadow: var(--sms-shadow-lg);
  overflow: hidden;
  animation: ctxFadeIn 0.14s ease;
  padding: 4px 0;
}

.sms-ctx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  padding: 11px 18px;
  text-align: left;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: 'DM Sans', sans-serif;
  /* Use CSS variables — works correctly in BOTH light and dark */
  /* color: var(--sms-text-primary);
  transition: background 0.12s;
}
.sms-ctx-item:hover:not(.disabled) {
  background: var(--sms-bg-hover);
}
.sms-ctx-item.danger {
  color: #ef4444;
}
.sms-ctx-item.danger:hover:not(.disabled) {
  background: rgba(239, 68, 68, 0.08);
}
.sms-ctx-item.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.sms-ctx-icon {
  font-size: 1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.sms-ctx-divider {
  height: 1px;
  background: var(--sms-border);
  margin: 3px 0;
} */ */

/* ──────────────────────────────────────────────────────────
   WHATSAPP DROPDOWN BUTTON on message bubble
   ────────────────────────────────────────────────────────── */
.sms-msg-dropdown-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.28);
  color: #fff;
  cursor: pointer;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 6;
  padding: 0;
  line-height: 1;
  backdrop-filter: blur(2px);
}
.sms-message-row:hover .sms-msg-dropdown-btn,
.sms-bubble:hover .sms-msg-dropdown-btn {
  opacity: 1;
}
.sms-msg-dropdown-btn:hover {
  background: rgba(0,0,0,0.5) !important;
}

/* ──────────────────────────────────────────────────────────
   REPLY QUOTE — inside a message bubble (WhatsApp style)
   ────────────────────────────────────────────────────────── */
.sms-reply-quote {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 3px solid rgba(255,255,255,0.5);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 7px;
  background: rgba(0,0,0,0.15);
  cursor: pointer;
  transition: background 0.15s;
  max-width: 100%;
  overflow: hidden;
}
.sms-reply-quote:hover {
  background: rgba(0,0,0,0.22);
}
/* For sent (green) bubble */
.sms-reply-quote.sent {
  border-left-color: rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.15);
}
/* For received bubble */
.sms-reply-quote.received {
  border-left-color: var(--sms-teal-400);
  background: var(--sms-bg-hover);
}
.sms-reply-quote-sender {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sms-teal-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Sent bubble — sender name in white */
.sms-bubble.sent .sms-reply-quote-sender {
  color: rgba(255,255,255,0.85);
}
.sms-reply-quote-text {
  font-size: 0.78rem;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ──────────────────────────────────────────────────────────
   REPLY PREVIEW — above the input textarea
   ────────────────────────────────────────────────────────── */
.sms-reply-preview {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--sms-bg-surface);
  border: 1px solid var(--sms-border);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  animation: ctxFadeIn 0.15s ease;
}
.sms-reply-preview-bar {
  width: 4px;
  flex-shrink: 0;
  background: var(--sms-teal-400);
  border-radius: 10px 0 0 10px;
}
.sms-reply-preview-content {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
}
.sms-reply-preview-sender {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sms-teal-400);
  margin-bottom: 2px;
}
.sms-reply-preview-text {
  font-size: 0.78rem;
  color: var(--sms-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sms-reply-preview-close {
  background: none;
  border: none;
  color: var(--sms-text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 12px;
  flex-shrink: 0;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}
.sms-reply-preview-close:hover {
  color: var(--sms-text-primary);
}

/* ──────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ────────────────────────────────────────────────────────── */
@keyframes toastSlideIn {
  from { opacity:0; transform: translateX(100%) scale(0.95); }
  to   { opacity:1; transform: translateX(0)     scale(1);   }
}
@keyframes toastSlideOut {
  from { opacity:1; transform: translateX(0); }
  to   { opacity:0; transform: translateX(110%); }
}

.sms-toast-container {
  position: fixed;
  top: 80px;
  right: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  width: calc(100vw - 32px);
  pointer-events: none;
}

.sms-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  background: var(--sms-bg-elevated);
  border: 1px solid var(--sms-border);
  border-left: 4px solid #0d9488;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  cursor: pointer;
  pointer-events: all;
  animation: toastSlideIn 0.3s cubic-bezier(0.34,1.4,0.64,1);
  transition: transform 0.15s, box-shadow 0.15s;
}
.sms-toast:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.22);
}

.sms-toast-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--sms-glass-border);
}

.sms-toast-body {
  flex: 1;
  min-width: 0;
}
.sms-toast-title {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--sms-text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sms-toast-text {
  font-size: 0.77rem;
  color: var(--sms-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sms-toast-close {
  background: none;
  border: none;
  color: var(--sms-text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s;
  margin-top: 1px;
}
.sms-toast-close:hover {
  color: var(--sms-text-primary);
}

/* Mobile toast adjustment */
@media (max-width: 768px) {
  .sms-toast-container {
    top: auto;
    bottom: 80px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}

/* ──────────────────────────────────────────────────────────
   MISC HELPERS already used in component
   ────────────────────────────────────────────────────────── */
.deleted-msg   { opacity: 0.65; }
.deleted-text  { font-style: italic; }
.unread-name   { font-weight: 700; }
.unread-preview{ font-weight: 600; }

.sms-attach-btn {
  background: none;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.7;
  transition: opacity 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sms-attach-btn:hover:not(:disabled) { opacity: 1; }
.sms-attach-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.sms-tab-badge {
  background: #ef4444;
  color: #fff;
  border-radius: 50px;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  margin-left: 4px;
}

/* Messages loading spinner */
.sms-messages-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--sms-text-muted);
  font-size: 0.85rem;
}
.sms-messages-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--sms-bg-elevated);
  border-top-color: var(--sms-teal-400);
  border-radius: 50%;
  animation: sms-spin 0.7s linear infinite;
}

/* Context Menu Buttons */
.sms-ctx-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 11px 18px;
  text-align: left;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--sms-text-primary, #e2e8f0);
  transition: background 0.12s;
  white-space: nowrap;
}
.sms-ctx-btn:hover {
  background: rgba(255, 255, 255, 0.07);
}
.sms-ctx-btn-danger {
  color: #f87171;
}
.sms-ctx-btn-danger:hover {
  background: rgba(248, 113, 113, 0.1);
}

/* Deleted message bubble */
.sms-bubble.deleted-msg {
  opacity: 0.65;
  background: var(--sms-bg-secondary, rgba(0,0,0,0.1)) !important;
  border: 1px dashed var(--sms-border, rgba(255,255,255,0.15)) !important;
}
.deleted-text {
  font-style: italic;
  opacity: 0.7;
}

/* Audio recorder pulse animation */
@keyframes pulse {
  0%   { opacity: 1;   transform: scale(1); }
  50%  { opacity: 0.4; transform: scale(1.3); }
  100% { opacity: 1;   transform: scale(1); }
}

/* Media image relative positioning for overlay */
.sms-media-image {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

/* Document media block */
.sms-media-document {
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.15s;
}
.sms-media-document:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

/* Audio media */
.sms-media-audio audio {
  min-width: 220px;
  max-width: 100%;
}

/* Ensure media containers have reasonable max-width */
.sms-media-container {
  max-width: 320px;
  width: 100%;
}

/* Edited label */
.sms-message-footer .edited-label {
  font-size: 0.68rem;
  opacity: 0.5;
  font-style: italic;
  margin-right: 4px;
}

/* Unread badge persists correctly */
.sms-unread-count-badge {
  background: #0d9488;
  color: #fff;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  flex-shrink: 0;
}

/* Unread conversation name bold */
.unread-name {
  font-weight: 700;
}
.unread-preview {
  font-weight: 600;
  color: var(--sms-text-primary, #e2e8f0) !important;
}

/* Voice recording waveform bars */
.sms-waveform-bar {
  width: 3px;
  border-radius: 2px;
  background: #0d9488;
  transition: height 0.12s ease;
}

/* Upload progress */
.sms-upload-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(13, 148, 136, 0.15);
  border-radius: 8px;
  font-size: 0.82rem;
  color: #2dd4bf;
  margin: 4px 0;
}

/* Lightbox download button hover */
a.sms-lb-download:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

/* Video play overlay */
.sms-media-video {
  position: relative;
  cursor: pointer;
}

/* Tab badge */
.sms-tab-badge {
  background: #ef4444;
  color: #fff;
  border-radius: 50px;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  margin-left: 4px;
}

/* Input attach buttons */
.sms-attach-btn {
  background: none;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.7;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.sms-attach-btn:hover:not(:disabled) {
  opacity: 1;
}
.sms-attach-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
/* Group Chat Styles */
.sms-group-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

.sms-avatar-small.sms-group-avatar {
  font-size: 16px;
  width: 36px;
  height: 36px;
}

/* Form Styles */
.sms-form-group {
  margin-bottom: 20px;
}

.sms-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  font-size: 14px;
}

.sms-form-input,
.sms-form-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #1f2937);
  transition: border-color 0.2s;
}

.sms-form-input:focus,
.sms-form-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sms-form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Member Selection */
.sms-member-selection {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  padding: 12px;
  background: var(--bg-secondary, #f9fafb);
}

.sms-member-checkbox {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
  margin-bottom: 4px;
}

.sms-member-checkbox:hover {
  background: var(--bg-primary, #ffffff);
}

.sms-member-checkbox input {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

.sms-member-checkbox span {
  font-size: 14px;
  color: var(--text-primary, #1f2937);
}

/* Modal Styles */
.sms-modal-large {
  max-width: 600px;
  width: 95%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.sms-modal-large .sms-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.sms-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-primary, #ffffff);
  border-radius: 0 0 16px 16px;
}

.sms-btn-primary,
.sms-btn-secondary,
.sms-btn-danger {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.sms-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.sms-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sms-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sms-btn-secondary {
  background: var(--bg-secondary, #f3f4f6);
  color: var(--text-primary, #1f2937);
}

.sms-btn-secondary:hover {
  background: var(--border-color, #e5e7eb);
}

.sms-btn-danger {
  background: #ef4444;
  color: white;
}

.sms-btn-danger:hover {
  background: #dc2626;
}

.sms-btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

.sms-btn-tiny {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
}

/* Member List */
.sms-member-list {
  max-height: 300px;
  overflow-y: auto;
}

.sms-member-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  gap: 12px;
}

.sms-member-item:last-child {
  border-bottom: none;
}

.sms-member-info {
  flex: 1;
  min-width: 0;
}

.sms-member-name {
  display: block;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  font-size: 14px;
}

.sms-member-role {
  font-size: 11px;
  color: var(--text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sms-member-role.admin {
  color: #667eea;
  font-weight: 600;
}

.sms-add-members-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.sms-add-members-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--text-primary, #1f2937);
}

/* Group badge in header */
.sms-user-meta h4 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sms-group-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
}

/* Message avatar for groups */
.sms-msg-avatar-group {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

/* Loading small */
.sms-loading-small {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary, #6b7280);
  font-size: 14px;
}

/* Dark mode support */
[data-theme="dark"] .sms-form-input,
[data-theme="dark"] .sms-form-textarea,
[data-theme="dark"] .sms-member-selection {
  background: var(--bg-secondary, #1f2937);
  border-color: var(--border-color, #374151);
  color: var(--text-primary, #f9fafb);
}

[data-theme="dark"] .sms-member-checkbox:hover {
  background: var(--bg-primary, #374151);
}
/* ================================================================
   MessageComponent.css ADDITIONS
   Paste these at the bottom of your existing MessageComponent.css
   ================================================================ */

/* Bold sender name when there are unread messages */
.sms-user-name.unread-name {
  font-weight: 700;
  color: var(--text-primary, #111827);
}

/* Bold last message preview when unread */
.sms-last-message.unread-preview {
  font-weight: 600;
  color: var(--text-primary, #111827);
}

/* Unread count badge on conversation row — right side */
.sms-unread-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #7c3aed;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

/* Small count badge on the "Unread" filter tab */
.sms-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-left: 5px;
  vertical-align: middle;
}
/* =========================================
LIGHT THEME (DEFAULT)
========================================= */
:root,
[data-theme="light"] {
  --sms-bg-app:         #eef2f7;
  --sms-bg-sidebar:     #ffffff;
  --sms-bg-chat:        #dfe7ef;
  --sms-bg-surface:     #f8fafc;
  --sms-bg-elevated:    #f1f5f9;
  --sms-bg-hover:       #e8f0fb;
  --sms-bg-active:      #dbeafe;
  --sms-bg-input:       #ffffff;
  --sms-bg-header:      #ffffff;
  --sms-bg-msg-area:    #dfe7ef;
  --sms-glass-border:   rgba(0,0,0,0.07);
  --sms-teal-300:       #0d9488;
  --sms-teal-400:       #0d9488;
  --sms-teal-500:       #0d9488;
  --sms-teal-600:       #0f766e;
  --sms-teal-glow:      rgba(13,148,136,0.12);
  --sms-teal-btn:       linear-gradient(135deg,#0d9488,#0f766e);
  --sms-teal-btn-hover: linear-gradient(135deg,#14b8a6,#0d9488);
  --sms-gold-300:       #b45309;
  --sms-gold-400:       #d97706;
  --sms-sent-bg:        linear-gradient(145deg,#0d9488 0%,#0c6b64 100%);
  --sms-sent-tail:      #0c6b64;
  --sms-recv-bg:        #ffffff;
  --sms-recv-tail:      #ffffff;
  --sms-recv-border:    rgba(0,0,0,0.07);
  --sms-text-primary:   #1e293b;
  --sms-text-secondary: #475569;
  --sms-text-muted:     #94a3b8;
  --sms-text-name:      #0f172a;
  --sms-text-brand:     #0f172a;
  --sms-border:         rgba(0,0,0,0.07);
  --sms-border-input:   rgba(0,0,0,0.1);
  --sms-border-focus:   rgba(13,148,136,0.4);
  --sms-divider:        rgba(0,0,0,0.05);
  --sms-shadow-sm:      0 2px 8px rgba(0,0,0,0.07);
  --sms-shadow-md:      0 4px 20px rgba(0,0,0,0.09);
  --sms-shadow-lg:      0 8px 40px rgba(0,0,0,0.11);
  --sms-bubble-shadow:  0 2px 8px rgba(0,0,0,0.07);
  --sms-sent-shadow:    0 4px 14px rgba(13,148,136,0.22);
  --sms-online-color:   #16a34a;
  --sms-online-glow:    rgba(22,163,74,0.3);
  --sms-scrollbar-thumb: #cbd5e1;
  --sms-scrollbar-hover: #94a3b8;
  --sms-chat-pattern:   url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%230d9488' fill-opacity='0.035'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
}

/* =========================================
DARK THEME
========================================= */
[data-theme="dark"] {
  --sms-bg-app:         #0b1120;
  --sms-bg-sidebar:     #0d1526;
  --sms-bg-chat:        #08101d;
  --sms-bg-surface:     #111d30;
  --sms-bg-elevated:    #172236;
  --sms-bg-hover:       #1c2a3f;
  --sms-bg-active:      #1f3048;
  --sms-bg-input:       #131f32;
  --sms-bg-header:      #0d1526;
  --sms-bg-msg-area:    #08101d;
  --sms-glass-border:   rgba(255,255,255,0.07);
  --sms-teal-300:       #5eead4;
  --sms-teal-400:       #2dd4bf;
  --sms-teal-500:       #0d9488;
  --sms-teal-600:       #0f766e;
  --sms-teal-glow:      rgba(13,148,136,0.22);
  --sms-teal-btn:       linear-gradient(135deg,#0d9488,#0f766e);
  --sms-teal-btn-hover: linear-gradient(135deg,#14b8a6,#0d9488);
  --sms-gold-300:       #fde68a;
  --sms-gold-400:       #fbbf24;
  --sms-sent-bg:        linear-gradient(145deg,#0d9488 0%,#0c6b64 100%);
  --sms-sent-tail:      #0c6b64;
  --sms-recv-bg:        #192640;
  --sms-recv-tail:      #192640;
  --sms-recv-border:    rgba(255,255,255,0.06);
  --sms-text-primary:   #e2e8f0;
  --sms-text-secondary: #94a3b8;
  --sms-text-muted:     #4e6380;
  --sms-text-name:      #f1f5f9;
  --sms-text-brand:     #e2e8f0;
  --sms-border:         rgba(255,255,255,0.06);
  --sms-border-input:   rgba(255,255,255,0.08);
  --sms-border-focus:   rgba(13,148,136,0.5);
  --sms-divider:        rgba(255,255,255,0.04);
  --sms-shadow-sm:      0 2px 8px rgba(0,0,0,0.4);
  --sms-shadow-md:      0 4px 20px rgba(0,0,0,0.5);
  --sms-shadow-lg:      0 8px 40px rgba(0,0,0,0.6);
  --sms-bubble-shadow:  0 2px 12px rgba(0,0,0,0.35);
  --sms-sent-shadow:    0 4px 16px rgba(13,148,136,0.2);
  --sms-online-color:   #22c55e;
  --sms-online-glow:    rgba(34,197,94,0.4);
  --sms-scrollbar-thumb: #1c2a3f;
  --sms-scrollbar-hover: #243348;
  --sms-chat-pattern:   url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%230d9488' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
}

/* =========================================
BASE RESET
========================================= */
.sms-message-component *, 
.sms-message-component *::before, 
.sms-message-component *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =========================================
LOADING
========================================= */
.sms-loading-screen {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--sms-bg-app);
  color: var(--sms-text-primary);
  font-family: 'DM Sans', sans-serif;
}

.sms-loading-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sms-text-brand);
  margin-bottom: 28px;
}

.sms-loading-logo span {
  color: var(--sms-teal-400);
}

.sms-loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--sms-bg-elevated);
  border-top-color: var(--sms-teal-400);
  border-right-color: var(--sms-gold-400);
  border-radius: 50%;
  animation: sms-spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes sms-spin {
  to { transform: rotate(360deg); }
}

.sms-loading-screen p {
  color: var(--sms-text-muted);
  font-size: 0.85rem;
}

/* =========================================
MAIN CONTAINER - FIXED POSITIONING ✅
========================================= */
.sms-message-component {
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sms-bg-app);
  font-family: 'DM Sans', sans-serif;
  overflow: hidden;
  position: fixed; /* ✅ FIXED: Changed from relative to fixed */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  transition: background 0.3s ease;
}

/* =========================================
1️⃣ HEADER - FIXED POSITION AT TOP ✅
========================================= */
.sms-app-header {
  width: 100%;
  height: var(--header-height);
  max-height: var(--header-height);
  background: var(--sms-bg-header);
  border-bottom: 1px solid var(--sms-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  flex-shrink: 0;
  z-index: 1000; /* ✅ HIGH Z-INDEX */
  box-shadow: var(--sms-shadow-sm);
  position: fixed; /* ✅ FIXED: Changed from sticky to fixed */
  top: 50px;
  left: 0;
  right: 0;
}

.sms-app-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sms-app-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--sms-text-brand);
}

.sms-app-brand span {
  color: var(--sms-teal-400);
}

.sms-app-tagline {
  font-size: 0.65rem;
  color: var(--sms-text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 500;
  margin-left: 8px;
}

.sms-app-header-actions {
  display: flex;
  gap: 6px;
}

.sms-app-header-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--sms-glass-border);
  background: var(--sms-bg-surface);
  color: var(--sms-text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sms-app-header-btn:hover {
  background: var(--sms-bg-hover);
  color: var(--sms-teal-400);
  border-color: var(--sms-teal-600);
  transform: translateY(-1px);
}

/* =========================================
2️⃣ MAIN CONTENT AREA (below fixed header) ✅
========================================= */
.sms-main-content {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  min-height: 0;
  position: relative;
  height: 100vh; /* ✅ FULL HEIGHT */
  margin-top: var(--header-height); /* ✅ OFFSET FOR FIXED HEADER */
}

/* =========================================
3️⃣ SIDEBAR - SEPARATE CONTAINER
========================================= */
 /* Context menu fade-in */
        @keyframes ctxFadeIn {
          from { opacity:0; transform:scale(0.95) translateY(-4px); }
          to   { opacity:1; transform:scale(1)    translateY(0);    }
        }
        /* Audio recorder pulse */
        @keyframes recPulse {
          0%,100% { opacity:1; transform:scale(1);   }
          50%      { opacity:0.4; transform:scale(1.3); }
        }

        /* FIX #3 — WhatsApp dropdown button */
        .sms-msg-dropdown-btn {
          position: absolute;
          top: 4px;
          right: 4px;
          width: 24px;
          height: 24px;
          border-radius: 50%;
          border: none;
          background: rgba(0,0,0,0.28);
          color: #fff;
          cursor: pointer;
          font-size: 0.82rem;
          display: flex;
          align-items: center;
          justify-content: center;
          opacity: 0;
          transition: opacity 0.15s;
          z-index: 6;
          padding: 0;
          line-height: 1;
          backdrop-filter: blur(2px);
        }
        /* Show button on hover of the whole message row */
        .sms-message-row:hover .sms-msg-dropdown-btn,
        .sms-bubble:hover .sms-msg-dropdown-btn {
          opacity: 1;
        }
        .sms-msg-dropdown-btn:hover {
          background: rgba(0,0,0,0.5) !important;
        }

        /* Misc helpers */
        .deleted-msg   { opacity: 0.65; }
        .deleted-text  { font-style: italic; }
        .unread-name   { font-weight: 700; }
        .unread-preview{ font-weight: 600; }

        .sms-attach-btn {
          background: none; border: none; padding: 6px 8px;
          cursor: pointer; font-size: 1.2rem; opacity: 0.7;
          transition: opacity 0.15s; flex-shrink: 0;
        }
        .sms-attach-btn:hover:not(:disabled) { opacity: 1; }
        .sms-attach-btn:disabled { opacity: 0.3; cursor: not-allowed; }

        /* FIX #1 — Tab badge for Groups */
        .sms-tab-badge {
          background: #ef4444; color: #fff; border-radius: 50px;
          font-size: 0.65rem; font-weight: 700;
          min-width: 16px; height: 16px;
          display: inline-flex; align-items: center; justify-content: center;
          padding: 0 4px; margin-left: 4px;
        }
.sms-sidebar {
  width: 360px;
  min-width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sms-bg-sidebar);
  border-right: 1px solid var(--sms-border);
  overflow: hidden;
  height: 100%;
  position: relative;
}

.sms-sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sms-search-container {
  padding: 12px 16px;
  border-bottom: 1px solid var(--sms-border);
  position: relative;
  margin-top: 50px;
}

.sms-search-icon {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sms-text-muted);
  font-size: 0.85rem;
  z-index: 1;
  pointer-events: none;
}

.sms-search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border-radius: 10px;
  border: 1px solid var(--sms-border-input);
  background: var(--sms-bg-surface);
  font-size: 0.85rem;
  color: var(--sms-text-primary);
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s ease;
}

.sms-search-input::placeholder {
  color: var(--sms-text-muted);
}

.sms-search-input:focus {
  outline: none;
  border-color: var(--sms-border-focus);
  background: var(--sms-bg-input);
  box-shadow: 0 0 0 3px var(--sms-teal-glow);
}

.sms-filter-tabs {
  display: flex;
  gap: 5px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--sms-border);
  overflow-x: auto;
}

.sms-filter-tabs::-webkit-scrollbar {
  display: none;
}

.sms-filter-tab {
  padding: 5px 13px;
  border-radius: 20px;
  border: 1px solid var(--sms-glass-border);
  background: transparent;
  color: var(--sms-text-muted);
  font-size: 0.76rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sms-filter-tab:hover {
  background: var(--sms-bg-hover);
  color: var(--sms-text-primary);
  border-color: var(--sms-teal-600);
}

.sms-filter-tab.active {
  background: var(--sms-teal-btn);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--sms-teal-glow);
}

.sms-conversation-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0;
}

.sms-conversation-list::-webkit-scrollbar {
  width: 4px;
}

.sms-conversation-list::-webkit-scrollbar-track {
  background: transparent;
}

.sms-conversation-list::-webkit-scrollbar-thumb {
  background: var(--sms-scrollbar-thumb);
  border-radius: 2px;
}

.sms-section-label {
  padding: 8px 16px 4px;
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--sms-text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.sms-conversation-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  position: relative;
  border-bottom: 1px solid var(--sms-divider);
}

.sms-conversation-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--sms-teal-btn);
  border-radius: 0 2px 2px 0;
  transition: height 0.2s ease;
}

.sms-conversation-item:hover {
  background: var(--sms-bg-hover);
}

.sms-conversation-item:hover::before,
.sms-conversation-item.active::before {
  height: 52%;
}

.sms-conversation-item.active {
  background: var(--sms-bg-active);
}

.sms-avatar-wrapper {
  position: relative;
  margin-right: 11px;
  flex-shrink: 0;
}

.sms-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid rgba(255,255,255,0.1);
  overflow: hidden;
  position: relative;
}

.sms-avatar-img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--sms-glass-border);
}

.sms-online-indicator {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  background: var(--sms-online-color);
  border-radius: 50%;
  border: 2px solid var(--sms-bg-sidebar);
  box-shadow: 0 0 5px var(--sms-online-glow);
}

.sms-conversation-details {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.sms-conversation-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.sms-user-name {
  font-weight: 600;
  color: var(--sms-text-name);
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sms-time-stamp {
  font-size: 0.67rem;
  color: var(--sms-text-muted);
  flex-shrink: 0;
  margin-left: 6px;
}

.sms-unread-count-badge {
  background: var(--sms-teal-btn);
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 17px;
}

.sms-conversation-bottom {
  display: flex;
  align-items: center;
}

.sms-last-message {
  font-size: 0.78rem;
  color: var(--sms-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
}

.sms-message-check {
  color: var(--sms-teal-400);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.sms-typing-indicator-text {
  color: var(--sms-teal-400);
  font-style: italic;
  font-size: 0.78rem;
}

.sms-empty-list {
  padding: 48px 20px;
  text-align: center;
  color: var(--sms-text-muted);
}

.sms-empty-list-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  opacity: 0.4;
}

/* =========================================
4️⃣ CHAT AREA - SEPARATE CONTAINER
========================================= */
.sms-chat-area {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--sms-bg-msg-area);
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

.sms-chat-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--sms-chat-pattern);
  background-repeat: repeat;
  pointer-events: none;
  z-index: 0;
}

.sms-chat-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  min-height: 0;
}

/* =========================================
CHAT HEADER
========================================= */
.sms-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  height: 50px;
  min-height: 50px;
  flex-shrink: 0;
  background: var(--sms-bg-header);
  border-bottom: 1px solid var(--sms-border);
  z-index: 5;
  width: 100%;
  box-shadow: var(--sms-shadow-sm);
  margin-top: 50px;
}

.sms-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.sms-back-btn {
  background: var(--sms-bg-surface);
  border: 1px solid var(--sms-glass-border);
  color: var(--sms-text-secondary);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 1.1rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  display: none;
  transition: all 0.2s ease;
}

.sms-back-btn:hover {
  background: var(--sms-bg-hover);
  color: var(--sms-text-primary);
}

.sms-close-chat-btn {
  background: var(--sms-bg-surface);
  border: 1px solid var(--sms-glass-border);
  color: var(--sms-text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sms-close-chat-btn:hover {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: #ef4444;
}

.sms-avatar-small {
  width: 40px;
  height: 40px;
  font-size: 0.85rem;
}

.sms-avatar-img-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--sms-glass-border);
}

.sms-online-indicator.small {
  width: 10px;
  height: 10px;
  bottom: 0;
  right: 0;
  border-color: var(--sms-bg-header);
}

.sms-user-meta {
  flex: 1;
  min-width: 0;
}

.sms-user-meta h4 {
  margin: 0;
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--sms-text-name);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sms-user-status {
  font-size: 0.72rem;
  color: var(--sms-teal-400);
}

.sms-typing-status {
  color: var(--sms-gold-400);
  font-style: italic;
}

.sms-chat-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.sms-action-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--sms-glass-border);
  background: var(--sms-bg-surface);
  color: var(--sms-text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sms-action-icon:hover {
  background: var(--sms-bg-hover);
  color: var(--sms-teal-400);
  border-color: var(--sms-teal-600);
  transform: translateY(-1px);
}

/* =========================================
MESSAGES LIST
========================================= */
.sms-messages-list {
  flex: 1;
  min-height: 0;
  padding: 16px 8%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  z-index: 1;
}

.sms-messages-list::-webkit-scrollbar {
  width: 4px;
}

.sms-messages-list::-webkit-scrollbar-track {
  background: transparent;
}

.sms-messages-list::-webkit-scrollbar-thumb {
  background: var(--sms-scrollbar-thumb);
  border-radius: 2px;
}

.sms-error-message {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.sms-error-message button {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.9rem;
}

.sms-date-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 16px 0 10px;
  flex-shrink: 0;
}

.sms-date-divider::before,
.sms-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sms-divider);
}

.sms-date-divider span {
  background: var(--sms-bg-elevated);
  color: var(--sms-text-muted);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border: 1px solid var(--sms-glass-border);
  white-space: nowrap;
}

/* =========================================
MESSAGE ROW ALIGNMENT
========================================= */
.sms-message-row {
  display: flex;
  align-items: flex-end;
  max-width: 68%;
  margin-bottom: 2px;
  animation: sms-msgIn 0.25s cubic-bezier(0.34,1.4,0.64,1);
  flex-shrink: 0;
}

@keyframes sms-msgIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.sms-message-row.received {
  align-self: flex-start;
  flex-direction: row;
  gap: 6px;
}

.sms-message-row.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

/* =========================================
BUBBLES
========================================= */
.sms-bubble {
  padding: 8px 12px 6px;
  border-radius: 12px;
  position: relative;
  max-width: 100%;
  word-wrap: break-word;
}

.sms-bubble.received {
  background: var(--sms-recv-bg);
  color: var(--sms-text-primary);
  border: 1px solid var(--sms-recv-border);
  border-bottom-left-radius: 3px;
  box-shadow: var(--sms-bubble-shadow);
}

.sms-bubble.sent {
  background: var(--sms-sent-bg);
  color: #fff;
  border-bottom-right-radius: 3px;
  box-shadow: var(--sms-sent-shadow);
}

.sms-bubble.received::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: -6px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-bottom-color: var(--sms-recv-tail);
  border-left: none;
}

.sms-bubble.sent::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: -6px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-bottom-color: var(--sms-sent-tail);
  border-right: none;
}

.sms-message-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.sms-message-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 3px;
}

.sms-msg-time {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.55);
}

.sms-bubble.received .sms-msg-time {
  color: var(--sms-text-muted);
}

.sms-read-status {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: -1px;
  transition: color 0.3s ease;
}

.sms-read-status.delivered {
  color: rgba(255,255,255,0.75);
}

.sms-read-status.read {
  color: #7fffd4;
}

.sms-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  align-self: flex-end;
  border: 1px solid var(--sms-glass-border);
  overflow: hidden;
}

/* =========================================
TYPING INDICATOR
========================================= */
.sms-typing-bubble {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  align-self: flex-start;
  animation: sms-msgIn 0.25s ease;
  flex-shrink: 0;
}

.sms-typing-indicator-bubble {
  background: var(--sms-recv-bg);
  border: 1px solid var(--sms-recv-border);
  border-radius: 12px;
  border-bottom-left-radius: 3px;
  padding: 12px 16px;
  display: flex;
  gap: 4px;
  box-shadow: var(--sms-bubble-shadow);
}

.sms-typing-indicator-bubble span {
  width: 6px;
  height: 6px;
  background: var(--sms-teal-400);
  border-radius: 50%;
  animation: sms-typingBounce 1.2s infinite ease-in-out both;
}

.sms-typing-indicator-bubble span:nth-child(1) {
  animation-delay: -0.32s;
}

.sms-typing-indicator-bubble span:nth-child(2) {
  animation-delay: -0.16s;
}

.sms-typing-indicator-bubble span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes sms-typingBounce {
  0%,80%,100% { transform: translateY(0); opacity: 0.4; }
  40%          { transform: translateY(-5px); opacity: 1; }
}

/* =========================================
INPUT AREA
========================================= */
.sms-input-area {
  padding: 10px 12px 12px;
  background: var(--sms-bg-header);
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--sms-border);
  flex-shrink: 0;
  width: 100%;
  margin-bottom: 10px;
}

.sms-input-wrapper {
  display: flex;
  align-items: flex-end;
  background: var(--sms-bg-input);
  border-radius: 24px;
  padding: 6px 6px 6px 14px;
  gap: 6px;
  border: 1px solid var(--sms-border-input);
  transition: all 0.2s ease;
}

.sms-input-wrapper:focus-within {
  border-color: var(--sms-border-focus);
  box-shadow: 0 0 0 3px var(--sms-teal-glow);
}

.sms-emoji-btn,
.sms-attach-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--sms-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sms-emoji-btn:hover,
.sms-attach-btn:hover {
  background: var(--sms-bg-hover);
  color: var(--sms-teal-400);
}

.sms-message-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--sms-text-primary);
  outline: none;
  resize: none;
  max-height: 120px;
  line-height: 1.5;
  min-height: 24px;
}

.sms-message-input::placeholder {
  color: var(--sms-text-muted);
}

.sms-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--sms-teal-btn);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--sms-teal-glow);
}

.sms-send-btn:hover:not(:disabled) {
  background: var(--sms-teal-btn-hover);
  transform: scale(1.08) translateY(-1px);
}

.sms-send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.sms-send-btn:disabled {
  background: var(--sms-bg-elevated);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.5;
}

.sms-emoji-picker {
  position: absolute;
  bottom: 72px;
  left: 12px;
  background: var(--sms-bg-elevated);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--sms-glass-border);
  box-shadow: var(--sms-shadow-lg);
  display: grid;
  grid-template-columns: repeat(8,1fr);
  gap: 5px;
  z-index: 100;
  animation: sms-emojiSlideUp 0.2s cubic-bezier(0.34,1.4,0.64,1);
}

@keyframes sms-emojiSlideUp {
  from { opacity:0; transform: translateY(8px) scale(0.96); }
  to { opacity:1; transform:none; }
}

.sms-emoji-item {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: 7px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sms-emoji-item:hover {
  background: var(--sms-bg-hover);
  transform: scale(1.2);
}

/* =========================================
EMPTY STATE
========================================= */
.sms-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  position: relative;
  z-index: 1;
  overflow-y: auto;
  min-height: 0;
}

.sms-empty-state-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--sms-text-brand);
  margin-bottom: 4px;
}

.sms-empty-state-logo span {
  color: var(--sms-teal-400);
}

.sms-empty-state-tagline {
  font-size: 0.68rem;
  color: var(--sms-text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 32px;
  font-weight: 500;
}

.sms-empty-state-icon {
  width: 86px;
  height: 86px;
  border-radius: 22px;
  background: var(--sms-bg-elevated);
  border: 1px solid var(--sms-glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  margin-bottom: 22px;
  animation: sms-floatIcon 4s ease-in-out infinite;
  box-shadow: var(--sms-shadow-md);
}

@keyframes sms-floatIcon {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.sms-empty-state h3 {
  color: var(--sms-text-name);
  margin-bottom: 8px;
  font-size: 1.2rem;
  font-weight: 600;
}

.sms-empty-state p {
  font-size: 0.85rem;
  max-width: 320px;
  line-height: 1.6;
  color: var(--sms-text-muted);
}

.sms-empty-subtext {
  font-size: 0.78rem !important;
  opacity: 0.7;
  margin-top: 4px;
}

.sms-empty-state-footer {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 20px;
  border-top: 1px solid var(--sms-border);
}

.sms-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sms-text-secondary);
  font-size: 0.8rem;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--sms-bg-surface);
  border: 1px solid var(--sms-glass-border);
  min-width: 220px;
  transition: all 0.2s ease;
}

.sms-feature-item:hover {
  background: var(--sms-bg-hover);
  color: var(--sms-text-primary);
  border-color: var(--sms-teal-600);
}

.sms-feature-icon {
  font-size: 0.95rem;
}

/* =========================================
MODAL
========================================= */
.sms-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: sms-fadeIn 0.2s ease;
}

@keyframes sms-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sms-modal-content {
  background: var(--sms-bg-elevated);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sms-shadow-lg);
  border: 1px solid var(--sms-border);
  animation: sms-modalUp 0.3s ease;
}

@keyframes sms-modalUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.sms-modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--sms-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.sms-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--sms-text-primary);
  font-family: 'Playfair Display', serif;
}

.sms-modal-close {
  background: var(--sms-bg-surface);
  border: 1px solid var(--sms-glass-border);
  color: var(--sms-text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.sms-modal-close:hover {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: #ef4444;
}

.sms-modal-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--sms-border);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  flex-shrink: 0;
  
}

.sms-modal-search .sms-search-icon {
  position: static;
  color: var(--sms-text-muted);
  font-size: 14px;
  pointer-events: none;
}

.sms-modal-search input {
  flex: 1;
  background: var(--sms-bg-input);
  border: 1px solid var(--sms-border-input);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--sms-text-primary);
  font-size: 0.875rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}

.sms-modal-search input:focus {
  border-color: var(--sms-border-focus);
  box-shadow: 0 0 0 3px var(--sms-teal-glow);
}

.sms-modal-search input::placeholder {
  color: var(--sms-text-muted);
}

.sms-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  min-height: 0;
}

.sms-staff-member-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.sms-staff-member-item:hover {
  background: var(--sms-bg-hover);
}

.sms-staff-member-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sms-staff-name {
  font-weight: 600;
  color: var(--sms-text-primary);
  font-size: 0.875rem;
}

.sms-staff-role {
  font-size: 0.75rem;
  color: var(--sms-text-muted);
}

.sms-online-badge {
  font-size: 0.7rem;
  color: var(--sms-online-color);
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(34,197,94,0.1);
  border-radius: 10px;
  border: 1px solid rgba(34,197,94,0.2);
}

.sms-empty-state-small {
  padding: 40px 20px;
  text-align: center;
  color: var(--sms-text-muted);
  font-size: 0.875rem;
}

/* =========================================
SCROLLBAR
========================================= */
.sms-message-component ::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.sms-message-component ::-webkit-scrollbar-track {
  background: transparent;
}

.sms-message-component ::-webkit-scrollbar-thumb {
  background: var(--sms-scrollbar-thumb);
  border-radius: 3px;
}

.sms-message-component ::-webkit-scrollbar-thumb:hover {
  background: var(--sms-scrollbar-hover);
}

/* =========================================
RESPONSIVE
========================================= */
@media (min-width: 769px) {
  .sms-sidebar {
    position: relative !important;
    transform: none !important;
    display: flex !important;
  }
  
  .sms-chat-area {
    position: relative !important;
    transform: none !important;
    display: flex !important;
  }
  
  .sms-back-btn {
    display: none !important;
  }
  
  .sms-close-chat-btn {
    display: flex !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .sms-sidebar {
    width: 290px;
    min-width: 250px;
  }
  
  .sms-messages-list {
    padding: 14px 5%;
  }
  
  .sms-message-row {
    max-width: 78%;
  }
  
  .sms-emoji-picker {
    grid-template-columns: repeat(6,1fr);
  }
}

@media (max-width: 768px) {
  .sms-app-header {
    padding: 0 5px;
    position: fixed; /* ✅ FIXED: Changed from sticky */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 50px;
  
  }
  
  .sms-app-brand {
    font-size: 0.95rem;
  }
  
  .sms-app-tagline {
    display: none;
  }
  
  .sms-message-component {
    position: fixed; /* ✅ FIXED */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  
  .sms-main-content {
    height: 100vh;
    margin-top: var(--header-height); /* ✅ OFFSET FOR FIXED HEADER */
    position: relative;
  }
  
  /* sidebar takes full screen below header */
  .sms-sidebar {
    position: absolute !important;
    left: 0;
    top: 0 !important;
    right: 0;
    bottom: 0;
    width: 100% !important;
    z-index: 10;
    transform: translateX(0) !important;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    height: 100% !important;
  }
  
  .sms-sidebar.hidden-mobile {
    transform: translateX(-100%) !important;
    pointer-events: none;
  }
  
  /* chat takes full screen below header, slides in from right */
  .sms-chat-area {
    position: absolute !important;
    left: 0;
    top: 0 !important;
    right: 0;
    bottom: 0;
    z-index: 20;
    transform: translateX(100%) !important;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    display: flex !important;
    height: 100% !important;
  }
  
  .sms-chat-area.chat-open {
    transform: translateX(0) !important;
  }
   
  .sms-back-btn{
    display: flex !important;
    height: 25px;
    width: 25px;
  }
  .sms-avatar-img-small{
    width: 30px;
    height: 30px;
  }
  .sms-search-container{
    margin-top: 50px;
  }
  .sms-action-icon{
    height: 25px;
    width: 25px;
  }
  
  .sms-close-chat-btn {
    display: flex !important;
  }
  
  .sms-messages-list {
    padding: 12px 4%;
  }
  
  .sms-message-row {
    max-width: 84%;
  }
}

@media (max-width: 480px) {
  .sms-search-container {
    padding: 10px 12px;
    margin-top: 50px;
  }
  
  .sms-filter-tabs {
    padding: 8px 12px;
  }
  
  .sms-avatar,
  .sms-avatar-img {
    width: 30px;
    height: 30px;
  }
  
  .sms-chat-header {
    height: 40px;
    min-height: 40px;
    margin-top: 50px;
  }
  
  .sms-emoji-picker {
    grid-template-columns: repeat(6,1fr);
    left: 8px;
    bottom: 68px;
  }
  
  .sms-emoji-item {
    width: 30px;
    height: 30px;
    font-size: 1.1rem;
  }
  
  .sms-messages-list {
    padding: 10px 3%;
  }
}/* ══════════════════════════════════════════════════════════
   SECURITY CONTAINER LAYOUT
   ═══════════════════════════════════════════════════════════ */
.security-container {
  display: flex;
  height: calc(100vh - 180px);
  background: #f8fafc;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════ */
.security-sidebar {
  width: 320px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.security-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

.security-sidebar-header h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.security-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.security-search-icon {
  position: absolute;
  left: 10px;
  color: #94a3b8;
  pointer-events: none;
}

.security-search-input {
  width: 100%;
  padding: 8px 32px 8px 34px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: #ffffff;
}

.security-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.security-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.security-search-clear:hover {
  background: #f1f5f9;
  color: #64748b;
}

/* ═══════════════════════════════════════════════════════════
   STAFF LIST
   ═══════════════════════════════════════════════════════════ */
.security-staff-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.security-loading,
.security-no-results {
  padding: 20px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.security-staff-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s;
}

.security-staff-item:hover {
  background: #f8fafc;
}

.security-staff-item-active {
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
}

.security-staff-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  margin-right: 12px;
}

.security-staff-info {
  flex: 1;
  min-width: 0;
}

.security-staff-name {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.security-staff-role {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════
   CONTENT AREA - SCROLLABLE
   ══════════════════════════════════════════════════════════ */
.security-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: #ffffff;
  padding: 24px;
  min-width: 0;
}

/* Custom scrollbar for content area */
.security-content::-webkit-scrollbar {
  width: 8px;
}

.security-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.security-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.security-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.security-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.security-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.security-header-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 20px;
  flex-shrink: 0;
}

.security-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
}

.security-header-subtitle {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: #64748b;
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════ */
.security-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  color: #94a3b8;
}

.security-empty-icon {
  margin-bottom: 16px;
  opacity: 0.5;
}

.security-empty-state h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: #64748b;
}

.security-empty-state p {
  margin: 0;
  font-size: 14px;
  color: #94a3b8;
}

/* ═══════════════════════════════════════════════════════════
   REUSED CLASS NAMES (from StaffProfileModal.css)
   These are global — keep identical to avoid breaking other pages
   ═══════════════════════════════════════════════════════════ */
.staff-form-section {
  background: #ffffff;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.staff-form-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.staff-section-description {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: #64748b;
}

.clients-form-grid-two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.staff-checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.staff-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  transition: all 0.15s;
  background: #f8fafc;
}

.staff-checkbox-label:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.staff-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #3b82f6;
  flex-shrink: 0;
}

.staff-block-user {
  border-color: #fca5a5;
  background: #fef2f2;
}

.staff-block-user:hover {
  background: #fee2e2;
  border-color: #f87171;
}

.staff-block-user input[type="checkbox"] {
  accent-color: #ef4444;
}

.staff-form-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.staff-save-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 180px;
  justify-content: center;
}

.staff-save-button:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.staff-save-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════
   COLLAPSIBLE PERMISSION CATEGORIES
   ═══════════════════════════════════════════════════════════ */
.permission-category {
  margin: 20px 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.permission-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.permission-category-header:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

.permission-category-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
}

.permission-category-title h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.permission-category-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

.permission-category-content {
  padding: 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.permission-category-content .staff-checkbox-group {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.permission-category-content .staff-checkbox-label {
  background: white;
  border: 1px solid #e2e8f0;
}

.permission-category-content .staff-checkbox-label:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.permission-category-content .staff-checkbox-label svg {
  color: #667eea;
  margin-right: 4px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .security-container {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 180px);
  }

  .security-sidebar {
    width: 100%;
    max-height: 300px;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .security-staff-list {
    max-height: 200px;
  }

  .security-content {
    overflow-y: visible;
    max-height: none;
  }

  .clients-form-grid-two-col,
  .staff-checkbox-group {
    grid-template-columns: 1fr;
  }
}/* ==========================================
   TICKET SYSTEM - IT SERVICE DESK
   WhatsApp-style chat + Active status + Clean UI
   ========================================== */

.ticket-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  background: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── HEADER ───────────────────────────────── */
.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ticket-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ticket-logo {
  width: 44px;
  height: 44px;
  background: #ecfeff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ticket-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.ticket-subtitle {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0 0;
}

.ticket-connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
}

.ticket-connection-status.connected {
  color: #0891b2;
}

.ticket-live-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  animation: ticket-pulse 2s infinite;
}

@keyframes ticket-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ticket-online-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #10b981;
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* ── MAIN LAYOUT ─────────────────────────── */
.ticket-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── LEFT SIDEBAR ────────────────────────── */
.ticket-sidebar {
  width: 260px;
  background: white;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  flex-shrink: 0;
}

.ticket-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 16px;
}

.ticket-search-icon {
  color: #94a3b8;
  flex-shrink: 0;
}

.ticket-search-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 13px;
  outline: none;
  color: #334155;
}

.ticket-search-input::placeholder {
  color: #94a3b8;
}

.ticket-filters {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.ticket-filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  color: #475569;
}

.ticket-filter-item:hover {
  background: #f1f5f9;
}

.ticket-filter-item.active {
  background: #dbeafe;
  color: #2563eb;
  font-weight: 600;
}

.ticket-filter-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

.ticket-filter-label {
  flex: 1;
}

.ticket-filter-count {
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.ticket-filter-item.active .ticket-filter-count {
  background: white;
  color: #2563eb;
}

.ticket-sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.ticket-footer-stats {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
}

.ticket-stat {
  flex: 1;
  text-align: center;
}

.ticket-stat-number {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.ticket-stat-label {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* ── MIDDLE PANEL - TICKET LIST ──────────── */
.ticket-list-panel {
  width: 340px;
  background: white;
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  flex-shrink: 0;
}

.ticket-loading,
.ticket-empty-list {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-size: 14px;
}

.ticket-list-item {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.ticket-list-item:hover {
  background: #f8fafc;
}

.ticket-list-item.active {
  background: #f0f9ff;
  border-left: 3px solid #0891b2;
}

.ticket-list-item.unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 40%;
  background: #0891b2;
  border-radius: 0 3px 3px 0;
}

.ticket-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.ticket-list-id {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.ticket-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ticket-list-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ticket-list-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 6px 0;
  line-height: 1.4;
}

.ticket-list-user-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.ticket-list-user-name {
  font-size: 12px;
  color: #64748b;
}

.ticket-list-meta {
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 4px 0;
}

.ticket-list-preview {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-message-count {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── RIGHT PANEL - CHAT VIEW ─────────────── */
.ticket-chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
  min-width: 0;
}

.ticket-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ticket-chat-header-center {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.ticket-chat-header-center h2 {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

.ticket-chat-header-info {
  flex: 1;
  min-width: 0;
}

.ticket-chat-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ticket-chat-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 2px 0;
}

.ticket-chat-subtitle {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ticket-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ticket-time-display {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
}

.ticket-status-dropdown {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
  outline: none;
}

.ticket-status-dropdown:hover {
  border-color: #cbd5e1;
}

.ticket-close-chat-btn {
  padding: 6px 12px;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.ticket-close-chat-btn:hover {
  background: #fecaca;
}

/* ── AVATAR ──────────────────────────────── */
.ticket-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.ticket-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  flex-shrink: 0;
  user-select: none;
}

.ticket-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid white;
  background: #94a3b8;
}

.ticket-online-dot.online {
  background: #10b981;
}

.ticket-online-dot.offline {
  background: #94a3b8;
}

/* ── MESSAGES (WhatsApp Style: Yours = Right, Theirs = Left) ── */
.ticket-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
   scroll-behavior: auto !important; /* Forces instant jump, blocks smooth scrolling */
  /* ... keep all your existing styles here ... */
}

.ticket-empty-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-size: 14px;
}

.ticket-message {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 75%;
  margin-bottom: 4px;
}

/* YOUR messages (Right side) */
.ticket-message-me {
  align-self: flex-end;
  flex-direction: row-reverse; /* Avatar on right, bubble on left */
}

/* THEIR messages (Left side) */
.ticket-message-other {
  align-self: flex-start;
  flex-direction: row; /* Avatar on left, bubble on right */
}

.ticket-message-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}

/* Align text to the RIGHT for your messages */
.ticket-message-me .ticket-message-content {
  align-items: flex-end;
  text-align: right;
}

/* Align text to the LEFT for their messages */
.ticket-message-other .ticket-message-content {
  align-items: flex-start;
  text-align: left;
}

.ticket-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  padding: 0 4px;
  width: 100%;
}

.ticket-message-me .ticket-message-header {
  justify-content: flex-end;
}

.ticket-message-author {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ticket-role-badge {
  background: #dbeafe;
  color: #2563eb;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.ticket-message-time {
  font-size: 11px;
  color: #94a3b8;
}

.ticket-message-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  max-width: 100%;
}

/* YOUR bubble color (Blue) */
.ticket-message-me .ticket-message-bubble {
  background: #0891b2;
  color: white;
  border-bottom-right-radius: 4px;
}

/* THEIR bubble color (White/Gray) */
.ticket-message-other .ticket-message-bubble {
  background: white;
  color: #0f172a;
  border-bottom-left-radius: 4px;
  border: 1px solid #e2e8f0;
}

.ticket-message-time-ago {
  font-size: 11px;
  color: #94a3b8;
  padding: 0 4px;
  margin-top: 2px;
}

.ticket-message-image-wrapper {
  margin-bottom: 4px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}

.ticket-message-image {
  max-width: 280px;
  max-height: 240px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  transition: transform 0.2s;
}

.ticket-message-image:hover {
  transform: scale(1.02);
}

/* ── TYPING INDICATOR ───────────────────── */
.ticket-typing-text {
  color: #0891b2;
  font-style: italic;
}

.ticket-typing-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 4px;
}

.ticket-typing-dots span {
  width: 4px;
  height: 4px;
  background: #0891b2;
  border-radius: 50%;
  animation: ticket-bounce 1.4s infinite ease-in-out both;
}

.ticket-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.ticket-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes ticket-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ── QUICK REPLIES ──────────────────────── */
.ticket-quick-replies {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
  overflow-x: auto;
  flex-shrink: 0;
}

.ticket-quick-reply-btn {
  padding: 8px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.ticket-quick-reply-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* ── INPUT AREA ─────────────────────────── */
.ticket-input-container {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
  align-items: center;
  flex-shrink: 0;
}

.ticket-message-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  min-width: 0;
}

.ticket-message-input:focus {
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.ticket-send-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #0891b2;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ticket-send-button:hover {
  background: #0c5d73;
}

.ticket-send-button:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.ticket-attach-btn {
  width: 40px;
  height: 40px;
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ticket-attach-btn:hover {
  background: #e2e8f0;
  color: #0891b2;
}

.ticket-attach-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ticket-spin {
  animation: ticket-spin 1s linear infinite;
}

@keyframes ticket-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── NO SELECTION ──────────────────────── */
.ticket-no-selection {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.ticket-no-selection-icon {
  margin-bottom: 16px;
  opacity: 0.5;
}

.ticket-no-selection p {
  font-size: 14px;
}

/* ── USER VIEW SPECIFIC ─────────────────── */
.ticket-user-view {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  position: relative;
}

.ticket-user-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 80px;
}

.ticket-user-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.ticket-user-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.ticket-user-card.unread {
  border-left: 3px solid #0891b2;
}

.ticket-user-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.ticket-user-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ticket-user-id {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

.ticket-user-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.ticket-user-preview {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 8px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-user-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ticket-user-meta {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.ticket-fab-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: #0891b2;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
  transition: all 0.2s;
  z-index: 10;
}

.ticket-fab-button:hover {
  background: #0c5d73;
  transform: translateY(-2px);
}

/* ── CREATE FORM ────────────────────────── */
.ticket-create-form {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #e2e8f0;
}

.ticket-form-header {
  margin-bottom: 24px;
}

.ticket-form-header h2 {
  margin: 8px 0 4px 0;
  font-size: 20px;
  color: #0f172a;
}

.ticket-form-header p {
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
}

.ticket-back-button {
  background: none;
  border: none;
  color: #0891b2;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.ticket-form-group {
  margin-bottom: 16px;
}

.ticket-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ticket-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.ticket-input,
.ticket-select,
.ticket-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
  box-sizing: border-box;
}

.ticket-input:focus,
.ticket-select:focus,
.ticket-textarea:focus {
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.ticket-textarea {
  resize: vertical;
  min-height: 100px;
}

.ticket-submit-button {
  width: 100%;
  padding: 12px;
  background: #0891b2;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ticket-submit-button:hover {
  background: #0c5d73;
}

.ticket-submit-button:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* ── EMPTY STATES ───────────────────────── */
.ticket-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.ticket-empty-icon {
  margin-bottom: 16px;
}

.ticket-empty-sub {
  font-size: 13px;
  margin-top: 4px;
}

/* ── BADGES ─────────────────────────────── */
.ticket-priority-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.ticket-priority-urgent {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.ticket-priority-high {
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
}

.ticket-priority-medium {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.ticket-priority-low {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.ticket-status-badge {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.ticket-status-open {
  background: #dbeafe;
  color: #2563eb;
}

.ticket-status-in_progress {
  background: #fef3c7;
  color: #d97706;
}

.ticket-status-waiting_on_user {
  background: #fce7f3;
  color: #db2777;
}

.ticket-status-resolved {
  background: #d1fae5;
  color: #059669;
}

.ticket-status-closed {
  background: #e2e8f0;
  color: #475569;
}

.ticket-unread-badge {
  background: #0891b2;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* ── SCROLLBAR ──────────────────────────── */
.ticket-list-panel::-webkit-scrollbar,
.ticket-messages-container::-webkit-scrollbar,
.ticket-quick-replies::-webkit-scrollbar,
.ticket-user-view::-webkit-scrollbar {
  width: 6px;
}

.ticket-list-panel::-webkit-scrollbar-track,
.ticket-messages-container::-webkit-scrollbar-track,
.ticket-quick-replies::-webkit-scrollbar-track,
.ticket-user-view::-webkit-scrollbar-track {
  background: transparent;
}

.ticket-list-panel::-webkit-scrollbar-thumb,
.ticket-messages-container::-webkit-scrollbar-thumb,
.ticket-quick-replies::-webkit-scrollbar-thumb,
.ticket-user-view::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.ticket-list-panel::-webkit-scrollbar-thumb:hover,
.ticket-messages-container::-webkit-scrollbar-thumb:hover,
.ticket-quick-replies::-webkit-scrollbar-thumb:hover,
.ticket-user-view::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ── RESPONSIVE ─────────────────────────── */
@media (max-width: 1200px) {
  .ticket-sidebar { width: 220px; }
  .ticket-list-panel { width: 300px; }
}

@media (max-width: 968px) {
  .ticket-main { flex-direction: column; }
  .ticket-sidebar,
  .ticket-list-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    max-height: 280px;
  }
  .ticket-chat-panel { flex: 1; }
  .ticket-message { max-width: 85%; }
}

@media (max-width: 640px) {
  .ticket-chat-header { flex-direction: column; gap: 10px; align-items: flex-start; }
  .ticket-chat-header-actions { width: 100%; justify-content: flex-end; }
  .ticket-form-row { grid-template-columns: 1fr; }
  .ticket-message-image { max-width: 200px; }
}

/* Offline status */
.ticket-connection-status.offline {
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}/* Default: no title bar or status bar (web). The components set these in Electron. */
:root {
  --titlebar-height: 0px;
  --statusbar-height: 0px;
}

/* ============================================================
   TITLE BAR
   ============================================================ */
.custom-titlebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  box-sizing: border-box;

  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px; /* keep in sync with TITLEBAR_HEIGHT in CustomTitleBar.tsx */

  background: linear-gradient(90deg, #e220d5 0%, #c11fb6 45%, #8f1d8a 100%);
  color: #ffffff;
  user-select: none;
  -webkit-app-region: drag;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  transition: filter 0.2s ease, opacity 0.2s ease;
}

/* thin light line along the bottom edge for a crisp finish */
.custom-titlebar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

/* window not focused: calmer, like native apps */
.custom-titlebar.is-inactive {
  filter: saturate(0.55) brightness(0.92);
}
.custom-titlebar.is-inactive .titlebar-text {
  opacity: 0.75;
}

/* ---------- Left: logo + title ---------- */
.titlebar-drag-region {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  height: 100%;
  flex: 1;
  min-width: 0;
}

.titlebar-icon {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.app-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 2px 4px rgba(0, 0, 0, 0.2);
  -webkit-user-drag: none;
}

.titlebar-text {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.25px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* ---------- Right: controls ---------- */
.titlebar-controls {
  display: flex;
  align-items: center;
  height: 100%;
  flex-shrink: 0;
  -webkit-app-region: no-drag;
}

/* Zoom controls group – separated by a soft divider */
.zoom-controls {
  display: flex;
  align-items: center;
  margin-right: 10px;
  padding-right: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
  -webkit-app-region: no-drag;
}

/* Window controls group */
.window-controls {
  display: flex;
  align-items: stretch;
  height: 100%;
  -webkit-app-region: no-drag;
}

.titlebar-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s ease;
  -webkit-app-region: no-drag;
}

.titlebar-btn svg {
  display: block;
  opacity: 0.95;
}

.titlebar-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.titlebar-btn:active {
  background: rgba(255, 255, 255, 0.28);
}

.titlebar-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: -4px;
}

/* Close button: red on hover (now works, the class is applied in the component) */
.titlebar-btn.close-btn:hover {
  background: #e81123;
  color: #ffffff;
}

.titlebar-btn.close-btn:active {
  background: #c50b17;
}

/* Subtle divider between buttons */
.titlebar-btn:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 16px;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.titlebar-btn.close-btn::after {
  display: none;
}

/* ============================================================
   LAYOUT: page content sits between the title bar and status bar.
   Uses the CSS variables (0px on the web, real heights in Electron),
   so nothing is wasted when the bars are not shown.
   ============================================================ */
.app-content-wrapper {
  margin-top: var(--titlebar-height, 0px);
  margin-bottom: var(--statusbar-height, 0px);
  height: calc(100dvh - var(--titlebar-height, 0px) - var(--statusbar-height, 0px));
  overflow-y: auto;
  overflow-x: hidden; /* stops the stray horizontal scrollbar on full-width screens */
}

/* ============================================================
   Fixed overlays must start BELOW the title bar and end ABOVE the
   status bar, so the window can still be dragged / closed while a
   dialog is open.
   ============================================================ */
.med-modal-overlay,
.cdet-overlay,
.lbk-overlay,
.modal-overlay,
.locationConfirmOverlay {
  top: var(--titlebar-height, 0px) !important;
  height: calc(100dvh - var(--titlebar-height, 0px) - var(--statusbar-height, 0px)) !important;
  box-sizing: border-box;
}

.med-modal {
  max-height: calc(100dvh - var(--titlebar-height, 0px) - var(--statusbar-height, 0px) - 32px) !important;
}

.cdet-modal,
.lbk-modal {
  max-height: calc(100dvh - var(--titlebar-height, 0px) - var(--statusbar-height, 0px) - 32px) !important;
}

/* ---------- Small windows ---------- */
@media (max-width: 640px) {
  .titlebar-text { font-size: 12.5px; }
  .zoom-controls { margin-right: 6px; padding-right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .custom-titlebar,
  .titlebar-btn { transition: none; }
}:root {
  --statusbar-height: 0px; /* Default for web – the bar is hidden unless running in Electron */
}

/* =====================================================================
   DESKTOP APP ONLY: keep the whole app above the fixed status bar.
   In a normal browser --statusbar-height is 0px, so none of this has any effect.
   !important is needed because #root and the dashboard containers carry
   inline "overflow:hidden; max-height:none" styles that would otherwise win.
   ===================================================================== */
html.is-electron,
body.is-electron {
  height: calc(100dvh - var(--statusbar-height, 0px)) !important;
  max-height: calc(100dvh - var(--statusbar-height, 0px)) !important;
  overflow: hidden !important; /* no extra page scroll bar on the far right */
}

html.is-electron body,
body.is-electron {
  margin: 0;
}

body.is-electron #root {
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

/* ---------- Bar ---------- */
.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--statusbar-height);
  overflow: hidden; /* when the height is 0px (web) nothing leaks out */
  box-sizing: border-box;

  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;

  background: linear-gradient(180deg, #0a2a6e 0%, #002060 100%);
  color: #dbe4ff;
  font-size: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  z-index: 9999;
  transition: background-color 0.25s ease;
}

/* thin brand accent along the top edge */
.status-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #e820da 0%, #7a2fc4 50%, #0a3190 100%);
  opacity: 0.9;
}

/* offline: the whole bar turns dark red so it can't be missed */
.status-bar.is-offline {
  background: linear-gradient(180deg, #6b1426 0%, #4d0f1c 100%);
}
.status-bar.is-offline::before {
  background: linear-gradient(90deg, #ff5a5a, #c0392b);
}

.status-bar-left,
.status-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* ---------- Items (pill chips) ---------- */
.status-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: background-color 0.15s ease;
  cursor: default;
}

.status-item:hover {
  background: rgba(255, 255, 255, 0.16);
}

.status-icon {
  flex: 0 0 auto;
  color: #b9c9f5;
}

.status-text {
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #eef2ff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Connection ---------- */
.status-dot {
  position: relative;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa5c4;
}

.status-connection.is-online .status-dot {
  background: #3ddc84;
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
  animation: statusPulse 2.4s ease-out infinite;
}
.status-connection.is-online .status-icon { color: #7ef0ad; }

.status-connection.is-offline {
  background: rgba(255, 90, 90, 0.18);
}
.status-connection.is-offline .status-dot { background: #ff5a5a; }
.status-connection.is-offline .status-icon { color: #ff8f8f; }
.status-connection.is-offline .status-text { color: #ffd6d6; }

.status-message {
  font-size: 12px;
  font-weight: 600;
  color: #ffd6d6;
  white-space: nowrap;
}

@keyframes statusPulse {
  0%   { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

/* ---------- Small windows ---------- */
@media (max-width: 520px) {
  .status-message { display: none; }
  .status-item { padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .status-bar,
  .status-item { transition: none; }
  .status-connection.is-online .status-dot { animation: none; }
}/* UpdateNotifier.css – self-contained (no Tailwind needed). Everything is prefixed upd-. */

:root { --upd-top: 64px; } /* sits just under the custom title bar */

/* ---------- Toasts (downloading / error) ---------- */
.upd-toast {
  position: fixed;
  top: var(--upd-top);
  right: 16px;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(340px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #1b2430;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.22);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  animation: updSlideIn .25s ease-out;
}

.upd-toast.is-error { background: #fef2f2; border-color: #fecaca; }

.upd-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.upd-toast-icon.is-blue { background: #e8f0ff; color: #1650c7; }
.upd-toast-icon.is-red { background: #fee2e2; color: #dc2626; }

.upd-toast-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.upd-toast-body strong { font-size: 13.5px; font-weight: 700; }
.upd-toast.is-error .upd-toast-body strong { color: #991b1b; }
.upd-toast-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.upd-toast-sub { font-size: 12px; color: #64748b; line-height: 1.4; }
.upd-toast.is-error .upd-toast-sub { color: #b45454; }
.upd-percent { font-size: 12.5px; font-weight: 800; color: #1650c7; font-variant-numeric: tabular-nums; }

.upd-progress { width: 100%; height: 6px; border-radius: 999px; background: #e8edf5; overflow: hidden; }
.upd-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1650c7, #e820da);
  transition: width .3s ease-out;
}

.upd-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}
.upd-x:hover { background: rgba(0, 0, 0, .07); color: #475467; }

/* ---------- Chip (after "Remind me later") ---------- */
.upd-chip {
  position: fixed;
  top: var(--upd-top);
  right: 16px;
  z-index: 99999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px 0 12px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #002060, #0a3190);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 32, 96, 0.4);
  animation: updSlideIn .25s ease-out;
}
.upd-chip svg { color: #ffd54a; }
.upd-chip strong {
  padding: 4px 11px;
  border-radius: 999px;
  background: #10b981;
  font-size: 12px;
  font-weight: 700;
}
.upd-chip:hover { filter: brightness(1.1); }

/* ---------- Dialog ---------- */
.upd-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  animation: updFade .2s ease-out;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.upd-modal {
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  color: #1b2430;
  text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.45);
  animation: updPop .22s ease-out;
}

.upd-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 24px 20px;
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(232, 32, 218, .35) 0%, rgba(232, 32, 218, 0) 55%),
    linear-gradient(160deg, #002060 0%, #0a3190 100%);
}

.upd-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #ffd54a;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .08);
}

.upd-hero h3 { margin: 6px 0 0; font-size: 21px; font-weight: 800; color: #fff; letter-spacing: .01em; }

.upd-versions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
  font-size: 12.5px;
  font-weight: 600;
  color: #d5e0fb;
}
.upd-versions strong { color: #fff; font-weight: 800; }

.upd-body { padding: 18px 26px 6px; }
.upd-body p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; color: #475467; }
.upd-body .upd-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 12.5px;
  font-weight: 600;
}

.upd-actions { display: flex; flex-direction: column; gap: 10px; padding: 18px 26px 24px; }

.upd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.upd-btn:disabled { opacity: .7; cursor: not-allowed; }

.upd-btn-primary { background: #059669; color: #fff; box-shadow: 0 4px 12px rgba(5, 150, 105, .35); }
.upd-btn-primary:hover:not(:disabled) { background: #047857; transform: translateY(-1px); }
.upd-btn-primary:focus-visible { outline: 3px solid rgba(5, 150, 105, .35); outline-offset: 2px; }

.upd-btn-ghost { background: #fff; color: #475467; border-color: #d0d7e2; font-size: 14px; font-weight: 600; }
.upd-btn-ghost:hover:not(:disabled) { background: #f1f5f9; color: #1b2430; }

.upd-spin { animation: updSpin .8s linear infinite; }

@keyframes updSpin { to { transform: rotate(360deg); } }
@keyframes updFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes updPop { from { opacity: 0; transform: scale(.95) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes updSlideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .upd-toast, .upd-chip, .upd-overlay, .upd-modal, .upd-spin { animation: none !important; }
  .upd-progress-bar, .upd-btn { transition: none !important; }
}