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

:root {
  --primary: #1a8a7a;
  --primary-dark: #147a6b;
  --accent: #6b2d7b;
  --accent-light: #8b4a9e;
  --yellow: #f5c518;
  --danger: #dc2626;
  --success: #1a8a7a;
  --warning: #f59e0b;
  --bg: #f0f7f6;
  --card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  background: transparent;
  color: white;
  padding: 0.4rem 1rem;
  text-align: center;
}

.header-logo {
  max-width: 600px;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}


main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--text);
}

h3 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

input[type="text"],
input[type="tel"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s;
}

textarea {
  font-family: inherit;
}

textarea::placeholder {
  font-size: 0.85rem;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.help-text {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

/* Availability grid */
.availability-grid {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.availability-grid table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.availability-grid th,
.availability-grid td {
  border: 1px solid var(--border);
  padding: 0.5rem;
  text-align: center;
  vertical-align: middle;
}

.availability-grid th {
  background: #f1f5f9;
  font-weight: 600;
  font-size: 0.8rem;
}

.availability-grid th.slot-header {
  min-width: 100px;
}

.availability-grid td.activity-name {
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
  background: #f8fafc;
}

.availability-grid td.min-badge {
  font-size: 0.75rem;
  color: var(--text-light);
  white-space: nowrap;
}

.availability-grid input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* Cake */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--accent-light);
}

.btn-small {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  cursor: pointer;
}

#form-message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  display: none;
  font-weight: 500;
}

#form-message.success {
  display: block;
  background: #dcfce7;
  color: var(--success);
}

#form-message.error {
  display: block;
  background: #fee2e2;
  color: var(--danger);
}

/* Dashboard */
.dashboard-activity {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.activity-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-ok {
  background: #dcfce7;
  color: var(--success);
}

.badge-warning {
  background: #fef3c7;
  color: #b45309;
}

.badge-danger {
  background: #fee2e2;
  color: var(--danger);
}

.slot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}

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

.slot-label {
  font-weight: 500;
  color: var(--text-light);
}

.slot-volunteers {
  color: var(--text);
  font-size: 0.85rem;
}

/* Cakes */
.cake-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cake-icon {
  font-size: 1.5rem;
}

.cake-info strong {
  display: block;
  font-size: 0.95rem;
}

.cake-info span {
  color: var(--text-light);
  font-size: 0.85rem;
}

.no-data {
  color: var(--text-light);
  font-style: italic;
  padding: 1rem 0;
}

/* Admin */
.admin-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.admin-section h3 {
  margin-top: 0;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.admin-item:last-child {
  border-bottom: none;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.inline-form input {
  flex: 1;
  min-width: 120px;
}

.inline-form input[type="number"] {
  flex: 0;
  width: 120px;
}

/* Responsive */
@media (max-width: 600px) {
  header {
    padding: 0;
  }

  .header-logo {
    max-width: 100%;
    border-radius: 0;
  }

  .availability-grid th,
  .availability-grid td {
    padding: 0.3rem;
    font-size: 0.75rem;
  }

  .availability-grid th:first-child,
  .availability-grid td.activity-name {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #f8fafc;
  }

  .availability-grid th:first-child {
    background: #f1f5f9;
    z-index: 2;
  }

  .activity-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Popup */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.popup-box {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.popup-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.popup-success .popup-icon {
  color: var(--success);
}

.popup-error .popup-icon {
  color: var(--danger);
}

.popup-message {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.popup-close {
  width: auto;
  padding: 0.6rem 2.5rem;
}
