/* ==========================================================================
   DESIGN SYSTEM & VARIABLES - PROFESSIONAL THEME
   ========================================================================== */
:root, [data-theme="dark"] {
  --bg-color: #212529;
  --bg-card: #343a40;
  --bg-card-hover: #495057;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);
  
  --text-primary: #f8f9fa;
  --text-secondary: #ced4da;
  --text-muted: #adb5bd;
  
  --primary: #0d6efd;
  --primary-hover: #3b82f6;
  --primary-glow: rgba(13, 110, 253, 0.25);
  
  --color-wfh: #20c997;
  --color-wfh-bg: rgba(32, 201, 151, 0.15);
  --color-wfh-border: rgba(32, 201, 151, 0.3);
  
  --color-onsite: #6ea8fe;
  --color-onsite-bg: rgba(110, 168, 254, 0.15);
  --color-onsite-border: rgba(110, 168, 254, 0.3);
  
  --color-vacation: #ffda6a;
  --color-vacation-bg: rgba(255, 218, 106, 0.15);
  --color-vacation-border: rgba(255, 218, 106, 0.3);
  
  --color-dayoff: #adb5bd;
  --color-dayoff-bg: rgba(173, 181, 189, 0.15);
  --color-dayoff-border: rgba(173, 181, 189, 0.3);
  
  --color-overtime: #ea868f;
  --color-overtime-bg: rgba(234, 134, 143, 0.15);
  --color-overtime-border: rgba(234, 134, 143, 0.3);

  --color-standby: #ffb74d;
  --color-standby-bg: rgba(255, 183, 77, 0.15);
  --color-standby-border: rgba(255, 183, 77, 0.3);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-lg: 0 10px 25px -10px rgba(0, 0, 0, 0.3);
  --backdrop-blur: blur(8px);
  --transition-smooth: all 0.2s ease-in-out;
}

[data-theme="light"] {
  --bg-color: #f4f6f8;
  --bg-card: #ffffff;
  --bg-card-hover: #e9ecef;
  --border-color: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 0, 0.2);
  
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  
  --primary: #0d6efd;
  --primary-hover: #0b5ed7;
  --primary-glow: rgba(13, 110, 253, 0.15);
  
  --color-wfh: #198754;
  --color-wfh-bg: rgba(25, 135, 84, 0.1);
  --color-wfh-border: rgba(25, 135, 84, 0.3);
  
  --color-onsite: #0d6efd;
  --color-onsite-bg: rgba(13, 110, 253, 0.1);
  --color-onsite-border: rgba(13, 110, 253, 0.3);
  
  --color-vacation: #ffc107;
  --color-vacation-bg: rgba(255, 193, 7, 0.1);
  --color-vacation-border: rgba(255, 193, 7, 0.3);
  
  --color-dayoff: #6c757d;
  --color-dayoff-bg: rgba(108, 117, 125, 0.1);
  --color-dayoff-border: rgba(108, 117, 125, 0.3);
  
  --color-overtime: #dc3545;
  --color-overtime-bg: rgba(220, 53, 69, 0.1);
  --color-overtime-border: rgba(220, 53, 69, 0.3);

  --color-standby: #fd7e14;
  --color-standby-bg: rgba(253, 126, 20, 0.1);
  --color-standby-border: rgba(253, 126, 20, 0.3);

  --shadow-lg: 0 10px 25px -10px rgba(0, 0, 0, 0.1);
  --backdrop-blur: none;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}


/* Typography & Layout Headers */
h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

/* ==========================================================================
   BUTTONS & ACTIONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
  outline: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

@media (hover: hover) {
  .btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
  }
}

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

.btn-secondary {
  background-color: hsla(223, 47%, 20%, 0.35);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

@media (hover: hover) {
  .btn-secondary:hover {
    background-color: hsla(223, 47%, 25%, 0.6);
    border-color: var(--border-hover);
    color: var(--text-primary);
  }
}

.btn-sm {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 6px;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ==========================================================================
   INPUTS & SELECT FIELDS
   ========================================================================== */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="time"],
select {
  background-color: hsla(223, 47%, 10%, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 16px; /* Avoid iOS Safari auto-zoom on focus */
  font-family: 'Inter', sans-serif;
  transition: var(--transition-smooth);
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background-color: hsla(223, 47%, 12%, 0.8);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for iOS dynamic toolbar */
  padding: 24px;
  background: radial-gradient(circle at center, hsla(223, 47%, 12%, 0.35) 0%, var(--bg-color) 100%);
}

.login-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--backdrop-blur);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.4s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.login-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 40%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

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

