/**
 * CSS CUSTOM PROPERTIES - Design System Variables
 * Foundation for consistent theming across roster app
 */

:root {
  /* Brand Colors - Slate Blue Professional Theme (matching employee and manager apps) */
  --slate-dark: #1e293b;
  --slate-medium: #334155;
  --navy-dark: #2c3e50;
  --navy-medium: #34495e;
  --blue-primary: #3498db;
  --blue-darker: #2980b9;
  --blue-light: #5dade2;

  /* Status Colors */
  --green-success: #27ae60;
  --green-darker: #229954;
  --orange-warning: #e67e22;
  --orange-darker: #d35400;
  --red-danger: #e74c3c;
  --red-darker: #c0392b;
  --teal-info: #1abc9c;
  --teal-darker: #16a085;

  /* Wing Colors - Consistent across all wing-related UI */
  --wing-west: #3498db;
  --wing-west-bg: rgba(52, 152, 219, 0.15);
  --wing-west-text: #2980b9;
  --wing-east: #2ecc71;
  --wing-east-bg: rgba(46, 204, 113, 0.15);
  --wing-east-text: #27ae60;
  --wing-dementia: #9b59b6;
  --wing-dementia-bg: rgba(155, 89, 182, 0.15);
  --wing-dementia-text: #8e44ad;
  --wing-facility: #f39c12;
  --wing-facility-bg: rgba(243, 156, 18, 0.15);
  --wing-facility-text: #d68910;

  /* Neutral Colors */
  --white: #ffffff;
  --gray-lightest: #f8f9fa;
  --gray-light: #ecf0f1;
  --gray-medium: #bdc3c7;
  --gray-dark: #7f8c8d;
  --text-dark: #2c3e50;
  --text-muted: #7f8c8d;
  --border-color: #ecf0f1;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 12px 28px rgba(0, 0, 0, 0.15);
  --shadow-button: 0 4px 12px rgba(52, 152, 219, 0.3);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Typography */
  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-base: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 2rem;
  --font-4xl: 2.5rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/**
 * CSS RESET & BASE STYLES
 * Foundation reset and body defaults
 */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f8f9fa;
  color: #2c3e50;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/**
 * LAYOUT - Dashboard Header and Container
 * Core layout structure for roster pages
 */

.roster-dashboard,
.roster-schedule {
  background: var(--gray-lightest);
  min-height: 100vh;
}

.dashboard-header {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-medium) 100%);
  color: var(--white);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 100;
}

.dashboard-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-primary) 0%, var(--teal-info) 50%, var(--blue-primary) 100%);
}

.dashboard-header .container-fluid {
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
}

.dashboard-header__title-section {
  flex: 1;
}

.dashboard-header__title {
  font-size: var(--font-2xl);
  font-weight: 700;
  color: var(--white);
  margin: 0 0 var(--space-xs) 0;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.dashboard-header__title i {
  color: var(--blue-light);
  font-size: var(--font-2xl);
}

.dashboard-header__subtitle {
  font-size: var(--font-sm);
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-weight: 400;
}

.dashboard-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/**
 * GRID SYSTEM & UTILITIES
 * Flexbox grid and spacing utilities
 */

.container-fluid {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 calc(var(--space-md) * -0.5);
}

.col-12,
.col-md-4,
.col-md-6,
.col-lg-6,
.col-xl-3 {
  padding: 0 calc(var(--space-md) * 0.5);
}

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

.col-md-4 {
  flex: 0 0 100%;
  max-width: 100%;
}

.col-md-6 {
  flex: 0 0 100%;
  max-width: 100%;
}

@media (min-width: 768px) {
  .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }

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

@media (min-width: 992px) {
  .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (min-width: 1200px) {
  .col-xl-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

.g-3 {
  margin: 0 calc(var(--space-md) * -0.5);
}

.g-3 > * {
  padding: 0 calc(var(--space-md) * 0.5);
  margin-bottom: var(--space-md);
}

.g-4 {
  margin: 0 calc(var(--space-lg) * -0.5);
}

.g-4 > * {
  padding: 0 calc(var(--space-lg) * 0.5);
  margin-bottom: var(--space-lg);
}

/* Margin utilities */
.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: var(--space-xs);
}

.mb-4 {
  margin-bottom: var(--space-lg);
}

.mb-6 {
  margin-bottom: var(--space-2xl);
}

.me-1 {
  margin-right: var(--space-xs);
}

.me-2 {
  margin-right: var(--space-md);
}

/* Display utilities */
/* High specificity to override flex/block/grid without forcing priority */
html body .hidden,
.hidden.hidden {
  display: none;
}

/* Modal management utilities */
body.modal-open {
  overflow: hidden;
}

.modal-hidden {
  visibility: hidden;
}

/* Icon color utilities */
.icon-danger,
.icon-danger > i,
.icon-danger > svg {
  color: var(--red-danger);
}

/* Text utilities */
.text-center {
  text-align: center;
}

.text-end {
  text-align: right;
}

.text-muted {
  color: var(--text-muted);
}

.small {
  font-size: var(--font-sm);
}

/* Padding utilities */
.py-5 {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

/* Flexbox utilities */
.d-flex {
  display: flex;
}

.d-inline-block {
  display: inline-block;
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-center {
  align-items: center;
}

.gap-2 {
  gap: var(--space-md);
}

.gap-3 {
  gap: var(--space-lg);
}

/* Screen reader only */
.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;
}

/**
 * BUTTONS
 * All button styles and variants
 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-base);
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  line-height: 1.5;
}

.btn-primary {
  background: var(--blue-primary);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--blue-darker);
  box-shadow: var(--shadow-button);
  transform: translateY(-1px);
}

.btn-primary:disabled,
.btn-primary.btn-disabled {
  background: var(--gray-medium);
  color: var(--gray-dark);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  opacity: 0.6;
}

.btn-primary:disabled:hover,
.btn-primary.btn-disabled:hover {
  background: var(--gray-medium);
  box-shadow: none;
  transform: none;
}

.btn-success {
  background: var(--green-success);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-success:hover {
  background: var(--green-darker);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
  transform: translateY(-1px);
}

.btn-outline-primary {
  background: transparent;
  color: var(--blue-primary);
  border: 2px solid var(--blue-primary);
}

.btn-outline-primary:hover {
  background: var(--blue-primary);
  color: var(--white);
}

.btn-outline-secondary {
  background: transparent;
  color: var(--gray-dark);
  border: 2px solid var(--gray-medium);
}

.btn-outline-secondary:hover {
  background: var(--gray-medium);
  color: var(--white);
}

/* Tighter icon-text gap for outline buttons */
.btn-outline-primary,
.btn-outline-secondary {
  gap: 0.25rem;
}

.btn-logout,
.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-lg);
}

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-sm);
}

