body {
  font-family: 'SF Pro Display', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: #f8f9fb;
  padding: 40px 0;
  color: #222;
}

/* Background slideshow container */
.background-slideshow {
  position: absolute;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 1;
  overflow: hidden;
}
.background-slideshow .slide {
  position: absolute;
  top: 0; left: 0; width: 100vw; height: 100vh;
  opacity: 0;
  transition: opacity 1.5s ease;
  background-size: cover;
  background-position: center;
  will-change: transform, opacity;
  animation: kenburns 16s linear infinite;
}
.background-slideshow .slide.active {
  opacity: 1;
  z-index: 2;
}
@keyframes kenburns {
  0% { transform: scale(1) translate(0,0); }
  100% { transform: scale(1.12) translate(-2%, -2%); }
}
#password-screen > .background-slideshow { z-index: 1; }
#password-screen > div[style*='background:#fff'] { z-index: 2; position: relative; }

h1 {
  text-align: center;
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: -1px;
  margin-bottom: 32px;
  color: #222;
}

#schedule-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 0 auto 32px auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.07);
}

th, td {
  border: none;
  padding: 8px 4px;
  text-align: center;
  font-size: 0.98rem;
  max-width: 110px;
  word-break: break-word;
}

/* Make day columns even more compact */
#schedule-table th:not(:first-child),
#schedule-table td:not(:first-child) {
  min-width: 80px;
  max-width: 100px;
  padding-left: 2px;
  padding-right: 2px;
}

th {
  background: #f3f4f7;
  font-weight: 600;
  color: #444;
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.3s;
}

tr:last-child td, tfoot th, tfoot td {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: #f7f8fa;
}

tbody tr:hover {
  background: #eaf1fb;
  transition: background 0.2s;
}

input[type="time"] {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1rem;
  background: #f9fafb;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
  margin: 0 2px;
  width: 90px;
}
input[type="time"]:focus {
  border: 1.5px solid #007aff;
  box-shadow: 0 0 0 2px #007aff22;
  background: #fff;
}

input[type="checkbox"].off-day {
  accent-color: #007aff;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 4px;
}

#warnings {
  width: 90%;
  margin: 0 auto 18px auto;
  background: #fff4f4;
  color: #b71c1c;
  border: 1px solid #ffd6d6;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 1.08rem;
  box-shadow: 0 2px 8px 0 #ffd6d633;
  display: none;
}
#warnings:empty {
  display: none;
}
#warnings:not(:empty) {
  display: block;
}

#schedule-table th[style*="background-color: #ffcccc"] {
  background: linear-gradient(90deg, #ffeaea 0%, #ffd6d6 100%) !important;
  color: #b71c1c;
}

#summary-row th, #summary-row td {
  background: #f3f4f7;
  font-weight: 600;
  color: #007aff;
  border-top: 1px solid #e5e7eb;
  font-size: 1.08rem;
}

/* Add styles for time range dropdowns in schedule cells */
.time-range-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.time-range-row select {
  margin: 0 2px;
  min-width: 44px;
  font-size: 1em;
  padding: 5px 18px 5px 8px;
  border-radius: 8px;
  border: 1.5px solid #e0e0e0;
  background: #f7f8fa;
  box-shadow: 0 1px 4px #0001;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  position: relative;
  color: #222;
}
.time-range-row select:focus, .time-range-row select:hover {
  border: 1.5px solid #007aff;
  box-shadow: 0 0 0 2px #007aff22;
  background: #fff;
}
/* Custom arrow for select */
.time-range-row select {
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23999" height="16" viewBox="0 0 20 20" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M7.293 7.293a1 1 0 011.414 0L10 8.586l1.293-1.293a1 1 0 111.414 1.414l-2 2a1 1 0 01-1.414 0l-2-2a1 1 0 010-1.414z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px 16px;
}
.time-range-row .time-sep {
  margin: 0 2px;
  font-weight: 600;
  color: #888;
}