.error-msg {
  color: var(--color-overtime);
  font-size: 0.8rem;
  margin-top: 6px;
  display: none;
  font-weight: 600;
}

/* ==========================================================================
   APP MAIN INTERFACE
   ========================================================================== */
.app-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--backdrop-blur);
  border-radius: var(--radius-md);
  padding: 14px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}

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

.header-logo {
  color: var(--primary);
  display: flex;
  align-items: center;
  filter: drop-shadow(0 2px 8px var(--primary-glow));
}

.header-branding h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Month Navigation */
.month-navigator {
  display: flex;
  align-items: center;
  gap: 16px;
}

.month-navigator h3 {
  font-size: 1.15rem;
  font-weight: 700;
  min-width: 140px;
  text-align: center;
  color: var(--text-primary);
}

.nav-btn {
  background: hsla(223, 47%, 20%, 0.35);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

@media (hover: hover) {
  .nav-btn:hover {
    background-color: hsla(223, 47%, 25%, 0.6);
    border-color: var(--border-hover);
    color: var(--text-primary);
  }
}

.logout-btn {
  background: hsla(223, 47%, 20%, 0.35);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

@media (hover: hover) {
  .logout-btn:hover {
    color: var(--color-overtime);
    background-color: hsla(0, 86%, 58%, 0.1);
    border-color: hsla(0, 86%, 58%, 0.35);
  }
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--backdrop-blur);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-smooth);
}

@media (hover: hover) {
  .stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
  }
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.05);
}

.stat-wfh .stat-icon { background: hsla(150, 84%, 44%, 0.15); color: var(--color-wfh); }
.stat-onsite .stat-icon { background: hsla(210, 95%, 52%, 0.15); color: var(--color-onsite); }
.stat-overtime .stat-icon { background: hsla(0, 86%, 58%, 0.15); color: var(--color-overtime); }
.stat-off .stat-icon { background: hsla(38, 92%, 52%, 0.15); color: var(--color-vacation); }

.stat-info {
  display: flex;
  flex-direction: column;
}

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

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================================
   CALENDAR CARD & GRID
   ========================================================================== */
.calendar-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--backdrop-blur);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}

.weekday-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

/* Individual Day Cell Card */
.calendar-day {
  aspect-ratio: 1;
  background-color: hsla(223, 47%, 10%, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
  user-select: none;
}

@media (hover: hover) {
  .calendar-day:hover:not(.other-month) {
    background-color: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  }
}

.calendar-day.other-month {
  opacity: 0.15;
  cursor: default;
  pointer-events: none;
}

.day-number {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

/* Today Indicator */
.calendar-day.today {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.calendar-day.today::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background-color: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--primary);
}

/* ==========================================================================
   DAY STATUS HIGHLIGHT GLOWS (Glassmorphic Tints)
   ========================================================================== */
.calendar-day.status-wfh {
  background-color: var(--color-wfh-bg);
  border-color: var(--color-wfh-border);
  box-shadow: inset 0 0 12px hsla(150, 84%, 44%, 0.08);
}
.calendar-day.status-wfh:hover {
  border-color: var(--color-wfh);
  box-shadow: inset 0 0 16px hsla(150, 84%, 44%, 0.15), 0 6px 20px rgba(0, 0, 0, 0.3);
}
.calendar-day.status-wfh .day-number {
  color: var(--color-wfh);
}

.calendar-day.status-onsite {
  background-color: var(--color-onsite-bg);
  border-color: var(--color-onsite-border);
  box-shadow: inset 0 0 12px hsla(210, 95%, 52%, 0.08);
}
.calendar-day.status-onsite:hover {
  border-color: var(--color-onsite);
  box-shadow: inset 0 0 16px hsla(210, 95%, 52%, 0.15), 0 6px 20px rgba(0, 0, 0, 0.3);
}
.calendar-day.status-onsite .day-number {
  color: var(--color-onsite);
}

.calendar-day.status-vacation {
  background-color: var(--color-vacation-bg);
  border-color: var(--color-vacation-border);
  box-shadow: inset 0 0 12px hsla(38, 92%, 52%, 0.08);
}
.calendar-day.status-vacation:hover {
  border-color: var(--color-vacation);
  box-shadow: inset 0 0 16px hsla(38, 92%, 52%, 0.15), 0 6px 20px rgba(0, 0, 0, 0.3);
}
.calendar-day.status-vacation .day-number {
  color: var(--color-vacation);
}

.calendar-day.status-dayoff {
  background-color: var(--color-dayoff-bg);
  border-color: var(--color-dayoff-border);
  box-shadow: inset 0 0 12px hsla(270, 76%, 64%, 0.08);
}
.calendar-day.status-dayoff:hover {
  border-color: var(--color-dayoff);
  box-shadow: inset 0 0 16px hsla(270, 76%, 64%, 0.15), 0 6px 20px rgba(0, 0, 0, 0.3);
}
.calendar-day.status-dayoff .day-number {
  color: var(--color-dayoff);
}

/* Indicators */
.day-indicators {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: auto;
}

.day-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-family: 'Outfit', sans-serif;
}

