/* ===================================================================
   STELLAR PORTAL - GLASSMORPHISM SYSTEM
   Centralized glass styling for all pages — single source of truth.
   Login page, app shell, and all components are styled here.
   =================================================================== */

/* ─── Z-index: text always on top of glass surfaces ─────────────── */
.glass-card > *,
.glass-card-elevated > *,
.glass-stat-card > *,
.glass-table > * {
  position: relative;
  z-index: 2;
}
h1, h2, h3, h4, h5, h6, p, span, div, label, input, select, button {
  position: relative;
  z-index: 1;
}

/* =============================================================
   GLASS SURFACE STACKING LADDER
   Every surface that sits closer to the user gets darker, so
   text remains readable on any background image (light or dark).

   L1 subtle  0.82  recessed / secondary content
   L1 card    0.88  primary content containers
   L2 header  0.90  section headers / tab bars
   L2 elevated 0.92  cards that float above other cards
   L3 modal   0.95  overlaid panels (own backdrop, nearly opaque)
   ============================================================= */

/* Base Glass Card - L1 (primary content container) */
.glass-card {
  background: rgba(8, 12, 24, 0.88) !important;
  backdrop-filter: blur(40px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45) !important;
  color: #e2e8f0 !important;
  position: relative;
  z-index: 1;
}

/* Glass Card - Elevated - L2 (floats above base card) */
.glass-card-elevated {
  background: rgba(6, 9, 18, 0.92) !important;
  backdrop-filter: blur(44px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(44px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55) !important;
  color: #e2e8f0 !important;
  position: relative;
  z-index: 2;
}

/* Glass Card - Subtle - L1 light (recessed / secondary panels) */
.glass-card-subtle {
  background: rgba(8, 12, 24, 0.82) !important;
  backdrop-filter: blur(36px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(36px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
  color: #e2e8f0 !important;
  position: relative;
  z-index: 1;
}

/* Glass Header - L2 (section titles above base cards) */
.glass-header {
  background: rgba(10, 15, 30, 0.72) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 16px !important;
  box-shadow: rgba(0, 0, 0, 0.4) 0px 8px 32px !important;
  color: #f1f5f9 !important;
  font-weight: 600;
  position: relative;
  z-index: 2;
}

/* Glass Card - Danger - alert/urgent state (dark red tint) */
.glass-card-danger {
  background: rgba(30, 8, 8, 0.92) !important;
  backdrop-filter: blur(40px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
  position: relative;
  z-index: 2;
}

/* Glass Card - Warning - action-required state (dark amber tint) */
.glass-card-warning {
  background: rgba(28, 18, 4, 0.92) !important;
  backdrop-filter: blur(40px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
  border: 1px solid rgba(251, 191, 36, 0.4) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px rgba(251, 191, 36, 0.08) !important;
  color: #fde68a !important;
  position: relative;
  z-index: 2;
}

/* Glass Input/Select Fields */
.glass-input {
  background: rgba(15, 23, 41, 0.65) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 10px !important;
  color: #e2e8f0 !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.glass-input:focus {
  border-color: rgba(102, 126, 234, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
  outline: 2px solid #667eea !important;
  outline-offset: 2px !important;
}

.glass-input::placeholder {
  color: #94a3b8 !important;
}

/* Datetime-local input - calendar icon styling */
.glass-input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.5);
  cursor: pointer;
  opacity: 0.8;
}

.glass-input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.glass-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.5);
  cursor: pointer;
  opacity: 0.8;
}

.glass-input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.glass-input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.5);
  cursor: pointer;
  opacity: 0.8;
}