/* Logout Button */
.btn-logout {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Disabled button state */
.btn-disabled,
.btn:disabled,
button:disabled {
  opacity: 0.5;
  pointer-events: none; /* Prevents clicks - visual indication via opacity */
}

.w-100 {
  width: 100%;
}

/* Action Icon Buttons - Professional Styling */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--gray-dark);
  cursor: pointer;
  transition: all var(--transition-base);
  margin: 0 2px;
}

.btn-icon:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-icon i {
  font-size: var(--font-sm);
}

/* View Button - Blue */
.btn-view {
  color: var(--blue-primary);
  border-color: var(--blue-primary);
}

.btn-view:hover {
  background: var(--blue-primary);
  color: var(--white);
  border-color: var(--blue-primary);
}

/* Edit Button - Teal */
.btn-edit {
  color: var(--teal-info);
  border-color: var(--teal-info);
}

.btn-edit:hover {
  background: var(--teal-info);
  color: var(--white);
  border-color: var(--teal-info);
}

/* Duplicate Button - Orange */
.btn-duplicate {
  color: var(--orange-warning);
  border-color: var(--orange-warning);
}

.btn-duplicate:hover {
  background: var(--orange-warning);
  color: var(--white);
  border-color: var(--orange-warning);
}

/* Delete Button - Red */
.btn-delete {
  color: var(--red-danger);
  border-color: var(--red-danger);
}

.btn-delete:hover {
  background: var(--red-danger);
  color: var(--white);
  border-color: var(--red-danger);
}

/* Cancel Button */
.btn-cancel {
  padding: var(--space-sm) var(--space-lg);
  background: var(--gray-medium);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-cancel:hover {
  background: var(--gray-dark);
}

/* Button Groups */
.btn-group {
  display: inline-flex;
  gap: 0;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.btn-group .btn:last-child {
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

/* Close Button */
.btn-close {
  background: none;
  border: none;
  font-size: var(--font-xl);
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  transition: color var(--transition-base);
}

.btn-close:hover {
  color: var(--navy-dark);
}

/**
 * CARDS
 * Card components and status cards
 */

.card-professional {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-xl);
  overflow: hidden;
}

.card-professional__header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-color);
  background: var(--gray-lightest);
}

.card-professional__title {
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--navy-dark);
  margin: 0;
}

.card-professional__body {
  padding: var(--space-xl);
}

.card-professional__footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-color);
  background: var(--gray-lightest);
}

/* Status Cards - Premium Design */
.status-card {
  background: linear-gradient(135deg, var(--white) 0%, #fafbfc 100%);
  border: 1px solid var(--border-color);
  border-radius: 0;
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  transition: all var(--transition-base);
  overflow: hidden;
}

.status-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--blue-primary);
}

.status-card-pending::before { background: var(--orange-warning); }
.status-card-approved::before { background: var(--green-success); }
.status-card-info::before { background: var(--blue-primary); }

.status-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.status-card-title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

.status-card-value {
  font-size: var(--font-4xl);
  font-weight: 700;
  line-height: 1;
  color: var(--text-dark);
  margin: 0;
}

.status-card-pending .status-card-value { color: var(--orange-warning); }
.status-card-approved .status-card-value { color: var(--green-success); }
.status-card-info .status-card-value { color: var(--blue-primary); }

/**
 * TABLES
 * Table components, filter bars, and badges
 */

.table-responsive {
  overflow-x: auto;
}

.table-modern {
  width: 100%;
  table-layout: fixed; /* Prevent column jumping */
  border-collapse: collapse;
  margin: 0;
}

.table-modern__header {
  background: var(--gray-lightest);
}

.table-modern__header th {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--navy-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
}

.table-modern__row td {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table-modern__row:hover {
  background: var(--gray-lightest);
}

.table-modern__actions {
  text-align: center;
  white-space: nowrap;
}

/* Column-specific alignment and widths for roster dashboard table */
/* Fixed column widths to prevent jumping when filtering - matching original proportions */
.table-modern th:nth-child(1) {
  width: 28%; /* Week Starting - needs more space for date + badges */
  text-align: left;
}

.table-modern td:nth-child(1) {
  width: 28%;
  text-align: left;
  white-space: nowrap;
}

/* Make badges float right within the cell to align consistently */
.table-modern td:nth-child(1) .badge {
  float: right;
  margin-left: 12px;
}

/* Status - center (badge) */
.table-modern th:nth-child(2),
.table-modern td:nth-child(2) {
  width: 12%; /* Status badge */
  text-align: center;
}

/* Total Hours - right (number) */
.table-modern th:nth-child(3),
.table-modern td:nth-child(3) {
  width: 12%; /* Total Hours */
  text-align: right;
  padding-right: 20px;
}

/* Employees Assigned - center (small number, looks better centered) */
.table-modern th:nth-child(4),
.table-modern td:nth-child(4) {
  width: 20%; /* Employees Assigned */
  text-align: center;
}

/* Created - left (relative time text) */
.table-modern th:nth-child(5),
.table-modern td:nth-child(5) {
  width: 15%; /* Created */
  text-align: left;
}

/* Actions - center (icons) */
.table-modern th:nth-child(6),
.table-modern td:nth-child(6) {
  width: 13%; /* Actions - narrower for just icons */
  text-align: center;
}

/* Week-based row styling */
.table-modern__row.past-week {
  opacity: 0.6;
  background: rgba(189, 195, 199, 0.05);
}

.table-modern__row.past-week:hover {
  opacity: 0.75;
  background: rgba(189, 195, 199, 0.1);
}

.table-modern__row.current-week {
  background: rgba(39, 174, 96, 0.05);
  border-left: 3px solid var(--green-success);
}

.table-modern__row.current-week:hover {
  background: rgba(39, 174, 96, 0.1);
}

.table-modern__row.future-week {
  background: var(--white);
}

.table-modern__row.future-week:hover {
  background: var(--gray-lightest);
}

/* Filter Bar Styling */
.filter-bar {
  background: var(--gray-lightest);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  transition: all var(--transition-base);
}

/* Search input with icons */
.search-input-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-medium);
  font-size: var(--font-sm);
  pointer-events: none;
  z-index: 1;
}

