/* Florence First SDA — Schedule App */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #1a2744;
  --gold:    #c49a3c;
  --gold-lt: #e8c97a;
  --cream:   #fdfaf5;
  --tan:     #f4ede0;
  --border:  #e0d5c5;
  --text:    #1a1208;
  --muted:   #6b5d4a;
  --radius:  12px;
  --shadow:  0 2px 16px rgba(0,0,0,0.09);
}

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

/* ── Header ─────────────────────────────────────── */
.site-header {
  background: var(--navy);
  color: #fff;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-header .brand {
  display: flex; flex-direction: column;
}
.site-header .church-name {
  font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--gold-lt); margin-bottom: 0.1rem;
}
.site-header h1 { font-size: 1.1rem; font-weight: 800; }
.site-header .gold-dot { color: var(--gold); }
.header-nav { display: flex; gap: 0.5rem; }
.header-nav a {
  color: rgba(255,255,255,0.75); text-decoration: none;
  font-size: 0.8rem; padding: 0.35rem 0.6rem; border-radius: 6px;
  transition: background 0.15s;
}
.header-nav a:hover, .header-nav a.active { background: rgba(255,255,255,0.12); color: #fff; }

/* ── Page layout ─────────────────────────────────── */
.page { max-width: 900px; margin: 0 auto; padding: 1rem; }
.page-wide { max-width: 1200px; margin: 0 auto; padding: 1rem; }

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.1rem; border-radius: 8px; border: none;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.97); }
.btn-primary   { background: var(--navy); color: #fff; }
.btn-gold      { background: var(--gold); color: #fff; }
.btn-outline   { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-danger    { background: #c0392b; color: #fff; }
.btn-sm        { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-icon      { padding: 0.5rem; border-radius: 50%; font-size: 1.1rem; }

/* ── Forms ───────────────────────────────────────── */
.field { margin-bottom: 1rem; }
.field label {
  display: block; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); margin-bottom: 0.35rem;
}
.field input, .field select, .field textarea {
  width: 100%; background: var(--tan);
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 0.6rem 0.75rem; font-size: 0.95rem; color: var(--text);
  outline: none; transition: border-color 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--navy);
}
.field .hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

/* ── Role label chips ────────────────────────────── */
.role-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 0.2rem 0.5rem; border-radius: 4px;
  background: rgba(26,39,68,0.08); color: var(--navy);
}

/* ── Week Card (mobile) ──────────────────────────── */
.week-card {
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.week-card-header {
  background: var(--navy); color: #fff;
  padding: 1rem 1.25rem;
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.week-card-header .sabbath-date {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em;
}
.week-card-header .sabbath-meta {
  font-size: 0.8rem; color: var(--gold-lt); margin-top: 0.2rem;
}
.week-card-body { padding: 0; }
.role-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.role-row:last-child { border-bottom: none; }
.role-icon {
  width: 2.2rem; height: 2.2rem; border-radius: 8px;
  background: var(--tan); display: flex; align-items: center;
  justify-content: center; font-size: 1.1rem; flex-shrink: 0;
}
.role-info { flex: 1; min-width: 0; }
.role-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
}
.role-name {
  font-size: 1.05rem; font-weight: 600; margin-top: 0.1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.role-name.empty { color: var(--muted); font-weight: 400; font-style: italic; }
.divider-label {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted);
  background: var(--tan); border-bottom: 1px solid var(--border);
}

/* ── Week nav ────────────────────────────────────── */
.week-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; gap: 0.5rem;
}
.week-nav .nav-btn {
  background: var(--cream); border: none; border-radius: 50%;
  width: 2.5rem; height: 2.5rem; font-size: 1.2rem; cursor: pointer;
  box-shadow: var(--shadow); transition: transform 0.1s;
  display: flex; align-items: center; justify-content: center;
}
.week-nav .nav-btn:active { transform: scale(0.92); }
.week-nav .nav-btn:disabled { opacity: 0.3; cursor: default; }
.week-nav .nav-center {
  text-align: center; flex: 1;
}
.week-nav .nav-quarter {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted);
}
.week-nav .nav-week-num {
  font-size: 0.85rem; font-weight: 600; color: var(--navy);
}

/* ── Quarter table (desktop) ─────────────────────── */
.quarter-table-wrap { overflow-x: auto; }
.quarter-table {
  width: 100%; border-collapse: collapse; font-size: 0.875rem;
  background: var(--cream); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.quarter-table thead { background: var(--navy); color: #fff; }
.quarter-table th {
  padding: 0.65rem 0.75rem; text-align: left;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; white-space: nowrap;
}
.quarter-table td {
  padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.quarter-table tbody tr:hover { background: var(--tan); cursor: pointer; }
.quarter-table tbody tr:last-child td { border-bottom: none; }
.quarter-table .date-cell { font-weight: 700; color: var(--navy); }
.quarter-table .name-cell { font-weight: 500; }
.quarter-table .empty-cell { color: var(--muted); font-style: italic; }
.quarter-table .notes-cell {
  font-size: 0.8rem; color: var(--muted); font-style: italic; max-width: 200px;
  overflow: hidden; text-overflow: ellipsis;
}
.quarter-table .today-row td { background: #fff9ec; }

/* ── Quarter selector ────────────────────────────── */
.quarter-selector {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.quarter-selector select {
  background: var(--cream); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.9rem;
  color: var(--text); cursor: pointer;
}

/* ── People table ────────────────────────────────── */
.people-table { width: 100%; border-collapse: collapse; }
.people-table th {
  text-align: left; padding: 0.6rem 0.75rem;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); border-bottom: 2px solid var(--border);
}
.people-table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--border); }
.people-table tr:last-child td { border-bottom: none; }
.people-table .cap-dot {
  display: inline-block; width: 0.55rem; height: 0.55rem;
  border-radius: 50%; background: var(--navy); margin-right: 0.25rem;
}
.people-table .cap-dot.off { background: var(--border); }

/* ── Checkbox pills ──────────────────────────────── */
.cap-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.cap-pill {
  font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0.5rem;
  border-radius: 4px; background: var(--tan); color: var(--muted);
  border: 1px solid var(--border);
}
.cap-pill.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── Generate wizard ─────────────────────────────── */
.wizard-steps {
  display: flex; gap: 0; margin-bottom: 1.5rem; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.wizard-step {
  flex: 1; padding: 0.6rem 0.5rem; text-align: center;
  font-size: 0.75rem; font-weight: 700; background: var(--tan); color: var(--muted);
  border-right: 1px solid var(--border); cursor: pointer;
}
.wizard-step:last-child { border-right: none; }
.wizard-step.active { background: var(--navy); color: #fff; }
.wizard-step.done   { background: #d4edda; color: #155724; }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; }
.wizard-footer {
  display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem;
}

/* ── Draft preview table ─────────────────────────── */
.draft-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.draft-table th {
  background: var(--navy); color: #fff; padding: 0.5rem 0.6rem;
  text-align: left; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.07em;
}
.draft-table td {
  padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.draft-table input, .draft-table select {
  width: 100%; background: transparent; border: none; border-bottom: 1px dashed var(--border);
  font-size: 0.82rem; padding: 0.1rem 0; outline: none; color: var(--text);
}
.draft-table input:focus, .draft-table select:focus {
  border-bottom-color: var(--navy); background: var(--tan);
}

/* ── Toasts ──────────────────────────────────────── */
#toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: #1a2744; color: #fff; padding: 0.75rem 1.5rem;
  border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25); opacity: 0;
  transition: opacity 0.3s; pointer-events: none; z-index: 999;
}
#toast.show { opacity: 1; }

/* ── Responsive visibility ───────────────────────── */
.mobile-only  { display: block; }
.desktop-only { display: none; }
@media (min-width: 700px) {
  .mobile-only  { display: none; }
  .desktop-only { display: block; }
  .page { padding: 1.5rem; }
}