/* Glass Button - Primary */
.glass-button-primary {
  background: #2563eb !important;
  backdrop-filter: blur(10px) !important;
  border: none !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  padding: 10px 20px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  min-height: 44px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

.glass-button-primary:hover {
  background: #1d4ed8 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  transform: translateY(-1px);
}

/* Glass Button - Secondary */
.glass-button-secondary {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 10px !important;
  color: #e2e8f0 !important;
  padding: 10px 20px !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  min-height: 44px !important;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.glass-button-secondary:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

/* Glass Badge (for status indicators, counts) */
.glass-badge {
  background: rgba(102, 126, 234, 0.25) !important;
  backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(102, 126, 234, 0.4) !important;
  color: #a5b4fc !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  display: inline-block;
  position: relative;
  z-index: 1;
}

/* Glass Table Container */
.glass-table {
  background: rgba(8, 12, 24, 0.88) !important;
  backdrop-filter: blur(40px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35) !important;
  position: relative;
  z-index: 1;
}

/* Glass Tab Bar */
.glass-tabs {
  background: rgba(6, 9, 18, 0.88) !important;
  backdrop-filter: blur(36px) !important;
  -webkit-backdrop-filter: blur(36px) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 12px !important;
  display: flex;
  gap: 4px;
  padding: 6px;
  position: relative;
  z-index: 2;
}

/* Individual Tab - Standard (for horizontal tab bars) */
.glass-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.glass-tab:hover {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
}

.glass-tab.active {
  border-bottom-color: #667eea;
  color: #e2e8f0;
  background: rgba(102, 126, 234, 0.1);
}

/* Navigation Tabs Container */
.glass-nav-tabs {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 12px;
}

/* Navigation Tab - Pill style (for page navigation) */
.glass-nav-tab {
  flex: 1;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(8, 12, 24, 0.88);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  color: #e2e8f0;
  text-shadow: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.glass-nav-tab:hover {
  background: rgba(6, 9, 18, 0.92);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.glass-nav-tab-active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: rgba(37, 99, 235, 0.5) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Text Contrast Fix - Ensures text is always readable */
.glass-card *,
.glass-card-elevated *,
.glass-header *,
.glass-table * {
  color: inherit; /* Inherit light colors from parent */
}

/* Override any gray text inside glass */
.glass-card .text-gray-500,
.glass-card .text-gray-600,
.glass-card-elevated .text-gray-500,
.glass-card-elevated .text-gray-600 {
  color: #cbd5e1 !important; /* Light gray instead of dark gray */
}

/* ===================================================================
   GLASS TEXT UTILITIES
   Consistent text colors for glass components
   =================================================================== */

/* Primary text - brightest, most readable */
.glass-text-primary {
  color: #f1f5f9 !important; /* slate-100 */
}

/* Heading text - slightly dimmer than primary but still prominent */
.glass-text-heading {
  color: #e2e8f0 !important; /* slate-200 */
}

/* Secondary text - for less important info */
.glass-text-secondary {
  color: #cbd5e1 !important; /* slate-300 */
}

/* Muted text - subtle, low contrast */
.glass-text-muted {
  color: #94a3b8 !important; /* slate-400 */
}

/* Success text */
.glass-text-success {
  color: #6ee7b7 !important; /* emerald-300 */
}

/* Warning text */
.glass-text-warning {
  color: #fcd34d !important; /* yellow-300 */
}

/* Error text */
.glass-text-error {
  color: #fca5a5 !important; /* red-300 */
}

/* Info text (accent color) */
.glass-text-accent {
  color: #a5b4fc !important; /* indigo-300 */
}

/* Hero Stats Cards (Dashboard stats) */
.glass-stat-card {
  background: rgba(8, 12, 24, 0.88) !important;
  backdrop-filter: blur(40px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* Warning/Alert Glass */
.glass-warning {
  background: rgba(251, 146, 60, 0.2) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(251, 146, 60, 0.4) !important;
  border-radius: 12px !important;
  color: #fcd34d !important;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(251, 146, 60, 0.2) !important;
  position: relative;
  z-index: 1;
}

/* Success/Info Glass */
.glass-success {
  background: rgba(16, 185, 129, 0.2) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  border-radius: 12px !important;
  color: #6ee7b7 !important;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2) !important;
  position: relative;
  z-index: 1;
}

/* Card variant for nesting inside other dark panels (no heavy blur/opacity) */
.glass-card-inner {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #e2e8f0;
}

/* ===================================================================
   RESPONSIVE ADJUSTMENTS
   =================================================================== */

/* Prevent horizontal scroll on all screens */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

@media (max-width: 768px) {
  .glass-card,
  .glass-card-elevated {
    border-radius: 12px !important;
    padding: 16px !important;
  }

  .glass-header {
    border-radius: 10px !important;
    padding: 12px !important;
  }

  /* Nav tabs: smaller padding and font on mobile */
  .glass-nav-tabs {
    padding: 0 8px !important;
    gap: 4px !important;
    margin-bottom: 8px !important;
  }

  .glass-nav-tab {
    padding: 10px 6px !important;
    font-size: 12px !important;
  }

  /* Stat cards grid: already flex but ensure text fits */
  .glass-stat-card {
    padding: 14px !important;
  }
}

/* Mobile: header adjustments */
@media (max-width: 600px) {
  /* Hide logout button from header — it lives in the drawer on mobile */
  .hdr-logout { display: none !important; }

  /* Show username as icon-only — saves ~80px in the header */
  .hdr-profile-text { display: none !important; }

  /* Profile button: tighten padding when text is hidden */
  .hdr-profile-btn {
    padding: 10px 12px !important;
  }

  /* Shrink spacer that compensates for the fixed hamburger button */
  .hdr-spacer { width: 56px !important; }

  /* Page main content: tighter side padding on mobile */
  .page-main-content {
    padding: 12px !important;
  }
}

/* ===================================================================
   DARK MODE SUPPORT (for future use)
   =================================================================== */

[data-theme="dark"] .glass-card {
  background: rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .glass-card-elevated {
  background: rgba(0, 0, 0, 0.45) !important;
}

/* ===================================================================
   SCROLLABLE GLASS CONTAINERS
   Custom scrollbar styling for scrollable glass components
   =================================================================== */

.glass-scrollable::-webkit-scrollbar {
  width: 6px;
}

.glass-scrollable::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.glass-scrollable::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.4);
  border-radius: 10px;
}

.glass-scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.6);
}

/* Firefox scrollbar styling */
.glass-scrollable {
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 126, 234, 0.4) rgba(0, 0, 0, 0.2);
}

/* ===================================================================
   GLASS MODAL SYSTEM
   Modern glassmorphic modal styling
   =================================================================== */

/* Modal Backdrop - Semi-transparent overlay with blur */
.glass-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  overflow-y: auto;
  animation: glassModalFadeIn 0.2s ease-out;
}

/* Modal Container */
.glass-modal {
  background: #0f1729 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.75) !important;
  color: #e2e8f0 !important;
  max-height: calc(100vh - 80px);
  overflow: hidden;
  animation: glassModalSlideUp 0.3s ease-out;
  position: relative;
  z-index: 1;
}

/* Modal Header */
.glass-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 2;
}