.filter-bar input.search-input-with-icons.form-control {
  padding-left: 2.5rem;
  padding-right: 2.75rem;
}

.search-clear-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--gray-medium);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:hover {
  background: var(--gray-lightest);
  color: var(--red-danger);
}

.search-clear-btn i {
  font-size: var(--font-sm);
}

.filter-bar .form-label {
  color: var(--navy-dark);
  font-weight: 600;
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.filter-bar .form-select,
.filter-bar .form-control {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--navy-dark);
  font-size: var(--font-sm);
  padding: 0.5rem 0.75rem;
  transition: all var(--transition-fast);
  height: 36px;
}

.filter-bar .form-select:focus,
.filter-bar .form-control:focus {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.1);
  outline: none;
}

.filter-bar .btn-outline-secondary {
  background: var(--white);
  border: 1px solid var(--border-color);
  color: var(--navy-medium);
  font-size: var(--font-sm);
  padding: 0.5rem 1rem;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.filter-bar .btn-outline-secondary:hover {
  background: var(--gray-lightest);
  border-color: var(--gray-medium);
}

/* Filter result count */
#filterResultCount {
  color: var(--text-muted);
  font-size: var(--font-sm);
  padding: 0.5rem 1.5rem 0;
  font-style: italic;
}

/* Badge styling for week indicators */
.badge {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.5rem;
}

.badge.badge-success {
  background: var(--green-success);
  color: var(--white);
}

.badge.badge-info {
  background: var(--teal-info);
  color: var(--white);
}

.badge.badge-secondary {
  background: var(--gray-medium);
  color: var(--white);
}

/* Status badge - matches roster info value styling */
.status-badge {
  font-size: var(--font-2xl);
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.status-badge.status-draft {
  background: var(--yellow-warning);
  color: var(--navy-dark);
}

.status-badge.status-published {
  background: var(--green-success);
  color: white;
}

.status-badge-pending {
  color: var(--text-muted);
}

.status-badge-approved {
  color: var(--green-success);
  font-weight: 600;
}

/* Table status badges - smaller, text-only styling for roster table */
.table-status-badge {
  font-weight: 600;
  font-size: var(--font-base);
}

.table-status-badge-pending {
  color: var(--text-muted);
}

.table-status-badge-approved {
  color: var(--green-success);
}

/**
 * FORMS
 * Form controls, inputs, and form groups
 */

/* Form groups */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
  color: var(--navy-dark);
}

.form-label.required::after {
  content: ' *';
  color: var(--red-danger);
}

.form-control {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  transition: border-color var(--transition-base);
}

.form-control:focus {
  outline: none;
  border-color: var(--blue-primary);
}

.form-help-text {
  display: block;
  margin-top: var(--space-xs);
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.form-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
}

.form-section-title {
  margin: 0 0 var(--space-lg) 0;
  font-size: var(--font-lg);
  color: var(--navy-dark);
}

.form-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.form-row {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.form-control-color {
  height: 45px;
  cursor: pointer;
}

.form-control-plaintext {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--gray-light);
  font-weight: 600;
  color: var(--navy-dark);
}

.color-badge {
  display: inline-block;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* Alerts */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.alert-info {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  color: #1976d2;
}

.alert-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  display: flex;
  align-items: center;
}

.alert-warning i {
  color: #ffc107;
}

/* Multi-select styling */
select[multiple] {
  min-height: 120px;
  cursor: pointer;
}

select[multiple] option {
  padding: var(--space-sm);
  cursor: pointer;
}

select[multiple] option:hover {
  background: var(--blue-light);
  color: var(--white);
}

/* Employee multi-select styling */
#employee-select {
  line-height: 1.8;
  padding: var(--space-sm);
}

#employee-select option {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  color: var(--text-dark);
}

#employee-select option:checked {
  background-color: var(--blue-primary);
  color: var(--white);
}

#employee-select option:hover {
  background-color: var(--gray-lightest);
  color: var(--text-dark);
}

/* Day checkbox group for assignments */
.day-checkbox-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.day-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.day-checkbox-wrapper:hover {
  background: var(--gray-lightest);
  border-color: var(--blue-primary);
}

.day-checkbox {
  margin: 0;
  cursor: pointer;
}

.day-checkbox-label {
  margin: 0;
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}

/* Conflict warnings */
.conflict-warnings {
  margin-top: var(--space-md);
}

.conflict-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.conflict-warning i {
  color: #ffc107;
}

/**
 * MODALS
 * Modal overlay, content, and animations
 */

/* Generic modal overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

/* Nested modals - transparent backdrop (parent provides blur) */
.modal-overlay#shift-modal,
.modal-overlay#confirmation-modal,
.modal-overlay#assignment-modal {
  z-index: 10001;
  background: transparent;
  backdrop-filter: none;
}

/* Standalone confirmation modal - has its own blur */
.modal-overlay#confirmation-modal.modal-standalone {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

/* Modal content container */
.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease;
}

.modal-content.modal-lg {
  max-width: 900px;
}

.modal-content.modal-xl {
  max-width: 1400px;
  width: 95%;
}

/* Modal header */
.modal-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: var(--font-xl);
  color: var(--navy-dark);
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Modal body */
.modal-body {
  padding: var(--space-xl);
}

/* Modal footer */
.modal-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
}