.badge-wfh { background-color: hsla(150, 84%, 44%, 0.2); color: var(--color-wfh); border: 1px solid var(--color-wfh-border); }
.badge-onsite { background-color: hsla(210, 95%, 52%, 0.2); color: var(--color-onsite); border: 1px solid var(--color-onsite-border); }
.badge-vacation { background-color: hsla(38, 92%, 52%, 0.2); color: var(--color-vacation); border: 1px solid var(--color-vacation-border); }
.badge-dayoff { background-color: hsla(270, 76%, 64%, 0.2); color: var(--color-dayoff); border: 1px solid var(--color-dayoff-border); }

/* Overtime indicator badge */
.day-ot-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background-color: hsla(0, 86%, 58%, 0.15);
  border: 1px solid var(--color-overtime-border);
  color: var(--color-overtime);
  font-size: 0.65rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  padding: 2px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   MULTI-SELECT BULK MODE STYLING
   ========================================================================== */
.calendar-day.selected-for-bulk {
  outline: none !important;
  box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px var(--primary), 0 0 20px var(--primary-glow) !important;
  border-color: var(--primary) !important;
  z-index: 10;
  background-color: var(--bg-card-hover) !important;
  transform: scale(0.96);
}

.multi-select-bar {
  position: fixed;
  bottom: calc(30px + env(safe-area-inset-bottom)); /* Adjust for iPhone home indicator */
  left: 50%;
  transform: translateX(-50%);
  background-color: hsla(223, 47%, 14%, 0.85);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(24px);
  border-radius: 40px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 95;
  animation: slideUpCapsule 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90%;
  width: 400px;
}

.multi-select-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}

.multi-select-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary);
  animation: pulseDot 2s infinite;
}

.multi-select-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: -8px;
  margin-bottom: 24px;
}

.calendar-actions .btn {
  padding: 10px 28px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

@media (hover: hover) {
  .calendar-actions .btn:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
}

.calendar-actions .btn:active {
  transform: translateY(1px);
}

/* ==========================================================================
   EXPORTS & REPORTING
   ========================================================================== */
.exports-section {
  margin-top: 32px;
}

.section-title {
  margin-bottom: 20px;
}

.section-title h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.section-title p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.exports-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.export-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--backdrop-blur);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-lg);
}

.export-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.export-card-header h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.export-output {
  background-color: hsla(223, 47%, 6%, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 44px;
}

/* ==========================================================================
   DRAWER / SLIDE OVERLAY (Bottom Sheet Dialog)
   ========================================================================== */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for iOS Safari compatibility */
  background-color: rgba(6, 11, 23, 0.6);
  backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: flex-end;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer-content {
  background-color: hsla(223, 47%, 14%, 0.95);
  border-top: 1px solid var(--border-color);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  backdrop-filter: blur(30px);
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* Momentum scrolling on WebKit */
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.6);
  padding-bottom: calc(12px + env(safe-area-inset-bottom)); /* Dynamic iPhone safe area spacing */
}