.glass-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
}

.glass-modal-subtitle {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* Modal Body */
.glass-modal-body {
  padding: 24px;
  max-height: calc(90vh - 140px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 126, 234, 0.4) rgba(0, 0, 0, 0.2);
}

.glass-modal-body::-webkit-scrollbar {
  width: 6px;
}

.glass-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.glass-modal-body::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.4);
  border-radius: 10px;
}

.glass-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.6);
}

/* Modal Footer */
.glass-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
}

/* Modal Close Button */
.glass-modal-close {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px !important;
  color: #94a3b8 !important;
  padding: 8px !important;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.glass-modal-close:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

/* Modal Animations */
@keyframes glassModalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* ===================================================================
   GLASS FORM ELEMENTS
   Styled form components for glass modals
   =================================================================== */

/* Form Group Container */
.glass-form-group {
  margin-bottom: 20px;
}

/* Form Label */
.glass-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 8px;
}

/* Required Field Indicator */
.glass-label-required::after {
  content: " *";
  color: #f87171;
}

/* Error messages: pair color with a text indicator for color-blind users */
.glass-error-msg {
  color: #f87171;
  font-size: 0.875rem;
  margin-top: 4px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.glass-error-msg::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #f87171;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Textarea */
.glass-textarea {
  background: rgba(15, 23, 41, 0.65) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 10px !important;
  color: #e2e8f0 !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  min-height: 80px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

.glass-textarea:focus {
  border-color: rgba(102, 126, 234, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
  outline: 2px solid #667eea !important;
  outline-offset: 2px !important;
}

.glass-textarea::placeholder {
  color: #94a3b8 !important;
}

/* Info Card (for displaying calculated values) */
.glass-info-card {
  background: rgba(15, 23, 41, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 10px !important;
  padding: 12px 16px !important;
  color: #e2e8f0 !important;
}

/* Glass Button - Danger/Delete */
.glass-button-danger {
  background: rgba(220, 38, 38, 0.8) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(220, 38, 38, 0.6) !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  padding: 10px 20px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  min-height: 44px !important;
  cursor: pointer;
  transition: all 0.3s ease;
}

.glass-button-danger:hover {
  background: rgba(220, 38, 38, 1) !important;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4) !important;
}

/* Glass Button - Success */
.glass-button-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  backdrop-filter: blur(10px) !important;
  border: none !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  padding: 10px 20px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  min-height: 44px !important;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4) !important;
  cursor: pointer;
  transition: all 0.3s ease;
}

.glass-button-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5) !important;
}

/* Glass Button - Disabled state */
.glass-button-primary:disabled,
.glass-button-secondary:disabled,
.glass-button-danger:disabled,
.glass-button-success:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Glass Button - Small Variant */
.glass-button-sm {
  padding: 6px 12px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
}