/* Confirmation modal specific styles */
.modal-content.confirmation-modal {
  max-width: 400px;
}

.modal-content.confirmation-modal .confirmation-message {
  margin: 0;
  font-size: var(--font-base);
  color: var(--text-dark);
  line-height: 1.6;
}

/* Modal subtitle */
.modal-subtitle {
  font-size: var(--font-sm);
  color: var(--gray-dark);
  margin-top: var(--space-xs);
}

/* Sub-modal z-index */
.sub-modal {
  z-index: 10001;
}

/* Modal animations */
@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

/* Logout Modal - uses .show class toggle */
.logout-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.logout-modal-overlay.show {
  display: flex;
}

.logout-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 400px;
  width: 90%;
  animation: modalSlideIn 0.3s ease;
}

.logout-modal .modal-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-color);
}

.logout-modal .modal-header h3 {
  margin: 0;
  font-size: var(--font-xl);
  color: var(--navy-dark);
}

.logout-modal .modal-body {
  padding: var(--space-xl);
}

.logout-modal .modal-body p {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-base);
  color: var(--text-dark);
  line-height: 1.6;
}

.logout-modal .modal-body p:last-child {
  margin-bottom: 0;
}

.logout-modal .modal-body .text-muted {
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.logout-modal .modal-actions {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
}

/* Logout modal confirm button - different from header logout button */
.logout-modal .btn-logout {
  background: var(--red-danger);
  color: var(--white);
  border: none;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
}

.logout-modal .btn-logout:hover {
  background: var(--red-darker);
  transform: translateY(-1px);
}

/**
 * AUTH PAGES
 * Login and logout page styles
 */

/* ===== LOGIN PAGE ===== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: var(--space-xl);
}

.login-card {
  max-width: 400px;
  width: 100%;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0056b3 0%, #20c997 100%);
}

.login-header {
  margin-bottom: var(--space-md);
}

.login-icon {
  font-size: 4rem;
  color: #004494;
  margin-bottom: var(--space-lg);
  display: block;
  animation: loginIconPulse 3s ease-in-out infinite;
}

@keyframes loginIconPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

.login-title {
  font-size: var(--font-2xl);
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

.login-subtitle {
  font-size: var(--font-lg);
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}

.login-actions {
  margin-bottom: var(--space-lg);
}

.login-button {
  width: 100%;
  background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-xl);
  font-size: var(--font-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
  position: relative;
  overflow: hidden;
}

.login-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.login-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #004494 0%, #003875 100%);
  box-shadow: 0 8px 20px rgba(0, 86, 179, 0.4);
  text-decoration: none;
  color: white;
}

.login-button:hover::before {
  left: 100%;
}

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.login-footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.security-indicators {
  text-align: center;
}

.login-footer-text {
  color: var(--text-muted);
  font-size: var(--font-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ssl-indicator {
  color: var(--text-muted);
  font-size: var(--font-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-xs);
}

/* ===== LOGOUT PAGE ===== */
.logout-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.logout-card {
  max-width: 400px;
  width: 100%;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.logout-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.logout-header {
  margin-bottom: var(--space-xl);
}

.logout-icon {
  font-size: 4rem;
  color: #ef4444;
  margin-bottom: var(--space-lg);
  display: block;
  animation: logoutIconBounce 2s ease-in-out infinite;
}

@keyframes logoutIconBounce {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(-5deg);
  }
}

.logout-title {
  font-size: var(--font-2xl);
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

.logout-subtitle {
  font-size: var(--font-lg);
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.4;
}

.logout-spinner {
  margin: var(--space-xl) 0;
  display: flex;
  justify-content: center;
}

.logout-footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.logout-footer-text {
  color: var(--text-muted);
  font-size: var(--font-sm);
}

/**
 * LOADING STATES
 * Loading overlay and spinner animations
 */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--blue-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-message {
  color: var(--white);
  font-size: var(--font-lg);
  margin-top: var(--space-lg);
}

/* Spinner for logout page */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid #0056b3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Single spin animation (used by multiple components) */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/**
 * SCHEDULE GRID
 * Schedule display, shifts, and assignments
 */

.schedule-grid {
  padding: var(--space-lg);
  overflow-x: auto;
}

.schedule-grid-container {
  display: table;
  table-layout: fixed;
  width: 100%;
  min-width: 800px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--white);
  overflow: hidden;
}

.schedule-grid-header {
  display: table-row;
  background: var(--slate-dark);
  color: var(--white);
}

.schedule-grid-day-header {
  display: table-cell;
  padding: var(--space-md);
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  vertical-align: middle;
  width: 145px;
  min-width: 145px;
}

.schedule-grid-day-header:last-child {
  border-right: none;
}

.schedule-grid-day-name {
  font-size: var(--font-lg);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.schedule-grid-date {
  font-size: var(--font-sm);
  opacity: 0.9;
}

.schedule-grid-body {
  display: table-row-group;
}

.schedule-grid-row {
  display: table-row;
  border-bottom: 1px solid var(--border-color);
}

.schedule-grid-row:hover {
  background: var(--gray-lightest);
}

.schedule-grid-employee-name {
  display: table-cell;
  padding: var(--space-md);
  font-weight: 600;
  color: var(--navy-dark);
  border-right: 2px solid var(--border-color);
  background: var(--white);
  min-width: 180px;
  vertical-align: middle;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 1;
}

.schedule-grid-cell {
  display: table-cell;
  padding: var(--space-md);
  border-right: 1px solid var(--border-color);
  vertical-align: top;
  min-height: 100px;
  width: 145px;
  min-width: 145px;
  background: var(--white);
}

.schedule-grid-cell:last-child {
  /* Remove right border on last column - container border handles it */
  border-right: none;
}

/* Empty cells styling - subtle background for cells without shifts */
.schedule-grid-cell:empty,
.schedule-grid-cell.empty {
  background: var(--gray-lightest);
  position: relative;
}

.shift-badge {
  background: var(--white);
  border: 1px solid var(--gray-medium);
  border-left: 4px solid var(--blue-primary);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  font-size: var(--font-sm);
  transition: all var(--transition-fast);
  line-height: 1.5;
}

.shift-badge-name {
  font-weight: 600;
  color: var(--navy-dark);
  margin-bottom: 2px;
  text-align: center;
  /* Force single line with ellipsis */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shift-badge-time {
  color: var(--text-muted);
  font-size: var(--font-xs);
  text-align: center;
}

.shift-badge-wing {
  margin-top: 4px;
  font-size: 0.7rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.shift-badge .shift-badge-wing .assignment-wing-badge {
  margin-left: 0;
  margin-right: 0;
  font-size: 0.65rem;
}

/* Shift Legend */
.shift-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.shift-legend__title {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--navy-dark);
  margin: 0;
  display: flex;
  align-items: center;
}

.shift-legend__items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.shift-legend__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--gray-lightest);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--blue-primary);
}

