/* SLC Ministry Schedule — schedule.css */

/* ── Reset & base ────────────────────────────────────────────────────────── */
#slc-ms-wrap *,
#slc-ms-wrap *::before,
#slc-ms-wrap *::after { box-sizing: border-box; }

#slc-ms-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: #1e293b;
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 0 40px;
}

/* ── Login panel ─────────────────────────────────────────────────────────── */
#slc-ms-login-panel {
  max-width: 440px;
  margin: 48px auto;
}

.slc-ms-login-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06);
  padding: 40px 40px 36px;
  text-align: center;
}

.slc-ms-login-logo {
  width: 64px; height: 64px;
  background: #1e3a5f;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
  color: #fff;
}

.slc-ms-login-card .slc-ms-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px;
}
.slc-ms-login-card .slc-ms-subtitle {
  color: #64748b;
  font-size: .92rem;
  margin: 0 0 28px;
  line-height: 1.5;
}

#slc-ms-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

/* ── Field ───────────────────────────────────────────────────────────────── */
.slc-ms-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.slc-ms-field label {
  font-size: .82rem;
  font-weight: 600;
  color: #475569;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.slc-ms-field input[type="text"],
.slc-ms-field input[type="password"],
.slc-ms-field input[type="date"],
.slc-ms-field select {
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .95rem;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  width: 100%;
}
.slc-ms-field input:focus,
.slc-ms-field select:focus {
  border-color: #1e3a5f;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30,58,95,.12);
}

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.slc-ms-alert {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: .88rem;
  line-height: 1.4;
  margin-bottom: 14px;
}
.slc-ms-alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.slc-ms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, opacity .15s, transform .1s;
  letter-spacing: .01em;
}
.slc-ms-btn:active { transform: translateY(1px); }
.slc-ms-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.slc-ms-btn-primary {
  background: #1e3a5f;
  color: #fff;
  box-shadow: 0 2px 6px rgba(30,58,95,.25);
}
.slc-ms-btn-primary:hover:not(:disabled) {
  background: #162d4a;
  box-shadow: 0 4px 12px rgba(30,58,95,.3);
}

.slc-ms-btn-secondary {
  background: #fff;
  color: #374151;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.slc-ms-btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.slc-ms-btn-link {
  background: none;
  color: #1e3a5f;
  padding: 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  box-shadow: none;
}
.slc-ms-btn-link:hover { color: #162d4a; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.slc-ms-spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: slc-spin .65s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.slc-ms-btn-secondary .slc-ms-spinner {
  border-color: rgba(30,58,95,.25);
  border-top-color: #1e3a5f;
}
@keyframes slc-spin { to { transform: rotate(360deg); } }

/* ── Schedule panel top bar ──────────────────────────────────────────────── */
.slc-ms-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
}
.slc-ms-topbar .slc-ms-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -.02em;
}
.slc-ms-user-info {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .88rem;
  color: #475569;
}
.slc-ms-user-info strong { color: #0f172a; }

/* ── Controls card ───────────────────────────────────────────────────────── */
.slc-ms-controls {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.slc-ms-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}
.slc-ms-controls-row .slc-ms-field { flex: 1; min-width: 130px; }

.slc-ms-controls-btn-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.slc-ms-field-btn {
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 0 0 auto !important;
}

/* ── Results ─────────────────────────────────────────────────────────────── */
.slc-ms-empty {
  text-align: center;
  padding: 56px 20px;
  color: #94a3b8;
  font-size: 1rem;
  background: #fff;
  border: 1.5px dashed #e2e8f0;
  border-radius: 8px;
}
.slc-ms-empty::before {
  content: '📅';
  display: block;
  font-size: 2rem;
  margin-bottom: 12px;
}

/* ── Report header ───────────────────────────────────────────────────────── */
.slc-ms-report-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 2px;
}
.slc-ms-report-period {
  font-size: .82rem;
  color: #64748b;
  margin-bottom: 18px;
}

/* ── Report date band ────────────────────────────────────────────────────── */
.slc-ms-rpt-date-header {
  background: #d97706;
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .07em;
  padding: 7px 14px;
  margin-top: 20px;
}
.slc-ms-rpt-date-header:first-of-type { margin-top: 0; }

/* ── Report group header (event / member / role / ministry) ──────────────── */
.slc-ms-rpt-group-header {
  background: #d97706;
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  padding: 8px 14px;
  margin-top: 20px;
}

/* ── Ministry sub-header (inside date grouping) ──────────────────────────── */
.slc-ms-rpt-min-header {
  background: #1e3a5f;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 6px 14px;
  margin-top: 10px;
}
.slc-ms-rpt-table--inner {
  border-top: none;
  margin-top: 0;
}