/* Glass Entry Card (for time entries, list items) */
.glass-entry-card {
  background: rgba(26, 35, 50, 0.8) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  padding: 16px !important;
  transition: all 0.2s ease;
}

.glass-entry-card:hover {
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

/* Glass Summary Card (for totals/stats inside modals) */
.glass-summary-card {
  background: rgba(26, 35, 50, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 10px !important;
  padding: 14px !important;
}

/* Glass Badge Variants */
.glass-badge-success {
  background: rgba(34, 197, 94, 0.2) !important;
  border: 1px solid rgba(34, 197, 94, 0.4) !important;
  color: #4ade80 !important;
}

.glass-badge-warning {
  background: rgba(251, 191, 36, 0.2) !important;
  border: 1px solid rgba(251, 191, 36, 0.4) !important;
  color: #fbbf24 !important;
}

.glass-badge-danger {
  background: rgba(239, 68, 68, 0.2) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
}

.glass-badge-info {
  background: rgba(59, 130, 246, 0.2) !important;
  border: 1px solid rgba(59, 130, 246, 0.4) !important;
  color: #60a5fa !important;
}

/* Glass Details/Accordion */
.glass-details {
  background: rgba(15, 23, 41, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 10px !important;
  overflow: hidden;
}

.glass-details summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #94a3b8;
  transition: all 0.2s ease;
}

.glass-details summary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

.glass-details[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-details-content {
  padding: 16px;
}

/* ===================================================================
   RESPONSIVE MODAL ADJUSTMENTS
   =================================================================== */

@media (max-width: 768px) {
  .glass-modal {
    margin: 10px;
    border-radius: 12px !important;
  }
  
  .glass-modal-header {
    padding: 16px;
  }
  
  .glass-modal-body {
    padding: 16px;
  }
  
  .glass-modal-footer {
    padding: 12px 16px;
    flex-direction: column;
  }
  
  .glass-modal-footer button {
    width: 100%;
  }
}

/* ===================================================================
   PHONE BREAKPOINT (max 639px)
   =================================================================== */

@media (max-width: 639px) {
  /* Cards: tighter padding, no border-radius mismatch */
  .glass-card,
  .glass-card-elevated {
    padding: 12px !important;
    border-radius: 8px !important;
  }

  .glass-header {
    padding: 10px 12px !important;
    border-radius: 8px !important;
  }

  /* Tabs: scrollable row instead of wrapping */
  .glass-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .glass-tabs::-webkit-scrollbar {
    display: none;
  }

  .glass-tab {
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Modals: near full-screen on phone */
  .glass-modal {
    margin: 6px !important;
    width: calc(100vw - 12px) !important;
    max-width: none !important;
    border-radius: 10px !important;
  }

  /* Tables: horizontal scroll wrapper */
  .glass-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Inputs and buttons: full-width on phone for easier tapping */
  .glass-input,
  .glass-textarea,
  .glass-select {
    font-size: 16px !important;
  }

  .glass-button-primary,
  .glass-button-secondary,
  .glass-button-danger,
  .glass-button-success {
    width: 100%;
    justify-content: center;
  }

  /* Form groups stack naturally; reduce gap */
  .glass-form-group {
    margin-bottom: 14px;
  }
}

/* ===================================================================
   PAGE CONTENT WRAPPER
   =================================================================== */

.glass-page-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
}

@media (max-width: 639px) {
  .glass-page-content {
    padding: 12px;
  }
}

/* ===================================================================
   GLASS TABLE INNER
   For tables rendered inside .glass-card or .glass-table containers
   =================================================================== */

.glass-table-inner {
  width: 100%;
  border-collapse: collapse;
  color: #e2e8f0;
}

.glass-table-inner th {
  padding: 10px 14px;
  text-align: left;
  background: rgba(6, 9, 18, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.glass-table-inner td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
  color: #e2e8f0;
}

.glass-table-inner tr:last-child td {
  border-bottom: none;
}

.glass-table-inner tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* ===================================================================
   UPLOAD ZONE
   Drag-and-drop file upload area
   =================================================================== */

.glass-upload-zone {
  background: rgba(8, 12, 24, 0.55) !important;
  border: 2px dashed rgba(255, 255, 255, 0.28) !important;
  border-radius: 16px !important;
  cursor: pointer;
  transition: all 0.25s ease;
}

.glass-upload-zone:hover {
  background: rgba(102, 126, 234, 0.12) !important;
  border-color: rgba(102, 126, 234, 0.5) !important;
}

.glass-upload-zone-active {
  background: rgba(102, 126, 234, 0.18) !important;
  border-color: rgba(102, 126, 234, 0.7) !important;
  border-style: dashed !important;
  box-shadow: 0 0 24px rgba(102, 126, 234, 0.25) !important;
}

/* ===================================================================
   FILE LIST ITEM
   Row in the upload history list
   =================================================================== */

.glass-file-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: rgba(26, 35, 50, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  border-radius: 10px !important;
  transition: all 0.2s ease;
}

.glass-file-item:hover {
  background: rgba(26, 35, 50, 0.90) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

/* ===================================================================
   DARK SELECT OPTIONS
   Prevents browser-default white dropdown on dark inputs
   =================================================================== */

select.glass-input option {
  background: #0f1729;
  color: #e2e8f0;
}

/* ===================================================================
   TOAST NOTIFICATIONS
   Fixed-position transient alerts
   =================================================================== */

.glass-toast {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  animation: glassModalFadeIn 0.2s ease-out;
  white-space: nowrap;
  pointer-events: none;
}

.glass-toast-error {
  background: rgba(220, 38, 38, 0.92) !important;
  border: 1px solid rgba(239, 68, 68, 0.6) !important;
  color: #fff !important;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4) !important;
}

.glass-toast-warning {
  background: rgba(146, 80, 0, 0.92) !important;
  border: 1px solid rgba(251, 191, 36, 0.55) !important;
  color: #fde68a !important;
  box-shadow: 0 4px 20px rgba(251, 146, 60, 0.35) !important;
}

.glass-toast-success {
  background: rgba(22, 101, 52, 0.92) !important;
  border: 1px solid rgba(74, 222, 128, 0.45) !important;
  color: #bbf7d0 !important;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3) !important;
}

.glass-toast-info {
  background: rgba(30, 58, 138, 0.92) !important;
  border: 1px solid rgba(96, 165, 250, 0.45) !important;
  color: #bfdbfe !important;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3) !important;
}

/* ===================================================================
   PAYROLL CALENDAR
   BEM-style classes — all layout and visual state for PayrollCalendar
   =================================================================== */

/* Outer layout: single column; switches to side-by-side with detail */
.payroll-cal {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
  color: #e2e8f0;
}

.payroll-cal--with-panel {
  grid-template-columns: 1fr 320px;
}

/* Navigation bar */
.payroll-cal__nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.payroll-cal__nav-title {
  font-weight: 700;
  font-size: 18px;
  flex: 1;
  text-align: center;
  color: #e2e8f0;
}

/* Compact nav buttons (override glass-button-secondary min-height/padding) */
.payroll-cal__nav-btn {
  padding: 6px 14px !important;
  min-height: unset !important;
}

/* Legend */
.payroll-cal__legend {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #e2e8f0;
}

.payroll-cal__legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.payroll-cal__legend-dot--pay {
  background: #22c55e;
  border-radius: 8px;
  width: 10px;
  height: 10px;
  display: inline-block;
  flex-shrink: 0;
}

.payroll-cal__legend-dot--cutoff {
  background: #ef4444;
  border-radius: 8px;
  width: 10px;
  height: 10px;
  display: inline-block;
  flex-shrink: 0;
}

/* Day-of-week header row */
.payroll-cal__dow-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.payroll-cal__dow-label {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  padding: 4px 0;
}

/* Week row */
.payroll-cal__week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

/* Day cell — default glass tint */
.payroll-cal__cell {
  min-height: 72px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(10, 15, 30, 0.55);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.12s, border-color 0.12s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Empty filler cells (blank slots before day 1 / after last day) */
.payroll-cal__cell--empty {
  background: transparent !important;
  border-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  cursor: default;
}

/* Clickable day */
.payroll-cal__cell--day {
  cursor: pointer;
}

.payroll-cal__cell--day:hover {
  background: rgba(10, 15, 30, 0.75);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Today highlight */
.payroll-cal__cell--today {
  background: rgba(96, 165, 250, 0.08) !important;
  border: 1.5px solid rgba(96, 165, 250, 0.3) !important;
}

/* Selected day */
.payroll-cal__cell--selected {
  background: rgba(96, 165, 250, 0.22) !important;
  border: 1.5px solid rgba(96, 165, 250, 0.65) !important;
}

/* Day number label */
.payroll-cal__day-num {
  font-size: 13px;
  font-weight: 400;
  color: #e2e8f0;
}

.payroll-cal__day-num--today {
  color: #60a5fa;
}

.payroll-cal__day-num--selected {
  font-weight: 700;
}

/* Badge wrapper */
.payroll-cal__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
}

/* Pay date badge */
.payroll-cal__badge--pay {
  background: #22c55e;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  color: #fff;
  font-weight: 600;
}

/* Cutoff badge */
.payroll-cal__badge--cutoff {
  background: #ef4444;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  color: #fff;
  font-weight: 600;
}

/* Detail panel — reuses glass-card for the glass surface */
.payroll-cal__detail {
  padding: 16px !important;
  border-radius: 12px !important;
}

/* Detail panel header row */
.payroll-cal__detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.payroll-cal__detail-title {
  font-weight: 700;
  color: #e2e8f0;
}

/* Compact close button */
.payroll-cal__detail-close {
  padding: 2px 10px !important;
  font-size: 13px !important;
  min-height: unset !important;
}

/* Empty state text */
.payroll-cal__detail-empty {
  color: #94a3b8;
  font-size: 13px;
}

/* Section blocks inside detail panel */
.payroll-cal__detail-section {
  margin-bottom: 12px;
}

/* Section headings */
.payroll-cal__detail-section-title--pay {
  font-size: 11px;
  font-weight: 700;
  color: #22c55e;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.payroll-cal__detail-section-title--cutoff {
  font-size: 11px;
  font-weight: 700;
  color: #ef4444;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Event rows */
.payroll-cal__event-row {
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
}

.payroll-cal__event-row--pay {
  background: rgba(34, 197, 94, 0.08);
  border-left: 3px solid #22c55e;
}

.payroll-cal__event-row--cutoff {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #ef4444;
}

.payroll-cal__event-name {
  font-weight: 600;
  color: #e2e8f0;
}

.payroll-cal__event-meta {
  color: #94a3b8;
  font-size: 12px;
}

.payroll-cal__event-meta span {
  color: #e2e8f0;
}

@media (max-width: 768px) {
  .payroll-cal--with-panel {
    grid-template-columns: 1fr;
  }
}

/* ===================================================================
   GLASS FORM SYSTEM — MODIFIERS & UTILITIES
   All form input/select/textarea visual state lives here.
   =================================================================== */

/* Compact input — table cells, tight filter rows */
.glass-input--sm {
  padding: 5px 8px !important;
  font-size: 13px !important;
  border-radius: 6px !important;
  min-height: unset !important;
}

/* Narrow input — time pickers, small inline fields */
.glass-input--narrow {
  width: auto !important;
  max-width: 140px !important;
}

/* Borderless input — sits inside a chip container; no bg/border of its own */
.glass-input--borderless {
  background: transparent !important;
  border: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  padding: 4px 6px !important;
  min-height: unset !important;
  width: auto !important;
  flex: 1;
  min-width: 120px;
}

/* Chip container — wraps email chips + inline input */
.glass-chip-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(15, 23, 41, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 10px !important;
  min-height: 44px;
  box-sizing: border-box;
}

/* Email / tag chip */
.glass-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: #a5b4fc;
  font-size: 13px;
}

.glass-chip__remove {
  background: none;
  border: none;
  color: #a5b4fc;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
  margin-left: 2px;
}

.glass-chip__remove:hover {
  opacity: 1;
  color: #f87171;
}

/* Label that wraps an input as a flex column (ManualEntry, ProfilePage) */
.glass-label-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
}

/* Inline alert — validation error banner inside a form */
.glass-alert-error {
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  border-radius: 10px !important;
  color: #f87171 !important;
  font-size: 14px;
  font-weight: 600;
}

/* Inline alert — validation warning banner inside a form */
.glass-alert-warning {
  padding: 12px 16px;
  background: rgba(251, 191, 36, 0.12) !important;
  border: 1px solid rgba(251, 191, 36, 0.4) !important;
  border-radius: 10px !important;
  color: #fbbf24 !important;
  font-size: 14px;
  font-weight: 600;
}

/* Section card — sub-panel within a page (lighter than glass-card) */
.glass-section-card {
  background: rgba(8, 12, 24, 0.72) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  padding: 16px !important;
  color: #e2e8f0 !important;
}

/* Preview pane — read-only content panel (email preview, etc.) */
.glass-preview-pane {
  background: rgba(6, 9, 18, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  border-radius: 10px !important;
  padding: 12px !important;
  color: #e2e8f0 !important;
  min-height: 120px;
}

/* Stat pill — calculated value display (total hours, etc.) */
.glass-stat-pill {
  background: rgba(99, 102, 241, 0.2) !important;
  border: 1px solid rgba(99, 102, 241, 0.4) !important;
  color: #a5b4fc !important;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  font-weight: 700;
  text-align: center;
  font-size: 15px;
}

/* Dark select option — prevents white dropdown on dark selects */
select.glass-input option,
select.glass-input--sm option {
  background: #0f1729;
  color: #e2e8f0;
}

/* =====================================================================
   Filter Bar System
   FilterBar + FilterChip + DateRangeChip
   ===================================================================== */

/* Outer row: search input + chips + clear-all */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* Search slot */
.filter-bar-search {
  position: relative;
  min-width: 180px;
  max-width: 300px;
  flex: 1;
}

.filter-bar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.35);
  font-size: 14px;
  pointer-events: none;
  line-height: 1;
}

.filter-bar-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 14px 9px 36px;
  background: rgba(15, 23, 41, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  color: #e2e8f0;
  font-size: 14px;
  outline: none;
  color-scheme: dark;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-bar-search-input:focus {
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.filter-bar-search-input::placeholder {
  color: #64748b;
}

/* Chips row — flex-grows to fill remaining space */
.filter-bar-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

/* Global clear-all button */
.filter-bar-clear {
  background: none;
  border: none;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.filter-bar-clear:hover {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
}

/* =====================================================================
   Filter Chip
   ===================================================================== */

/* Wrapper must be position:relative so the dropdown can be absolute */
.filter-chip-wrapper {
  position: relative;
}

/* The chip button */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(15, 23, 41, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.filter-chip:hover {
  border-color: rgba(102, 126, 234, 0.5);
  color: #e2e8f0;
}

/* Active: chip has a filter value applied */
.filter-chip.is-active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.55);
  color: #a5b4fc;
}

.filter-chip.is-active:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.7);
}

/* Open: dropdown is visible */
.filter-chip.is-open {
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
  outline: none;
}

/* Count badge inside multi-select chip */
.filter-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: rgba(99, 102, 241, 0.45);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #c7d2fe;
  line-height: 1;
}

/* Down-arrow chevron */
.filter-chip-arrow {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  transition: transform 0.15s;
}

.filter-chip.is-open .filter-chip-arrow {
  transform: rotate(180deg);
}

/* =====================================================================
   Filter Dropdown Panel
   ===================================================================== */

.filter-dropdown {
  /* Portaled to document.body — position coords set via CSS vars from JS */
  position: fixed;
  top: var(--fdrop-top, 0);
  left: var(--fdrop-left, auto);
  right: var(--fdrop-right, auto);
  min-width: 200px;
  max-width: 280px;
  background: #0f1729;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
  z-index: 10100;
  overflow: hidden;
  animation: filterDropOpen 0.12s ease-out;
}

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

/* Scrollable option list inside the dropdown */
.filter-dropdown-options {
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
}

/* Single option row */
.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
  transition: background 0.1s, color 0.1s;
}

.filter-option:hover {
  background: rgba(99, 102, 241, 0.12);
  color: #e2e8f0;
}

.filter-option.is-selected {
  color: #a5b4fc;
}

/* Checkbox box for multi-select */
.filter-option-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  color: #a5b4fc;
  transition: border-color 0.1s, background 0.1s;
}

.filter-option.is-selected .filter-option-check {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.6);
}