.shift-legend__color {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.shift-legend__name {
  font-weight: 600;
  color: var(--navy-dark);
  margin-right: var(--space-xs);
}

.shift-legend__time {
  color: var(--text-muted);
  font-size: var(--font-sm);
}

/* Assignment Interface */
.assignments-container {
  min-height: 100px;
  margin-top: var(--space-md);
}

.assignments-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-md);
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.assignments-table thead {
  background: var(--slate-dark);
  color: var(--white);
}

.assignments-table th {
  padding: var(--space-md);
  text-align: left;
  font-weight: 600;
  font-size: var(--font-sm);
  border-bottom: 2px solid var(--border-color);
}

.assignments-table tbody tr {
  border-bottom: 1px solid var(--border-color);
}

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

.assignments-table tbody tr:hover {
  background: var(--gray-lightest);
}

.assignments-table td {
  padding: var(--space-md);
  vertical-align: middle;
}

/* Employee column (1st) - left-aligned, moderate width */
.assignments-table th:nth-child(1),
.assignments-table td:nth-child(1) {
  width: 18%;
}

/* Shift column (2nd) - left-aligned, needs more space */
.assignments-table th:nth-child(2),
.assignments-table td:nth-child(2) {
  width: 28%;
}

/* Wing column (3rd) - center-aligned */
.assignments-table th:nth-child(3),
.assignments-table td:nth-child(3) {
  text-align: center;
  width: 14%;
}

/* Days column (4th) - left-aligned for long text */
.assignments-table th:nth-child(4),
.assignments-table td:nth-child(4) {
  width: 28%;
}

/* Actions column (5th) - center-aligned */
.assignments-table th:nth-child(5),
.assignments-table td:nth-child(5) {
  text-align: center;
  width: 12%;
}

.shift-name-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background: var(--white);
  border: 1px solid var(--gray-medium);
  border-left: 4px solid var(--blue-primary);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignments-summary {
  text-align: right;
  font-weight: 600;
  color: var(--navy-dark);
  margin-top: var(--space-sm);
}

/* Custom Time Picker */
.time-picker-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.time-select {
  width: 90px;
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--navy-dark);
  text-align: center;
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s ease;
}

.time-select:hover {
  border-color: var(--blue-light);
  background: var(--gray-lightest);
}

.time-select:focus {
  outline: none;
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  background: var(--white);
}

.time-separator {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--navy-dark);
  user-select: none;
}

/**
 * ROSTER VIEWER
 * Roster viewer modal, schedule days, and assignments table
 */

.viewer-section {
  margin-bottom: var(--space-2xl);
  /* No min-height - allow natural height to prevent awkward gaps */
}

.viewer-section-title {
  font-size: var(--font-xl);
  color: var(--navy-dark);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
}

.viewer-section-title i {
  margin-right: var(--space-sm);
  color: var(--blue-primary);
}

.roster-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.roster-info-item {
  padding: var(--space-lg);
  background: var(--gray-lightest);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.roster-info-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.roster-info-label {
  font-size: var(--font-sm);
  color: var(--gray-dark);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.roster-info-value {
  font-size: var(--font-2xl);
  font-weight: 700;
  color: var(--navy-dark);
}

.roster-notes {
  padding: var(--space-lg);
  background: var(--gray-lightest);
  border-left: 4px solid var(--blue-primary);
  border-radius: var(--radius-sm);
  margin-top: var(--space-lg);
}

/* Wing Distribution Summary */
.wing-distribution-summary {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  background: var(--gray-lightest);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.wing-distribution-label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--gray-dark);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wing-distribution-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.wing-distribution-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.wing-distribution-badge {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  font-weight: 600;
}

.wing-distribution-badge--west {
  background: rgba(52, 152, 219, 0.15);
  color: var(--blue-medium);
}

.wing-distribution-badge--east {
  background: rgba(46, 204, 113, 0.15);
  color: var(--green-medium);
}

.wing-distribution-badge--dementia {
  background: rgba(155, 89, 182, 0.15);
  color: var(--purple-medium);
}

.wing-distribution-stats {
  font-size: var(--font-sm);
  color: var(--text-dark);
}

/* Schedule Days Container */
.schedule-days-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-sm);
  align-items: stretch; /* Make all columns equal height */
  min-height: 300px; /* Ensure consistent height across wing filters */
}

.schedule-day-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  transition: all var(--transition-fast);
  display: flex; /* Flex container for consistent stretching */
  flex-direction: column;
}

.schedule-day-card:hover {
  box-shadow: var(--shadow-sm);
}

.schedule-day-card.empty {
  opacity: 0.6;
  background: var(--gray-lightest);
}

.schedule-day-header {
  background: var(--slate-dark);
  color: var(--white);
  padding: var(--space-md);
  text-align: center;
  font-weight: 600;
  font-size: var(--font-sm);
  flex-shrink: 0; /* Don't shrink header */
}

.schedule-day-assignments {
  padding: var(--space-md);
  min-height: 120px; /* Maintain minimum height even when empty or filtered */
  display: flex; /* Flex container to enforce consistent height */
  flex-direction: column;
  flex-grow: 1; /* Fill remaining space in card */
  gap: 12px; /* Professional spacing between multiple shift cards */
}