.drawer-overlay.active .drawer-content {
  transform: translateY(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background-color: hsla(223, 47%, 14%, 0.98);
  backdrop-filter: blur(20px);
  z-index: 10;
}

.drawer-header h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.close-btn {
  background: hsla(223, 47%, 20%, 0.35);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

@media (hover: hover) {
  .close-btn:hover {
    background-color: hsla(223, 47%, 25%, 0.6);
    color: var(--text-primary);
  }
}

.drawer-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Radio status options */
.status-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.status-option {
  cursor: pointer;
}

.status-option input[type="radio"] {
  display: none;
}

.status-card-inner {
  background-color: hsla(223, 47%, 10%, 0.45);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

@media (hover: hover) {
  .status-card-inner:hover {
    background-color: hsla(223, 47%, 20%, 0.45);
    border-color: var(--border-hover);
    color: var(--text-primary);
  }
}

.status-icon {
  font-size: 1.15rem;
}

/* Checked States */
.status-option input[type="radio"]:checked + .card-none {
  border-color: var(--text-primary);
  background-color: hsla(223, 47%, 22%, 0.5);
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

.status-option input[type="radio"]:checked + .card-wfh {
  border-color: var(--color-wfh);
  background-color: var(--color-wfh-bg);
  color: var(--color-wfh);
  box-shadow: 0 4px 12px hsla(150, 84%, 44%, 0.15);
}

.status-option input[type="radio"]:checked + .card-onsite {
  border-color: var(--color-onsite);
  background-color: var(--color-onsite-bg);
  color: var(--color-onsite);
  box-shadow: 0 4px 12px hsla(210, 95%, 52%, 0.15);
}

.status-option input[type="radio"]:checked + .card-vacation {
  border-color: var(--color-vacation);
  background-color: var(--color-vacation-bg);
  color: var(--color-vacation);
  box-shadow: 0 4px 12px hsla(38, 92%, 52%, 0.15);
}

.status-option input[type="radio"]:checked + .card-dayoff {
  border-color: var(--color-dayoff);
  background-color: var(--color-dayoff-bg);
  color: var(--color-dayoff);
  box-shadow: 0 4px 12px hsla(270, 76%, 64%, 0.15);
}

/* ==========================================================================
   OVERTIME FIELDS & iOS TOGGLE SWITCH
   ========================================================================== */
.ot-toggle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: hsla(223, 47%, 8%, 0.6);
  border: 1px solid var(--border-color);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

.switch-toggle input:checked + .slider {
  background-color: hsla(245, 85%, 66%, 0.15);
  border-color: var(--primary);
}

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

.ot-fields-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: hsla(223, 47%, 8%, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 6px;
}

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

.form-group label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Calculated hours tag */
.calculated-hours-badge {
  background-color: hsla(223, 47%, 8%, 0.4);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  color: var(--primary);
  display: inline-block;
  font-size: 0.9rem;
  font-family: 'Outfit', sans-serif;
  filter: drop-shadow(0 2px 6px var(--primary-glow));
}

/* ==========================================================================
   TIME SELECTOR CUSTOM FORMAT & DROPDOWNS
   ========================================================================== */
.format-toggle-group {
  margin-bottom: 2px;
}

.toggle-buttons {
  display: inline-flex;
  background-color: hsla(223, 47%, 8%, 0.5);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: 8px;
  width: fit-content;
}

.toggle-buttons .btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  box-shadow: none;
  height: auto;
}

.toggle-buttons .btn.active {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.time-picker-row {
  display: flex;
  gap: 12px;
  margin-bottom: 2px;
}

.time-select-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.time-select-container label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.time-dropdowns {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: hsla(223, 47%, 10%, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  height: 44px;
  transition: var(--transition-smooth);
}

.time-dropdowns:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background-color: hsla(223, 47%, 12%, 0.8);
}

.time-select {
  background: transparent;
  border: none !important;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  text-align: center;
  padding: 0 4px !important;
  flex: 1;
  width: auto;
  height: auto;
}

.time-select:focus {
  box-shadow: none !important;
}

.time-select option {
  background-color: hsl(223, 47%, 14%);
  color: var(--text-primary);
}

.time-colon {
  color: var(--text-muted);
  font-weight: bold;
}

.period-select {
  color: var(--primary);
  font-weight: 700;
  max-width: 50px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background-color: hsla(223, 47%, 18%, 0.9);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   ANIMATIONS & MEDIA RESPONSIVENESS
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideUpCapsule {
  from { transform: translateX(-50%) translateY(100px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes pulseDot {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 hsla(245, 85%, 66%, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px hsla(245, 85%, 66%, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 hsla(245, 85%, 66%, 0); }
}

/* Grid configuration overrides */
@media (min-width: 580px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .status-options-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .exports-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 580px) {
  .app-container {
    padding: 16px 8px 100px;
  }
  
  .app-header {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-areas: 
      "brand logout"
      "nav nav";
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    align-items: center;
  }
  
  .header-branding {
    grid-area: brand;
  }
  
  .app-header > div:last-child {
    grid-area: logout;
    justify-self: end;
  }
  
  .month-navigator {
    grid-area: nav;
    justify-content: center;
    width: 100%;
    margin-top: 4px;
  }
  
  .month-navigator h3 {
    min-width: 100px;
    font-size: 1.05rem;
  }
  
  .stats-grid {
    gap: 8px;
    margin-bottom: 16px;
  }
  
  .stat-card {
    padding: 12px;
    gap: 10px;
    border-radius: var(--radius-sm);
  }
  
  .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }
  
  .stat-value {
    font-size: 1.1rem;
  }
  
  .calendar-card {
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
  }
  
  .weekday-header {
    font-size: 0.7rem;
    padding-bottom: 10px;
    margin-bottom: 10px;
  }
  
  .calendar-days-grid {
    gap: 6px;
  }
  
  .calendar-day {
    padding: 6px;
    border-radius: 6px;
  }
  
  .day-number {
    font-size: 0.85rem;
  }
  
  .day-badge {
    display: none; /* Hide labels on mobile to prevent overflow */
  }
  
  .day-ot-badge {
    top: 4px;
    right: 4px;
    font-size: 0.55rem;
    padding: 1px 3px;
  }
  
  .day-ot-badge svg {
    display: none;
  }
  
  .status-options-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .ot-fields-container {
    padding: 14px;
  }
  
  .time-picker-row {
    flex-direction: column;
    gap: 10px;
  }

  .nav-btn, .logout-btn, .close-btn {
    width: 44px;
    height: 44px;
  }

  .calendar-actions {
    margin-top: -6px;
    margin-bottom: 16px;
    padding: 0 4px;
  }

  .calendar-actions .btn {
    width: 100%;
  }

  .multi-select-bar {
    width: 92% !important;
    max-width: 380px !important;
    padding: 8px 12px !important;
    gap: 10px !important;
    bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  }

  .multi-select-info {
    font-size: 0.8rem !important;
    gap: 6px !important;
  }

  .multi-select-actions {
    gap: 6px !important;
  }

  .multi-select-actions .btn {
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
    height: auto !important;
  }
}

@media (min-width: 768px) {
  .drawer-overlay {
    align-items: center;
    justify-content: center;
  }
  
  .drawer-content {
    width: 480px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  }
  
  .drawer-overlay.active .drawer-content {
    transform: scale(1);
    opacity: 1;
  }
  
  .calendar-day {
    padding: 10px;
  }
}

/* --- STANDBY & OT UPDATES --- */
.day-standby-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background-color: var(--color-standby-bg);
  border: 1px solid var(--color-standby-border);
  color: var(--color-standby);
  font-size: 0.65rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.day-ot-badge {
  right: auto;
  left: 6px;
}

@media (max-width: 580px) {
  .day-standby-badge {
    top: 4px;
    right: 4px;
    font-size: 0.55rem;
    padding: 1px 3px;
  }
  .day-ot-badge {
    left: 4px;
  }
  .day-standby-badge svg {
    display: none;
  }
}

.stat-standby .stat-icon {
  background: var(--color-standby-bg);
  color: var(--color-standby);
}

/* Update Stats grid layout to accommodate 5 cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* --- MOBILE OVERFLOW FIXES --- */
@media (max-width: 580px) {
  html, body {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  .drawer-content {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .drawer-header {
    padding: 16px 16px;
  }

  .drawer-body {
    padding: 16px 16px;
  }

  /* Force wrapping for very tight screens like 320px */
  .time-dropdowns {
    flex-wrap: wrap;
    height: auto;
    padding: 8px;
  }

  .drawer-header h4 {
    font-size: 1rem;
    white-space: normal;
    word-break: break-word;
  }

  .ot-entry-row {
    padding: 8px !important;
  }
}


/* --- FIRMWARE UPDATE STYLES --- */
.day-firmware-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background-color: hsla(200, 100%, 50%, 0.15);
  border: 1px solid rgba(3, 169, 244, 0.4);
  color: #29b6f6;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

@media (max-width: 580px) {
  .day-firmware-badge {
    bottom: 4px;
    right: 4px;
    font-size: 0.55rem;
    padding: 1px 3px;
  }
  .day-firmware-badge svg {
    display: none;
  }
}

.stat-firmware .stat-icon {
  background: rgba(3, 169, 244, 0.2);
  color: #29b6f6;
}