.filter-option-label {
  flex: 1;
}

/* Action bar at bottom of dropdown */
.filter-dropdown-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-dropdown-clear {
  flex: 1;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.filter-dropdown-clear:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.filter-dropdown-apply {
  flex: 1;
  padding: 7px 10px;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: 8px;
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
}

.filter-dropdown-apply:hover {
  background: rgba(99, 102, 241, 0.4);
}

/* Flush variant: remove side padding (used inside text-input dropdowns) */
.filter-dropdown-actions.flush {
  padding-left: 0;
  padding-right: 0;
}

/* Text input inside a dropdown (e.g. PayPeriod ID) */
.filter-dropdown-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  background: rgba(15, 23, 41, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 13px;
  outline: none;
  color-scheme: dark;
  transition: border-color 0.15s;
}

.filter-dropdown-input:focus {
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.filter-dropdown-input::placeholder {
  color: #64748b;
}

/* Text-input-mode chip: the input panel wrapper */
.filter-dropdown-input-body {
  padding: 10px 12px;
}

/* =====================================================================
   Date Range Chip Specific
   ===================================================================== */

.filter-date-dropdown {
  min-width: 260px;
  max-width: 320px;
}

/* Padded wrapper for a FilterBar inside a card */
.filter-bar-section {
  padding: 16px 20px;
}

/* 2-column preset grid */
.filter-date-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 12px 12px 8px;
}

.filter-date-preset {
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.filter-date-preset:hover {
  background: rgba(99, 102, 241, 0.12);
  color: #e2e8f0;
}

.filter-date-preset.is-active {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.55);
  color: #a5b4fc;
}

/* Custom date inputs section */
.filter-date-custom {
  padding: 4px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 4px;
}

.filter-date-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-date-custom-label {
  font-size: 12px;
  color: #64748b;
  width: 28px;
  flex-shrink: 0;
}

.filter-date-custom-input {
  flex: 1;
  padding: 6px 10px;
  background: rgba(15, 23, 41, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 13px;
  outline: none;
  color-scheme: dark;
  transition: border-color 0.15s;
}

.filter-date-custom-input:focus {
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.filter-date-custom-input::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.5);
  cursor: pointer;
  opacity: 0.7;
}

/* Autocomplete search wrapper inside a FilterBar (position:relative needed for suggestions) */
.filter-bar-autocomplete {
  position: relative;
  min-width: 220px;
  flex: 1;
}

/* Suggestions dropdown panel */
.filter-autocomplete-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #0f1729;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  z-index: 1001;
  max-height: 220px;
  overflow-y: auto;
}