/* "No shifts" placeholder - managed by JavaScript, matches shift card height */
.schedule-day-empty-placeholder {
  height: 150px; /* EXACT height (not min-height) for perfect consistency */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--gray-dark);
  font-size: var(--font-sm);
  font-style: italic;
  flex-shrink: 0; /* Prevent shrinking below 150px */
}

.schedule-day-shift {
  height: 150px; /* EXACT height (not min-height) for perfect consistency */
  display: flex;
  flex-direction: column;
  flex-shrink: 0; /* Prevent shrinking below 150px */
}

.schedule-shift-badge {
  text-align: center;
  padding: 16px 10px 0 10px; /* Top: 16px for wing badge breathing room, sides: 10px, bottom: 0 */
  background: var(--gray-lightest);
  border-left: 4px solid var(--blue-primary);
  border-radius: var(--radius-sm);
  flex: 1; /* Take full height of parent (150px exact) */
  display: flex;
  flex-direction: column;
  gap: 12px; /* Professional spacing between elements */
}

/* Wing-specific left border accent colors */
.schedule-day-shift[data-wing-id="west"] .schedule-shift-badge {
  border-left-color: var(--wing-west);
}

.schedule-day-shift[data-wing-id="east"] .schedule-shift-badge {
  border-left-color: var(--wing-east);
}

.schedule-day-shift[data-wing-id="dementia"] .schedule-shift-badge {
  border-left-color: var(--wing-dementia);
}

.schedule-day-shift[data-wing-id="facility"] .schedule-shift-badge {
  border-left-color: var(--wing-facility);
}

.schedule-shift-header {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 4px; /* Tight gap between shift name and time within header */
}

.schedule-shift-name {
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--navy-dark);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.schedule-shift-time {
  font-size: var(--font-xs);
  color: var(--gray-dark);
  text-align: center;
}

.schedule-shift-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto; /* Push to bottom of card */
  padding-top: 12px;
  padding-bottom: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.schedule-wing-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 95px;
  max-width: 95px;
  height: 22px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-wing-badge--west {
  background: var(--wing-west-bg);
  color: var(--wing-west-text);
}

.schedule-wing-badge--east {
  background: var(--wing-east-bg);
  color: var(--wing-east-text);
}

.schedule-wing-badge--dementia {
  background: var(--wing-dementia-bg);
  color: var(--wing-dementia-text);
}

.schedule-wing-badge--facility {
  background: var(--wing-facility-bg);
  color: var(--wing-facility-text);
}

/* Responsive: stack header on very small screens */
@media (max-width: 400px) {
  .schedule-shift-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

.schedule-shift-employees {
  font-size: var(--font-sm);
  color: var(--text-dark);
  margin-top: var(--space-xs);
}

/* Screen: show icon + count */
.schedule-shift-employees.screen-only {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

/* Screen: hide print names */
.schedule-shift-employees.print-only {
  display: none;
}

/* Viewer Assignments Table */
.viewer-assignments-table {
  width: 100%;
  table-layout: fixed; /* Fixed table layout prevents column jumping */
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.viewer-assignments-table thead {
  background: var(--slate-dark);
  color: var(--white);
}

.viewer-assignments-table th {
  padding: var(--space-md);
  text-align: left;
  font-weight: 600;
  font-size: var(--font-sm);
  vertical-align: middle;
}

/* Employee column (1st) - left-aligned with fixed width */
.viewer-assignments-table th:nth-child(1),
.viewer-assignments-table td:nth-child(1) {
  width: 18%;
  text-align: left;
  vertical-align: middle;
}

/* Shift column (2nd) - left-aligned with fixed width */
.viewer-assignments-table th:nth-child(2),
.viewer-assignments-table td:nth-child(2) {
  width: 18%;
  text-align: left;
  vertical-align: middle;
}

/* Wing column (3rd) - center-aligned with fixed width */
.viewer-assignments-table th:nth-child(3),
.viewer-assignments-table td:nth-child(3) {
  width: 12%;
  text-align: center;
  vertical-align: middle;
}

/* Time column (4th) - center-aligned with fixed width */
.viewer-assignments-table th:nth-child(4),
.viewer-assignments-table td:nth-child(4) {
  width: 14%;
  text-align: center;
  vertical-align: middle;
}

/* Days column (5th) - left-aligned with fixed width */
.viewer-assignments-table th:nth-child(5),
.viewer-assignments-table td:nth-child(5) {
  width: 26%;
  text-align: left;
  vertical-align: middle;
}

/* Hours column (6th) - right-aligned with fixed width */
.viewer-assignments-table th:nth-child(6),
.viewer-assignments-table td:nth-child(6) {
  width: 12%;
  text-align: right;
  vertical-align: middle;
  padding-right: var(--space-lg);
}

.viewer-assignments-table tbody tr {
  border-bottom: 1px solid var(--border-color);
}

.viewer-assignments-table tbody tr:last-child {
  border-bottom: none;
}

.viewer-assignments-table tbody tr:hover {
  background: var(--gray-lightest);
}

.viewer-assignments-table td {
  padding: var(--space-md);
}

/* Wing badges in viewer table - ensure consistent sizing */
.viewer-assignments-table .assignment-wing-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  min-width: 100px;
  max-width: 100px;
  height: 22px;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/**
 * WING FILTER
 * Wing filter tabs, badges, and CSS-based filtering
 */

/* Wing Filter Tabs (for modal scalability) */
.wing-filter-section {
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-color);
}

.wing-filter-tabs-container {
  margin-bottom: -1px; /* Overlap border */
}

.wing-filter-tabs {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  padding-bottom: 0;
}

.wing-filter-tab {
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: transparent;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-size: var(--font-sm);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.wing-filter-tab:hover {
  background: var(--gray-lightest);
  border-bottom-color: var(--gray-medium);
}

.wing-filter-tab.active {
  border-bottom-color: var(--blue-primary);
  font-weight: 600;
  color: var(--blue-primary);
}

.wing-filter-tab-icon {
  font-size: 1rem;
}

.wing-tab-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.wing-tab-badge--west {
  background: var(--wing-west-bg);
  color: var(--wing-west-text);
}

.wing-tab-badge--east {
  background: var(--wing-east-bg);
  color: var(--wing-east-text);
}

.wing-tab-badge--dementia {
  background: var(--wing-dementia-bg);
  color: var(--wing-dementia-text);
}

.wing-tab-badge--facility {
  background: var(--wing-facility-bg);
  color: var(--wing-facility-text);
}

/* CSS-based filtering (no DOM manipulation) */
.schedule-days-container[data-current-wing]:not([data-current-wing="all"]) .schedule-day-shift:not([data-wing-id]) {
  display: none;
}

.schedule-days-container[data-current-wing="west"] .schedule-day-shift:not([data-wing-id="west"]) {
  display: none;
}

.schedule-days-container[data-current-wing="east"] .schedule-day-shift:not([data-wing-id="east"]) {
  display: none;
}

.schedule-days-container[data-current-wing="dementia"] .schedule-day-shift:not([data-wing-id="dementia"]) {
  display: none;
}

.schedule-days-container[data-current-wing="facility"] .schedule-day-shift:not([data-wing-id="facility"]) {
  display: none;
}

/* Table row filtering */
.viewer-assignments-table tbody[data-current-wing]:not([data-current-wing="all"]) tr:not([data-wing]) {
  display: none;
}

.viewer-assignments-table tbody[data-current-wing="west"] tr:not([data-wing="west"]) {
  display: none;
}

.viewer-assignments-table tbody[data-current-wing="east"] tr:not([data-wing="east"]) {
  display: none;
}

.viewer-assignments-table tbody[data-current-wing="dementia"] tr:not([data-wing="dementia"]) {
  display: none;
}

.viewer-assignments-table tbody[data-current-wing="facility"] tr:not([data-wing="facility"]) {
  display: none;
}

/* Wing Selector (card-based tabs) */
.wing-selector {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.wing-selector__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--navy-dark);
  font-size: var(--font-base);
  white-space: nowrap;
}

.wing-selector__label i {
  color: var(--blue-primary);
  font-size: 1.1rem;
}

.wing-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
}

.wing-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--white);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--navy-dark);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.wing-tab:hover {
  border-color: var(--blue-primary);
  background: var(--gray-lightest);
  transform: translateY(-1px);
}

