/* ===== Base Layout ===== */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f9fafb;
  margin: 0;
  padding: 0;
  color: #1e293b;
}

.container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ===== Header ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.header h1 {
  font-weight: 700;
  color: #2563eb;
  margin: 0;
}

.status {
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
}

.status.ready {
  background-color: #dcfce7;
  color: #166534;
}

.status.not-ready {
  background-color: #fef3c7;
  color: #92400e;
}

/* ===== Controls ===== */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.upload-btn {
  background: #2563eb;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: 0.2s;
}

.upload-btn:hover {
  background: #1d4ed8;
}

.file-name {
  font-style: italic;
  color: #475569;
}

button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: #e2e8f0;
}

button.secondary:hover {
  background: #cbd5e1;
}

button:not(.secondary) {
  background: #2563eb;
  color: white;
}

button:not(.secondary):hover {
  background: #1e40af;
}

/* ===== Results and Table ===== */
.results h2 {
  margin-top: 1.5rem;
  border-top: 2px solid #e2e8f0;
  padding-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

table th {
  background: #f1f5f9;
  text-align: left;
  padding: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

table td {
  padding: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.error-box {
  background: #fee2e2;
  color: #991b1b;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #fecaca;
}

/* ===== Chart ===== */
#coverageChart {
  margin-top: 2rem;
  width: 100%;
  height: 300px;
}

/* ---------- IRPA Signup Calendar ---------- */

#signupContainer {
  max-width: 750px;
  margin: 20px auto;
  padding: 0 12px;
}

#signupHeader {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

#signupHeader h1 {
  font-size: 1.4rem;
  margin: 0;
}

#providerInfo {
  margin: 0;
  font-size: 0.95rem;
  color: #555;
}

/* Month picker */

#monthPickerLabel {
  font-size: 0.9rem;
}

#monthPicker {
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* Weekday labels */

#weekday-labels {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr);
  max-width: 700px;
  margin: 10px auto 4px auto;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: #444;
}

/* Calendar grid */

#calendar {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-width: 700px;
  margin: 0 auto 16px auto;
}

/* Each day cell */

.irpa-day-cell {
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 0;
  text-align: center;
  font-size: 0.95rem;
  cursor: pointer;
  background: #fafafa;
  user-select: none;
  min-height: 40px;
  line-height: 1.2;
}

/* Empty spacer cells for leading days */
.irpa-day-cell.empty {
  visibility: hidden;
  cursor: default;
  border: none;
  background: transparent;
}

/* Selected day */

.irpa-day-cell.selected {
  background-color: #10b981;
  color: white;
  border-color: #059669;
}

/* Desired nights + button area */

#controlsRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  max-width: 700px;
  margin: 8px auto 0 auto;
}

#desired {
  width: 4rem;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

#saveBtn {
  padding: 6px 12px;
  border-radius: 4px;
  border: none;
  background-color: #2563eb;
  color: white;
  cursor: pointer;
}

#saveBtn:hover {
  background-color: #1d4ed8;
}