.filter-autocomplete-option {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s;
}

.filter-autocomplete-option:hover {
  background: rgba(99, 102, 241, 0.1);
}

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

.filter-autocomplete-name {
  font-weight: 600;
  font-size: 14px;
  color: #e2e8f0;
}

.filter-autocomplete-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-width: 640px) {
  .filter-bar {
    gap: 8px;
  }

  .filter-bar-search {
    max-width: 100%;
    width: 100%;
    flex: none;
  }

  .filter-bar-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filter-bar-chips::-webkit-scrollbar {
    display: none;
  }
}

/* ===================================================================
   LOGIN PAGE
   Matches the app's dark-navy glass aesthetic. The card uses the same
   L2-elevated surface level as other floating panels so it reads
   clearly against any background photo.
   =================================================================== */

.login-background {
  /* background-image set via inline style in login.html (esbuild cannot resolve server paths) */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.login-card {
  background: rgba(8, 12, 24, 0.82);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.04) inset;
  padding: 4rem 3rem;
  text-align: center;
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
}

.login-logo {
  width: 200px;
  height: auto;
  margin-bottom: 3rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.login-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.login-subtitle {
  font-size: 1.05rem;
  color: rgba(226, 232, 240, 0.65);
  margin: 0 0 3rem;
  line-height: 1.6;
}

.google-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.40);
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.google-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.50);
}