.wing-tab.active {
  background: var(--navy-dark);
  color: var(--white);
  border-color: var(--navy-dark);
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.15);
}

.wing-tab__badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.wing-tab.active .wing-tab__badge {
  background: var(--blue-primary);
}

/* Wing color indicators */
.wing-tab[data-wing="west"].active {
  border-left: 4px solid var(--wing-west);
}

.wing-tab[data-wing="east"].active {
  border-left: 4px solid var(--wing-east);
}

.wing-tab[data-wing="dementia"].active {
  border-left: 4px solid var(--wing-dementia);
}

.wing-tab[data-wing="facility"].active {
  border-left: 4px solid var(--wing-facility);
}

.wing-tab[data-wing="all"].active {
  border-left: 4px solid #6c757d;
}

/* Wing badges on assignments (for schedule display and table) */
.assignment-wing-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 100px;
  max-width: 100px;
  height: 22px;
  text-align: center;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Wing-specific colors - higher specificity for both schedule and table */
.assignment-wing-badge.assignment-wing-badge--west {
  background: var(--wing-west-bg);
  color: var(--wing-west-text);
}

.assignment-wing-badge.assignment-wing-badge--east {
  background: var(--wing-east-bg);
  color: var(--wing-east-text);
}

.assignment-wing-badge.assignment-wing-badge--dementia {
  background: var(--wing-dementia-bg);
  color: var(--wing-dementia-text);
}

.assignment-wing-badge.assignment-wing-badge--facility {
  background: var(--wing-facility-bg);
  color: var(--wing-facility-text);
}

/* Wing badge in Edit/Duplicate modal assignment table - use same sizing */
.assignments-table .assignment-wing-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  min-width: 95px;
  max-width: 95px;
  height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .wing-selector {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .wing-tabs {
    width: 100%;
  }

  .wing-tab {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .wing-tabs {
    flex-direction: column;
  }

  .wing-tab {
    width: 100%;
  }
}

/* Empty State Styles */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  text-align: center;
}

.empty-state__icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.5;
  color: var(--gray-medium);
}

.empty-state__message {
  font-size: var(--font-md);
  line-height: 1.5;
  color: var(--text-muted);
}

/**
 * NOTIFICATIONS
 * Toast notifications and notification system
 */

#notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10002; /* Above all modals (nested modals are 10001) */
  max-width: 400px;
}

.notification {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  border-left: 4px solid var(--blue-primary);
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  min-width: 350px;
  opacity: 1;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* Notification content */
.notification-content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  flex: 1;
}

.notification-content i {
  font-size: var(--font-lg);
  margin-top: 2px;
  flex-shrink: 0;
}

.notification-content span {
  font-size: var(--font-sm);
  line-height: 1.6;
  color: var(--navy-dark);
  font-weight: 500;
  word-wrap: break-word;
}

/* Notification close button */
.notification-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--font-xl);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  flex-shrink: 0;
  margin-top: -2px;
}

.notification-close:hover {
  color: var(--navy-dark);
  transform: scale(1.1);
}

