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

:root {
  --primary: #c05000;
  --primary-light: #e06010;
  --primary-pale: #fef3e8;
  --accent: #e06010;
  --accent-dark: #b84d00;
  --text: #1a1a1a;
  --muted: #777;
  --border: #d0d0d0;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.10);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f0f0f0;
  color: var(--text);
  min-height: 100vh;
}

header {
  background: linear-gradient(to bottom,var(--primary-light)  0%, #1a1a1a 75%);
  color: white;
  text-align: center;
  padding: 2.5rem 1rem 0;
}

header .badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 0.4rem;
}

header p {
  font-size: 1rem;
  opacity: 0.88;
  max-width: 480px;
  margin: 0 auto;
}

.logo { height: 80px; width: auto; margin-bottom: 0.75rem; display: block; margin-left: auto; margin-right: auto; }

nav {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.25rem 1rem 0;
}

nav button {
  background: rgba(255,255,255,0.15);
  border: none;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  padding: 0.6rem 1.4rem;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

nav button:hover {
  background: rgba(255,255,255,0.25);
  color: white;
}

nav button.active {
  background: #f0f0f0;
  color: var(--primary);
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--primary-pale);
}

.field {
  margin-bottom: 1.1rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

label .req { color: #c0392b; margin-left: 2px; }

input[type="text"],
input[type="email"],
select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s;
  background: white;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(224,96,16,0.15);
}

.dates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.month-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1rem 0 0.4rem;
  grid-column: 1 / -1;
}

.date-check {
  position: relative;
}

.date-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.date-check label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.4rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 400;
  text-align: center;
  background: #fafafa;
  user-select: none;
}

.date-check label .day-name {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.1rem;
}

.date-check label .day-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.date-check label .month-short {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.date-check input:checked + label {
  border-color: var(--primary-light);
  background: var(--primary-pale);
}

.date-check input:checked + label .day-num {
  color: var(--primary);
}

.date-check label::after {
  content: '✓';
  font-size: 0.7rem;
  font-weight: 700;
  color: transparent;
  margin-top: 0.15rem;
}

.date-check input:checked + label::after {
  color: var(--primary-light);
}

.date-check label:hover {
  border-color: var(--primary-light);
  background: var(--primary-pale);
}

.availability-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.select-all-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary-light);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.btn-text:hover { color: var(--primary); }

.submit-btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(245,166,35,0.35);
}

.submit-btn:hover { background: var(--accent-dark); }
.submit-btn:active { transform: scale(0.98); }

#success-view {
  display: none;
  text-align: center;
}

#success-view .check-circle {
  width: 72px;
  height: 72px;
  background: var(--primary-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.25rem;
}

#success-view h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

#success-view p {
  color: var(--muted);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

#success-view .avail-summary {
  background: var(--primary-pale);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  text-align: left;
}

#success-view .avail-summary strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

#success-view .avail-summary span {
  font-size: 0.9rem;
  color: var(--text);
}

.another-btn {
  background: white;
  border: 2px solid var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.another-btn:hover { background: var(--primary-pale); }

#admin-toggle {
  text-align: center;
  margin-top: 2rem;
}

#admin-toggle button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

#overview-panel {
  display: none;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-top: 1rem;
}

#overview-panel h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

.overview-total {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.overview-total strong {
  color: var(--text);
}

.overview-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.roster-name {
  background: var(--primary-pale);
  color: var(--primary);
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.overview-month {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

.overview-cell {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.5rem;
  text-align: center;
  background: #fafafa;
}

.overview-cell .cell-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.overview-cell .cell-count {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.overview-cell .cell-word {
  font-size: 0.72rem;
  color: var(--muted);
}

.overview-cell.top {
  border-color: var(--primary-light);
  background: var(--primary-pale);
}

.overview-cell.top .cell-count {
  color: var(--primary);
}

.overview-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.btn-outline {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s;
}

.btn-outline:hover { border-color: var(--primary-light); }

.btn-danger {
  padding: 0.5rem 1rem;
  border: 1.5px solid #e0c0c0;
  background: white;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: #c0392b;
  transition: background 0.15s;
}

.btn-danger:hover { background: #fef0f0; }

.response-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.response-row:last-child { border-bottom: none; }

.response-content { flex: 1; min-width: 0; }

.response-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0.2rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.15s;
}

.delete-btn:hover { color: #c0392b; }
.delete-btn .material-icons { font-size: 1.2rem; }

.response-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
}

.date-pill {
  background: var(--primary-pale);
  color: var(--primary);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.response-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 400px) {
  .dates-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
}