/* Controls row for Off/VAC/RDO */
.special-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-top: 2px;
  margin-bottom: 2px;
  margin-right: 2px;
  flex-wrap: wrap;
  max-width: 100%;
}
.special-controls-row button,
.special-controls-row label {
  margin: 0;
  white-space: nowrap;
  box-sizing: border-box;
  vertical-align: middle;
  font-size: 0.92em;
  padding: 2px 6px;
  min-width: 36px;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Prevent VAC and RDO from wrapping */
.special-controls-row button {
  white-space: nowrap;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
  vertical-align: middle;
  font-size: 0.92em;
  padding: 2px 6px;
  min-width: 36px;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Make sure cell content is vertically stacked and spaced */
#schedule-table td {
  vertical-align: top;
  padding-top: 10px;
  padding-bottom: 10px;
}

.shake {
  animation: shake 0.4s;
}
@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

/* Lower opacity for scheduler when not editing */
.not-editing #schedule-table,
.not-editing #schedule-table * {
  opacity: 0.55 !important;
  pointer-events: none !important;
  transition: opacity 0.2s;
}

/* Restore full opacity when editing */
.editing #schedule-table,
.editing #schedule-table * {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.editing #schedule-table th {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  box-shadow: 0 2px 8px #0001;
}

.preview-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  font-size: 1.08rem;
  margin: 0 auto;
}
.preview-th, .preview-table th, .preview-table td, .preview-td {
  border: 1px solid #ccc;
  text-align: center;
  padding: 8px 4px;
  font-size: 1.08rem;
  box-sizing: border-box;
  word-break: break-word;
  white-space: normal;
  width: 12.5%; /* 8 columns: 1 for Employee/Date, 7 for days */
  min-width: 90px;
  max-width: 120px;
}
@media print {
  h1,
  #week-selector-row,
  #warnings,
  #schedule-table,
  #availability-modal,
  #add-employee-btn,
  #edit-week-btn,
  #save-week-btn,
  #print-btn {
    display: none !important;
  }
  #print-preview-section {
    display: block !important;
    position: static !important;
    margin: 0 auto !important;
    width: 100vw !important;
    background: #fff !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-width: 0 !important;
    max-width: 100vw !important;
  }
  #print-preview {
    display: block !important;
    margin: 0 auto !important;
    width: 100% !important;
    background: #fff !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  #print-preview table {
    display: table !important;
    width: 100% !important;
    margin: 0 auto !important;
    border: 1px solid #ccc !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
  }
  #print-preview th, #print-preview td {
    min-width: 140px !important;
    max-width: 140px !important;
    width: 140px !important;
    text-align: center !important;
    padding: 10px 6px !important;
    box-sizing: border-box !important;
    border: 1px solid #ccc !important;
    font-size: 1.08rem !important;
    word-break: break-word !important;
    white-space: normal !important;
  }
  #print-preview table.preview-table {
    table-layout: fixed !important;
    width: 100% !important;
    font-size: 0.95rem !important;
  }
  #print-preview .preview-th, #print-preview .preview-td, #print-preview th, #print-preview td {
    min-width: 80px !important;
    max-width: 100px !important;
    width: 12.5% !important;
    padding: 6px 2px !important;
    font-size: 0.95rem !important;
  }
}

.special-btn {
  background: #f3f4f7 !important;
  color: #888 !important;
  opacity: 0.6;
  border: none;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}
.special-btn.vac {
  background: rgba(255, 200, 120, 0.5) !important;
  color: rgba(255, 140, 0, 0.5) !important;
  opacity: 1;
}
.special-btn.rdo {
  background: rgba(224, 234, 255, 0.5) !important;
  color: rgba(0, 122, 255, 0.5) !important;
  opacity: 1;
}
.special-btn.stat {
  background: rgba(224, 255, 224, 0.5) !important;
  color: rgba(0, 122, 51, 0.5) !important;
  opacity: 1;
}
.special-btn.selected.vac {
  background: #ffc878 !important;
  color: #ff8c00 !important;
}
.special-btn.selected.rdo {
  background: #e0eaff !important;
  color: #007aff !important;
}
.special-btn.selected.stat {
  background: #e0ffe0 !important;
  color: #007a33 !important;
}
.special-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
