/* 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; }
.comment.reply { background: #fff; margin: .6rem 0 0 1.25rem; border-left: 3px solid #d1d5db; border-radius: 0 .6rem .6rem 0; }
.reply-form { margin-top: .6rem; }
/* Like and Reply sit side by side; the names of who liked it follow. */
.comment-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .35rem 0 0; }
.comment-actions .like-bar { display: contents; }
.comment-actions .like-bar > span { order: 2; }
.comment-actions .reply-btn { order: 1; }

/* ---- icons (Heroicons solid, colored by the surrounding text color) ---- */
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

/* ---- top bar: brand, tabs, then the account menu at the far right ---- */
.topbar nav { justify-content: flex-start; align-items: center; }
.topbar .tabs { margin-left: auto; }
.profile-menu { position: relative; margin: 0; }
.profile-menu summary {
  list-style: none; cursor: pointer; position: relative; display: block;
  padding: .15rem; border-radius: 50%;
}
.profile-menu summary::-webkit-details-marker, .profile-menu summary::after { display: none; }
.profile-menu summary:hover .avatar, .profile-menu[open] .avatar { box-shadow: 0 0 0 3px #e5e7eb; }
.avatar {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 1rem; letter-spacing: .02em; user-select: none;
}
.unread-dot {
  position: absolute; top: .1rem; right: .1rem; width: .85rem; height: .85rem;
  border-radius: 50%; background: var(--care-danger); border: 2px solid #fff;
}
.profile-panel {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20; width: 240px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: .9rem; padding: .5rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}
.profile-name { margin: .3rem .6rem .5rem; line-height: 1.3; }
.profile-panel form { margin: 0; }
.profile-item {
  display: flex; align-items: center; gap: .55rem; width: 100%; margin: 0; padding: .7rem .6rem;
  border: none; border-radius: .6rem; background: none; color: #374151; text-align: left;
  font-size: 1rem; font-weight: 600; text-decoration: none; box-shadow: none;
}
.profile-item:hover, .profile-item:focus-visible { background: #f3f4f6; color: #111827; }
.count-pill {
  margin-left: auto; min-width: 1.5rem; padding: 0 .45rem; border-radius: 999px;
  background: var(--care-danger); color: #fff; font-size: .8rem; line-height: 1.5rem; text-align: center;
}

/* ---- notifications page ---- */
.notif-page { padding: .6rem; }
.notif-list { display: grid; gap: .25rem; }
.notif {
  display: flex; gap: .5rem; align-items: flex-start; padding: .65rem .6rem; border-radius: .6rem;
  color: inherit; text-decoration: none; line-height: 1.35; font-size: .95rem;
}
.notif .dot { margin-top: .3rem; flex: none; }
.notif:hover { background: #f3f4f6; }
.notif.unread { background: #eff6ff; }
.notif-empty { margin: .5rem 0 0; font-size: .95rem; }

/* ---- likes ---- */
.like-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .35rem 0 .5rem; }
.like-btn, .reply-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  width: auto; margin: 0; min-height: 2.5rem; padding: .35rem .9rem; border-radius: 999px;
  background: #fff; border: 1px solid #d1d5db; color: #374151; font-size: .9rem; font-weight: 600;
}
.like-btn:hover, .reply-btn:hover { background: #eef2f7; color: #374151; }
.like-btn .icon { color: #9ca3af; }
.like-btn.liked { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.like-btn.liked .icon { color: #2563eb; }

/* ---- photos ---- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; margin: .75rem 0; }
.photo-grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .6rem;
  background: #e5e7eb; display: block;
}
.photo-grid p { grid-column: 1 / -1; margin: 0; }
.field-label { display: block; margin-bottom: .4rem; }
.photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-pick { display: inline-block; width: auto; margin: 0 0 .25rem; }
.photo-remove { display: grid; gap: .3rem; font-size: .9rem; cursor: pointer; }
.photo-remove input { margin: 0 .3rem 0 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;
}
.password-field {
  position: relative;
}
.login-form .password-field input {
  margin-bottom: 0;
  padding-right: 5.5rem;
}
.password-toggle {
  position: absolute; top: 50%; right: .35rem; transform: translateY(-50%);
  width: auto; min-width: 4.5rem; min-height: 2.75rem; margin: 0; padding: .4rem .8rem;
  background: none; border: none; border-radius: .7rem; box-shadow: none;
  color: var(--pico-primary); font-weight: 700; font-size: .95rem;
}
.password-toggle:hover, .password-toggle:focus-visible { background: rgba(37, 99, 235, 0.08); color: var(--pico-primary); }
.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);
}
/* "Also add this shift on…" mini calendar */
.date-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem;
  margin: .25rem 0 .4rem; max-width: 30rem;
}
.date-grid > span:not(.date-chip) { text-align: center; font-size: .8rem; font-weight: 700; color: #6b7280; }
.date-chip {
  position: relative; display: grid; place-items: center; min-height: 2.75rem; margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.85); border-radius: .7rem; background: #f8fafc;
  color: #334155; font-weight: 600; font-size: .9rem; cursor: pointer; text-align: center; line-height: 1.1;
}
.date-chip input { position: absolute; opacity: 0; pointer-events: none; }
.date-chip:has(input:checked) { background: #2563eb; border-color: #2563eb; color: #fff; }
.date-chip.past { border-style: dashed; background: none; color: #cbd5e1; cursor: default; }
.copy-count { display: block; min-height: 1.2em; margin-bottom: 1rem; }
.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; }
.calendar-item h2 { display: flex; align-items: center; margin-bottom: 1rem; }
.calendar-item .dot { width: 1rem; height: 1rem; }
.item-when { font-size: 1.1rem; line-height: 1.5; }
.item-note { padding: .7rem .9rem; border-radius: .6rem; background: #f3f4f6; }
.calendar-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.calendar-actions [role="button"] { margin: 0; }

/* ---- 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; }
  /* Phones: site name and account menu on the first row, tabs below. */
  .topbar nav { flex-wrap: wrap; }
  .topbar .brand-row { order: 0; flex: 1; }
  .topbar .profile-row { order: 1; }
  .topbar .tabs { order: 2; width: 100%; margin-left: 0; }
}
