/* Sized for iPads and laptops first; still works on phones. */
:root {
  --pico-font-size: 106%;
  --care-danger: #b91c1c;
}

body { background: #f6f7f9; }
main.container { max-width: 900px; padding-bottom: 2rem; }

/* ---- top bar / tabs ---- */
.topbar { background: #fff; border-bottom: 1px solid #e5e7eb; margin-bottom: 1.5rem; }
.topbar nav { flex-wrap: wrap; max-width: 900px; }
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: inherit; }
.tabs { flex-wrap: wrap; }
.tabs li { padding: .35rem .2rem; }
.tab {
  display: inline-block; padding: .65rem 1.1rem; border-radius: .6rem;
  font-weight: 600; text-decoration: none; color: #374151; margin: 0 !important;
}
.tab:hover { background: #eef2f7; }
.tab.active { background: #1f2937; color: #fff; }
.tab-primary { background: var(--pico-primary-background); color: #fff; }
.tab-primary:hover { background: var(--pico-primary-hover-background); }

/* ---- general ---- */
.muted { color: #6b7280; }
.small { font-size: .875rem; }
.error { color: var(--care-danger); display: block; }
.dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .45rem; vertical-align: middle; }
.inline { display: inline; margin: 0; }
.link-btn {
  background: none; border: none; padding: 0; margin: 0; width: auto;
  color: var(--pico-primary); cursor: pointer; font-size: inherit; text-decoration: underline;
}
.flash { padding: .8rem 1rem; border-radius: .6rem; margin-bottom: 1rem; background: #ecfdf5; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; border-color: #fecaca; }
button.danger { --pico-color: var(--care-danger); --pico-border-color: var(--care-danger); color: var(--care-danger); border-color: var(--care-danger); }

/* ---- home ---- */
.upcoming article { margin-bottom: 0; }
.shift-line { margin-bottom: .6rem; }
.feed-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1.75rem 0 1rem; }
.feed-head h2 { margin: 0; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.report-body { margin-top: .5rem; white-space: normal; }
.report-body p { margin-bottom: .6rem; }
.comments { border-top: 1px solid #e5e7eb; padding-top: .9rem; }
.comment { background: #f3f4f6; border-radius: .6rem; padding: .6rem .8rem; margin-bottom: .6rem; }
.comment-head { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .2rem; }
.comment-form { margin: .4rem 0 0; }
.comment-form fieldset { margin-bottom: 0; }
.pager { display: flex; justify-content: space-between; }
.empty { text-align: center; }

/* ---- forms ---- */
.form-card {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 2rem 1.5rem;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 1.25rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(10px);
}
.form-card h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.form-card textarea { min-height: 12rem; }
.form-card input[type="date"],
.form-card select,
.form-card textarea {
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(148,163,184,0.7);
  border-radius: 0.9rem;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.actions > * { margin-bottom: 0; }
.delete-form { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #e5e7eb; }
.wide { width: 100%; }

/* ---- login ---- */
.login-shell {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.login-card {
  width: min(100%, 420px);
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.92));
  border: 1px solid rgba(148,163,184,0.35);
  border-radius: 1.5rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10), 0 6px 18px rgba(15, 23, 42, 0.05);
  padding: 1.75rem 1.5rem 1.5rem;
}
.login-brand {
  margin-bottom: 1rem;
}
.login-brand-text {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.eyebrow {
  margin: 0 0 .2rem;
  color: #7c6f5b;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .67rem;
  font-weight: 700;
}
.login-card h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.login-subtitle {
  margin: 0 0 1.25rem;
  color: #4b5563;
  font-size: 1rem;
}
.login-error {
  margin-bottom: 1rem;
  padding: .7rem .9rem;
  border-radius: .75rem;
  background: rgba(254,242,242,0.8);
  border: 1px solid rgba(239,68,68,0.18);
}
.login-form {
  display: grid;
  gap: .75rem;
}
.login-form label {
  font-weight: 700;
}
.login-form input {
  border-radius: .9rem;
  border: 1px solid rgba(148,163,184,0.8);
  background: rgba(255,255,255,0.74);
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.04);
  padding: .9rem .95rem;
}
.primary-btn {
  margin-top: .5rem;
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  border: none;
  box-shadow: 0 10px 18px rgba(79, 70, 229, 0.22);
  color: white;
  font-weight: 700;
  border-radius: .95rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(79, 70, 229, 0.25);
}
.login-help {
  margin-top: 1rem;
  text-align: center;
}

/* ---- people ---- */
tr.inactive td { color: #9ca3af; }
.row-actions {
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  flex-wrap: wrap;
}
.row-actions > * { margin: 0; }

/* ---- chips for radio choices ---- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: .25rem 0 1rem;
}
.chip-group > div {
  display: inline-flex;
  margin: 0;
}
.chip-group label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: .5rem .9rem;
  border: 1px solid rgba(148, 163, 184, 0.85);
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}
.chip-group input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.chip-group label:has(input:checked) {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.25);
}
.time-chips,
.caregiver-chips {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: .15rem 0 .6rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.time-chips::-webkit-scrollbar,
.caregiver-chips::-webkit-scrollbar { display: none; }
.time-chips > div,
.caregiver-chips > div { flex: 0 0 auto; }
.caregiver-chips label:has(input[data-color])::before {
  content: "";
  width: .65rem;
  height: .65rem;
  flex: 0 0 .65rem;
  border-radius: 50%;
  background: var(--chip-color);
}
.caregiver-chips label:has(input[data-color]:checked) {
  background: color-mix(in srgb, var(--chip-color) 16%, white);
  border-color: var(--chip-color);
}
.custom-time-fields[hidden] { display: none; }
.other-staff-fields[hidden] { display: none; }
.custom-time-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
  padding: .9rem;
  margin: 0 0 1rem;
  border: 1px solid #d1d5db;
  border-radius: .5rem;
  background: #fff;
}
.custom-time-fields label,
.custom-time-fields input { margin-bottom: .5rem; }

@media (min-width: 701px) {
  .caregiver-chips {
    flex-wrap: wrap;
    overflow: visible;
  }
}

/* ---- calendar (undo Pico's table/button styling inside FullCalendar) ---- */
.calendar-page { max-width: 1180px; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-bottom: .25rem; }
#calendar { background: #fff; border-radius: .75rem; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
#calendar table { margin-bottom: 0; }
#calendar th, #calendar td { padding: 0; background: transparent; border-bottom-width: 1px; }
#calendar .fc-button { padding: .45rem .8rem; font-size: .95rem; width: auto; margin-bottom: 0; }
#calendar .fc-toolbar-title { font-size: 1.3rem; }
#calendar a { text-decoration: none; }
#calendar .fc-daygrid-day { cursor: pointer; }
#calendar .fc-daygrid-event { white-space: normal; }
#calendar .fc-daygrid-event .fc-event-main { min-width: 0; white-space: normal; }
#calendar .fc-list-event td { padding: .5rem .75rem; }
#calendar .calendar-event-text { font-weight: 700; }
.calendar-event-month { display: grid; gap: .08rem; min-width: 0; line-height: 1.15; }
.calendar-event-time { font-size: .75rem; line-height: 1.15; white-space: nowrap; }
.calendar-event-name { overflow-wrap: anywhere; white-space: normal; }
.calendar-toolbar {
  display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem;
}
.calendar-filter { max-width: 220px; }

/* ---- footer ---- */
.footer { display: flex; gap: 1.25rem; align-items: center; justify-content: center; flex-wrap: wrap; padding: 1.5rem 0 2.5rem; max-width: 900px; }

@media (max-width: 700px) {
  .tab { padding: .5rem .7rem; font-size: .95rem; }
  .topbar nav > ul:first-child { width: 100%; }
}