/* Success notification */
.notification-success {
  border-left-color: var(--green-success);
  background-color: #f0f9f4;
  background: linear-gradient(to right, #e8f5e9 0%, #ffffff 100%);
}

.notification-success .notification-content i {
  color: var(--green-success);
}

.notification-success .notification-content span {
  color: #1e5631;
}

/* Error notification */
.notification-error {
  border-left-color: var(--red-danger);
  background-color: #fff5f5;
  background: linear-gradient(to right, #fff1f1 0%, #ffffff 100%);
}

.notification-error .notification-content i {
  color: var(--red-danger);
}

.notification-error .notification-content span {
  color: #721c24;
}

/* Warning notification */
.notification-warning {
  border-left-color: var(--orange-warning);
  background-color: #fffbf0;
  background: linear-gradient(to right, #fff8e1 0%, #ffffff 100%);
}

.notification-warning .notification-content i {
  color: var(--orange-warning);
}

.notification-warning .notification-content span {
  color: #7d5d0f;
}

/**
 * PRINT STYLES
 * All print media queries consolidated
 */

@media print {
  /* Force landscape orientation for wall mounting */
  @page {
    size: landscape;
    margin: 0.5cm;
  }

  /* === PAGE BREAK RULES === */

  /* Roster Information section - keep together at top */
  .viewer-section:first-child {
    page-break-inside: avoid;
    break-inside: avoid;
    page-break-after: auto;
  }

  /* Schedule Breakdown section - ALWAYS start on new page for wall mounting */
  /* The entire section (heading + grid) must stay together on page 2 */
  .viewer-section:nth-child(2) {
    page-break-before: always;
    break-before: page;
    /* Keep entire section together - prevents orphaned heading */
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Heading: prevent break after and reduce margin to tighten coupling */
  .viewer-section:nth-child(2) .viewer-section-title {
    page-break-after: avoid;
    break-after: avoid;
    margin-bottom: 8px; /* Tighter coupling with grid */
  }

  /* CRITICAL: Grid must avoid breaking BEFORE it (stays with heading) */
  .schedule-days-container {
    page-break-inside: avoid;
    break-inside: avoid;
    page-break-before: avoid; /* KEY: Prevents break between heading and grid */
    break-before: avoid;
  }

  /* Keep each day card together */
  .schedule-day-card {
    page-break-inside: avoid;
  }

  /* Employee Assignments section - ALWAYS start on new page */
  .viewer-assignments-section {
    page-break-before: always;
  }

  /* Keep table header with content */
  .viewer-assignments-table {
    page-break-inside: auto;
  }

  .viewer-assignments-table thead {
    display: table-header-group;
  }

  .viewer-assignments-table tbody tr {
    page-break-inside: avoid;
  }

  /* Print employee names instead of icon + count */
  .schedule-shift-employees.screen-only {
    display: none;
  }

  .schedule-shift-employees.print-only {
    display: block;
    text-align: left;
  }

  .employee-slot {
    height: 15px;
    line-height: 15px;
    font-size: 11px;
    color: var(--text-dark);
    padding-left: 4px;
  }

  .employee-slot.filled {
    color: var(--navy-dark);
  }

  .employee-slot.empty {
    visibility: hidden;
  }

  .employee-slot.overflow {
    font-style: italic;
    color: var(--gray-dark);
  }

  /* Wing badges: force colors in print */
  .schedule-wing-badge {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
  }

  /* Ensure left border accent prints */
  .schedule-shift-badge {
    text-align: center;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
  }

  /* Wing filter tabs: hide in print (show all wings) */
  .wing-filter-section {
    display: none;
  }

  /* Force all wings to show in print (ignore filtering) */
  .schedule-days-container .schedule-day-shift {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 150px;
  }

  /* === SCHEDULE GRID → FLEXBOX FOR PRINT === */
  /* CSS Grid doesn't realign items after page breaks - switch to flexbox */
  .schedule-days-container {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 4px;
  }

  /* Each day card takes 1/7 of width - explicit values for print */
  .schedule-day-card {
    flex: 1 1 0;
    min-width: 0;
    align-self: flex-start;
  }

  /* Ensure shift cards align to top */
  .schedule-day-assignments {
    justify-content: flex-start;
  }

  .viewer-assignments-table tbody tr {
    display: table-row;
  }

  /* Prevent page breaks within shift cards */
  .schedule-day-shift {
    page-break-inside: avoid;
  }

  /* Force wing badge colors in print */
  .wing-tab-badge,
  .assignment-wing-badge {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
  }

  /* Ensure "No Shifts" placeholder remains center-aligned in print */
  .schedule-day-assignments .schedule-day-empty-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  /* Hide wing selector in print */
  .wing-selector {
    display: none;
  }

  /* Wing section page breaks */
  .wing-section {
    page-break-before: always;
  }

  .wing-section:first-child {
    page-break-before: avoid;
  }

  /* Wing section headers for print */
  .wing-section-header {
    font-size: 24px;
    font-weight: 700;
    padding: 1rem;
    background: var(--navy-dark);
    color: white;
    margin-bottom: 1rem;
  }

  .wing-section-header--west {
    background: var(--wing-west);
  }

  .wing-section-header--east {
    background: var(--wing-east);
  }

  .wing-section-header--dementia {
    background: var(--wing-dementia);
  }

  .wing-section-header--facility {
    background: var(--wing-facility);
  }
}

/**
 * PRINT WINDOW STYLES
 * Minimal styles for the print window document (window.open)
 *
 * Note: The print window loads the full CSS bundle, so it already has
 * access to all component styles. This file only contains:
 * - Base body styling for the print document
 * - Print-specific header element
 * - Print-window-specific overrides
 */

/* Base body styles for print document */
.print-document {
  font-family: Arial, sans-serif;
  margin: 20px;
  color: var(--navy-dark, #2c3e50);
  background: var(--white, #fff);
}

/* Print header - unique to print output */
.roster-print-header {
  text-align: center;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--navy-dark, #2c3e50);
  padding-bottom: 10px;
}

.roster-print-header h2 {
  margin: 0 0 var(--space-xs, 0.5rem) 0;
  font-size: var(--font-2xl, 1.5rem);
  color: var(--navy-dark, #2c3e50);
}

.roster-print-header div {
  font-size: var(--font-base, 1rem);
  color: var(--gray-dark, #7f8c8d);
}

/**
 * ROSTER MANAGER CSS - MODERN NAVY PROFESSIONAL THEME
 * Cohesive design matching employee and manager apps
 * Clean, modern, trustworthy
 *
 * Modular CSS architecture - all styles organized in partials
 */

/* No external time picker library imports - using custom dropdowns */

/* ===== FOUNDATION ===== */

/* ===== LAYOUT & STRUCTURE ===== */

/* ===== COMPONENTS ===== */

/* ===== PAGE-SPECIFIC ===== */

/* ===== FEATURES ===== */

/* ===== PRINT ===== */