/* ── Report table ────────────────────────────────────────────────────────── */
.slc-ms-rpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
  margin-bottom: 0;
  border: 1px solid #d1d5db;
  border-top: none;
}
.slc-ms-rpt-table thead tr {
  background: #1e3a5f;
}
.slc-ms-rpt-table th {
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 8px 12px;
  text-align: left;
  border-right: 1px solid rgba(255,255,255,.15);
}
.slc-ms-rpt-table th:last-child { border-right: none; }
.slc-ms-rpt-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  color: #111827;
  vertical-align: middle;
  line-height: 1.4;
}
.slc-ms-rpt-table td:last-child { border-right: none; }
.slc-ms-rpt-table tbody tr:last-child td { border-bottom: none; }
.slc-ms-rpt-table tbody tr:hover { background: #fffbeb; }
.slc-ms-rpt-alt { background: #f9fafb; }
.slc-ms-rpt-alt:hover { background: #fffbeb !important; }

/* Name column */
.slc-ms-rpt-name {
  font-weight: 700;
  color: #1e3a5f;
}

/* Time column */
.slc-ms-rpt-time {
  white-space: nowrap;
  color: #374151;
}

/* Sub-text inside a table cell (e.g. weekday under date) */
.slc-ms-sub {
  display: block;
  font-size: .70rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 1px;
}

/* Scripture reference */
.slc-ms-scripture { color: #374151; }
.slc-ms-dash { color: #d1d5db; }

/* Role badge (used in role grouping header rows) */
.slc-ms-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid #bfdbfe;
}

/* ── Warning button ──────────────────────────────────────────────────────── */
.slc-ms-btn-warning {
  background: #b45309;
  color: #fff;
  box-shadow: 0 2px 6px rgba(180,83,9,.25);
}
.slc-ms-btn-warning:hover:not(:disabled) {
  background: #92400e;
  box-shadow: 0 4px 12px rgba(180,83,9,.35);
}
.slc-ms-btn-warning .slc-ms-spinner {
  border-color: rgba(255,255,255,.35);
  border-top-color: #fff;
}

/* ── Conflict panel ──────────────────────────────────────────────────────── */
#slc-ms-conflict-panel {
  margin-bottom: 28px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid #fcd34d;
  box-shadow: 0 2px 8px rgba(180,83,9,.10);
}

.slc-ms-conflict-ok {
  padding: 20px 24px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 600;
  font-size: .93rem;
  border: 1.5px solid #bbf7d0;
  border-radius: 12px;
}
.slc-ms-conflict-ok::before {
  content: '✓  ';
  font-weight: 800;
}

.slc-ms-conflict-header {
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
  font-size: .92rem;
  padding: 12px 20px;
  border-bottom: 1px solid #fcd34d;
  display: flex;
  align-items: center;
  gap: 8px;
}
.slc-ms-conflict-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.slc-ms-conflict-member {
  background: #fff;
  border-bottom: 1px solid #fde68a;
}
.slc-ms-conflict-member:last-child { border-bottom: none; }

.slc-ms-conflict-name {
  font-weight: 700;
  font-size: .9rem;
  color: #0f172a;
  padding: 10px 20px 6px;
}

.slc-ms-conflict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}
.slc-ms-conflict-table th {
  color: #64748b;
  font-size: .70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 6px 16px;
  text-align: left;
  background: #fefce8;
  border-bottom: 1px solid #fde68a;
}
.slc-ms-conflict-table td {
  padding: 9px 16px;
  border-bottom: 1px solid #fef9c3;
  color: #1e293b;
  vertical-align: middle;
}
.slc-ms-conflict-table tbody tr:last-child td { border-bottom: none; }

/* Conflict / override badges */
.slc-ms-conflict-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  background: #fef2f2;
  color: #991b1b;
  font-size: .74rem;
  font-weight: 700;
  border: 1px solid #fecaca;
  white-space: nowrap;
}
.slc-ms-override-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  background: #f0fdf4;
  color: #166534;
  font-size: .74rem;
  font-weight: 700;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .slc-ms-login-card { padding: 28px 20px 24px; }
  .slc-ms-controls { padding: 16px; }
  .slc-ms-controls-row .slc-ms-field { min-width: calc(50% - 7px); }
  .slc-ms-controls-btn-row { justify-content: stretch; }
  .slc-ms-field-btn { width: 100%; }
  .slc-ms-field-btn .slc-ms-btn { flex: 1; }
  /* On small screens hide scripture columns */
  .slc-ms-rpt-table th:nth-child(n+5),
  .slc-ms-rpt-table td:nth-child(n+5) { display: none; }
}

@media (max-width: 480px) {
  #slc-ms-wrap { padding: 0 0 32px; }
  .slc-ms-topbar .slc-ms-title { font-size: 1.3rem; }
}