.login-disclaimer {
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.40);
  line-height: 1.6;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.75rem;
}

.login-disclaimer strong {
  display: block;
  color: rgba(226, 232, 240, 0.60);
  margin-bottom: 0.5rem;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}

.login-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: #fca5a5;
  text-align: left;
  line-height: 1.5;
}

.login-error strong {
  display: block;
  color: #f87171;
  margin-bottom: 0.25rem;
}

.login-error.hidden { display: none; }

.login-session-expired {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: #fde68a;
  text-align: left;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.login-session-expired .icon { flex-shrink: 0; margin-top: 1px; }

.login-session-expired strong {
  display: block;
  color: #fbbf24;
  margin-bottom: 0.2rem;
}

.login-session-expired.hidden { display: none; }

@media (max-width: 768px) {
  .login-card {
    padding: 3rem 1.75rem;
    border-radius: 20px;
  }
  .login-logo {
    width: 160px;
    margin-bottom: 2rem;
  }
  .login-title {
    font-size: 1.75rem;
  }
  .login-subtitle {
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
  }
}

/* ===================================================================
   RESPONSIVE FORM GRID UTILITIES
   Replace inline gridTemplateColumns in JSX with these classes so
   CSS media queries can collapse grids without !important on the
   component side.
   =================================================================== */

/* 2-col on tablet+, 1-col on phone */
.modal-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Timesheet edit: clock-in / clock-out / breaks (150px) / total (150px) */
.modal-grid-4col {
  display: grid;
  grid-template-columns: 1fr 1fr 150px 150px;
  gap: 16px;
}

@media (max-width: 639px) {
  /* 2-col collapses to 1-col (e.g. first/last name, date range) */
  .modal-grid-2col {
    grid-template-columns: 1fr;
  }

  /* 4-col becomes 2-col so clock-in/out stay side-by-side on phone */
  .modal-grid-4col {
    grid-template-columns: 1fr 1fr;
  }
}
