/* Fur Kids Home Sitters - admin dashboard. Builds on styles.css tokens. */

body.admin { background: var(--sand); min-height: 100vh; }
.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.grow { flex: 1; }

/* Top bar */
.admin-bar { background: var(--blue); color: #fff; }
.admin-bar-inner { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.admin-bar .brand img { width: 150px; }
.admin-tag {
  font: 600 .85rem var(--font-head); letter-spacing: .04em; text-transform: uppercase;
  background: var(--orange); color: var(--ink); padding: 3px 10px; border-radius: 999px;
}
.who { font-size: .9rem; color: #D2E0EA; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30vw; }
@media (max-width: 560px) { .who { display: none; } }

.btn-small {
  font: 600 .95rem var(--font-head); border-radius: 999px; padding: 8px 16px; min-height: 40px;
  cursor: pointer; border: 2px solid transparent; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-ghost-dark { background: #fff; color: var(--blue); border-color: var(--line); }
.btn-ghost-dark:hover { border-color: var(--blue); }
.btn-solid { background: var(--blue); color: #fff; }
.btn-solid:hover { background: var(--blue-dark); color: #fff; }
.btn-wa { background: #1F8F4E; color: #fff; }
.btn-wa:hover { background: #18723E; color: #fff; }

/* Panels */
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 20px; margin: 32px auto; }
.panel.narrow { max-width: 440px; }
.panel h1 { font-size: 1.9rem; }
input[type="password"], input[type="search"] {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  padding: 12px 14px; min-height: 48px; border: 2px solid #D5C6B1; border-radius: var(--radius-sm); background: #fff;
}
input[type="password"]:focus, input[type="search"]:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(244,144,46,.35); }
.form-status.ok { background: #E3F1E8; color: var(--ok); }

/* Summary tiles */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 22px 0 18px; }
@media (min-width: 820px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  background: #fff; border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow);
  border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; border-top: 4px solid var(--blue);
}
.tile:hover { outline: 2px solid var(--line); }
.tile.warn { border-top-color: var(--orange); }
.tile.money { border-top-color: var(--ember); }
.tile .num { display: block; font: 600 1.9rem/1.1 var(--font-head); color: var(--blue); }
.tile .lbl { display: block; font-size: .92rem; color: var(--muted); }
.tile .sub { display: block; font-size: .85rem; color: var(--ember); font-weight: 700; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); overflow-x: auto; }
.tab {
  font: 600 1.05rem var(--font-head); color: var(--muted); background: none; border: 0;
  padding: 10px 16px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--orange); }
.tab .count { font-size: .85rem; background: var(--sand-deep); color: var(--ink); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.toolbar input[type="search"] { flex: 1 1 220px; min-height: 42px; padding: 8px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.chip {
  font: 700 .88rem var(--font-body); background: #fff; color: var(--ink); border: 2px solid var(--line);
  border-radius: 999px; padding: 4px 12px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }

/* List */
.list { display: grid; gap: 10px; padding-bottom: 48px; }
.row {
  display: grid; gap: 4px 16px; grid-template-columns: 1fr auto; align-items: center;
  background: #fff; border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: 0 2px 8px rgba(23,73,107,.06);
  border: 2px solid transparent; text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%;
}
.row:hover { border-color: var(--line); }
.row .title { font: 600 1.08rem var(--font-head); color: var(--blue); }
.row .meta { grid-column: 1 / -1; color: var(--muted); font-size: .93rem; }
.row .meta b { color: var(--ink); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.badge { font: 700 .78rem var(--font-body); text-transform: uppercase; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; background: #E6EEF3; color: var(--blue); white-space: nowrap; }
.badge.s-new, .badge.s-applied { background: #FDE6CF; color: var(--ember); }
.badge.s-contacted, .badge.s-interviewing, .badge.s-matched, .badge.s-quoted { background: #E6EEF3; color: var(--blue); }
.badge.s-paid, .badge.s-approved { background: #E3F1E8; color: var(--ok); }
.badge.s-completed { background: #DCE5EB; color: var(--ink); }
.badge.s-cancelled, .badge.s-rejected, .badge.s-spam, .badge.s-paused { background: #EEE; color: #666; }
.badge.owed { background: var(--ember); color: #fff; }

/* Detail dialog */
.detail {
  border: 0; border-radius: var(--radius); padding: 0; width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink);
}
.detail::backdrop { background: rgba(28,43,54,.55); }
.detail-close-row { position: sticky; top: 0; display: flex; justify-content: flex-end; padding: 8px 8px 0; background: #fff; z-index: 1; }
.icon-btn { font-size: 1.8rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--muted); width: 44px; height: 44px; border-radius: 50%; }
.icon-btn:hover { background: var(--sand); }
#detail-body { padding: 0 20px 22px; }
@media (min-width: 640px) { #detail-body { padding: 0 28px 28px; } }
#detail-body h2 { font-size: 1.6rem; margin-bottom: 4px; }
#detail-body h3 { font-size: 1.1rem; margin: 22px 0 8px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: .97rem; }
.facts dt { font-weight: 700; color: var(--muted); }
.facts dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.contact-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.edit-box { background: var(--sand); border-radius: var(--radius-sm); padding: 16px; margin-top: 18px; }
.edit-box .field { margin-bottom: 12px; }
.edit-box .field label { font-size: .95rem; }
.edit-box textarea { min-height: 80px; }
.checks { display: grid; gap: 8px; }
.checks label { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.checks input { width: 20px; height: 20px; accent-color: var(--blue); }
.checks small { color: var(--muted); font-weight: 400; }
.save-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.save-msg { font-size: .93rem; }
.save-msg.ok { color: var(--ok); }
.save-msg.err { color: var(--error); }
.margin-line { font-size: .93rem; color: var(--muted); margin: -4px 0 12px; }
.margin-line b { color: var(--ink); }
.sitter-hint { font-size: .9rem; color: var(--muted); margin-top: 4px; }

/* Photos, pets, sitter head */
.thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; cursor: zoom-in; flex: 0 0 56px; background: var(--sand); }
.thumb-empty { display: grid; place-items: center; font: 600 1.3rem var(--font-head); color: var(--ember); background: #FDE6CF; cursor: default; }
.pet-rows { display: grid; gap: 10px; }
.pet-row { display: flex; gap: 12px; align-items: center; }
.sitter-head { display: flex; gap: 16px; align-items: center; }
.sitter-head h2 { margin-bottom: 2px; }
.sitter-photo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; cursor: zoom-in; flex: 0 0 84px; }
.table-scroll { overflow-x: auto; }
.dist-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.dist-table th { text-align: left; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.dist-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dist-table .flags { display: flex; flex-wrap: wrap; gap: 4px; }
.dist-table tr.current td { background: #EEF4F8; }
.dist-table .btn-small { min-height: 34px; padding: 4px 12px; }
.small { font-size: .9rem; }

/* ---------- Sitter portal ---------- */
.portal-hello { display: flex; gap: 14px; align-items: center; margin: 24px 0 8px; }
.portal-hello h1 { font-size: 1.8rem; margin: 0; }
.portal-hello p { margin: 0; }
.portal-hello .sitter-avatar { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: #FDE6CF; color: var(--ember); font: 600 1.6rem var(--font-head); overflow: hidden; }
.portal-hello .sitter-avatar img { width: 100%; height: 100%; object-fit: cover; }
.portal-h { font-size: 1.3rem; margin: 26px 0 10px; }
.photo-change { margin-top: 6px; }
.sitting { margin: 0; padding: 18px 16px; }
.sitting h3 { margin: 0 0 2px; font-size: 1.2rem; }
.sitting h4 { font-size: 1.02rem; margin: 18px 0 8px; color: var(--blue); }
.sitting-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sitting-head p { margin: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
span.thumb { display: grid; place-items: center; overflow: hidden; }
.checkin-list { display: grid; gap: 10px; }
.checkin { display: flex; gap: 12px; align-items: flex-start; }
.checkin-form h4 { margin-top: 0; }
.checkin-form textarea { min-height: 80px; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 16px; }
.status-grid .btn-small { width: 100%; justify-content: center; text-align: center; min-height: 44px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.field-label { display: block; font-weight: 700; margin-bottom: 6px; }
.photo-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.photo-buttons label { cursor: pointer; min-height: 44px; }
.photo-buttons [hidden] { display: none; }
.photo-buttons input:focus-visible + label { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------- Rates ---------- */
.toolbar [hidden] { display: none; }
.rates { padding-bottom: 48px; display: grid; gap: 4px; }
.rates .edit-box { background: #fff; box-shadow: var(--shadow); }
.rates-h { font-size: 1.3rem; margin: 0 0 10px; }
.rates-table input[type="text"], .rates-table input[type="number"], .rates-table select {
  font: inherit; font-size: 15px; padding: 6px 8px; min-height: 38px; border: 2px solid #D5C6B1; border-radius: 8px; background: #fff; width: 100%;
}
.rates-table input[type="number"] { min-width: 80px; max-width: 110px; }
.rates-table input[type="text"] { min-width: 150px; }
.rates-table input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--blue); }
.rates-table input:disabled { background: var(--sand); }
.margin-line.suggest { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.payrun .facts { margin-bottom: 10px; }
.pay-total { font: 600 1.4rem var(--font-head); color: var(--ember); }
.payrun .table-scroll { margin-bottom: 14px; }
.stars-text { color: var(--orange); letter-spacing: 1px; }
.review-quote { margin: 10px 0 14px; padding: 12px 16px; background: var(--sand); border-left: 4px solid var(--orange); border-radius: 8px; white-space: pre-wrap; }

/* ---------- Statistics ---------- */
.stats .chips { margin: 4px 0 10px; }
.stat-tiles { margin: 0 0 4px; }
@media (min-width: 820px) { .stat-tiles { grid-template-columns: repeat(3, 1fr); } }
.stat-tiles .tile { cursor: default; }
.stat-tiles .tile:hover { outline: none; }
.stat-tiles .muted-sub { color: var(--muted); font-weight: 600; }
.bar-chart { display: flex; align-items: stretch; gap: 2px; height: 220px; padding: 8px 0 0; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.bar-col { position: relative; flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; outline: none; }
.bar-area { flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: min(70%, 36px); background: var(--blue); border-radius: 4px 4px 0 0; }
.bar-col:hover .bar, .bar-col:focus .bar { background: var(--blue-dark); }
.bar-label { font-size: .75rem; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; padding-top: 4px; }
.bar-tip { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
  font-size: .85rem; padding: 6px 10px; border-radius: 8px; white-space: nowrap; z-index: 2; pointer-events: none; }
.bar-col:hover .bar-tip, .bar-col:focus .bar-tip { display: block; }
.num-table td:not(:first-child), .num-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }


/* Payments panel (admin-payments.js) */
.pay-panel h4 { font-size: 1.02rem; margin: 14px 0 6px; }
.pay-link { overflow-wrap: anywhere; font-size: .93rem; background: var(--sand); border-radius: var(--radius-sm); padding: 8px 12px; }
.pay-setup { margin-top: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
.pay-setup summary { cursor: pointer; font: 600 1rem var(--font-head); color: var(--blue); }
.pay-setup input[type="text"] { width: 100%; }

/* WhatsApp messages */
.wa-box { border: 1px solid #DCE9E0; background: #F4FAF6; border-radius: 10px; padding: 12px; margin: 12px 0; }
.wa-box textarea { width: 100%; font: inherit; margin-top: 6px; }
.wa-preview { white-space: pre-wrap; background: #E7F6EC; border-radius: 10px; padding: 10px 12px; font-size: .95rem; }
.placeholders dt code { font-size: .9rem; }
.template-box summary { cursor: pointer; font-weight: 600; }
.template-box textarea { width: 100%; font: inherit; }
.quick-msgs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }

/* Install as an app */
.install-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px; max-width: 560px; margin: 0 auto;
  padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.install-text { margin: 0; flex: 1; }
.install-text .btn-small { margin-left: 6px; }
.install-close { background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.offline-bar { background: var(--ember); color: #fff; text-align: center; padding: 8px 12px; font-weight: 700; }
/* Installed app: room for the phone's status bar and home indicator */
@media (display-mode: standalone) {
  .admin-bar { padding-top: env(safe-area-inset-top); }
  body.admin { padding-bottom: env(safe-area-inset-bottom); }
}

/* Editing records and the history */
.btn-danger { background: #fff; color: var(--error); border: 1.5px solid var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; }
.danger-zone { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line); }
.edit-section { margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff; }
.edit-section > summary { cursor: pointer; font-weight: 700; color: var(--blue); }
.edit-section[open] > summary { margin-bottom: 10px; }
.checks-inline { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks-inline label { display: inline-flex; align-items: center; gap: 6px; }
.pets-edit { display: grid; gap: 8px; }
.pet-edit-row { display: grid; grid-template-columns: 2fr 1.4fr 1fr auto; gap: 6px; align-items: center; }
@media (max-width: 560px) { .pet-edit-row { grid-template-columns: 1fr 1fr; } }
.hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.hist-when { color: var(--muted); font-size: .9rem; }
.hist-badge { text-transform: none; }
.hist-insert .hist-badge, .hist-restore .hist-badge { background: #E3F2E8; color: var(--ok); }
.hist-delete .hist-badge { background: #FBE4E2; color: var(--error); }
.hist-changes { margin: 6px 0 0; padding-left: 18px; font-size: .95rem; }
.hist-old { text-decoration: line-through; color: var(--muted); }

/* Ratings */
.rate-owner { border-top: 1px solid var(--line, #eadfce); margin-top: 14px; padding-top: 10px; }
.rate-form textarea { width: 100%; margin: 4px 0 8px; }
.rate-form .stars-field { margin-bottom: 8px; }
/* Sitter ID documents */
.id-docs { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
.id-docs figure { margin: 0; }
.id-docs img { max-width: 260px; max-height: 180px; border-radius: 8px; border: 1px solid #ddd; cursor: zoom-in; display: block; }
.id-docs figcaption { font-size: .85rem; color: #666; }
.admin-bar .btn-small { white-space: nowrap; }
.update-bar { z-index: 51; }
.admin-bar .brand { flex-shrink: 0; }
@media (max-width: 460px) {
  .sitter-portal .admin-bar .brand img { width: 110px; }
  .sitter-portal .admin-tag { display: none; }
}

/* ---------- Owner portal (/my/) ---------- */
.owner-portal .portal-hello .sitter-avatar { background: var(--orange); color: var(--ink); }
.live-note { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: 0 0 10px; box-shadow: 0 0 0 0 rgba(47,125,79,.5); animation: live-pulse 2s infinite; }
.live-dot.off { background: #A9B4BC; animation: none; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(47,125,79,.45); } 70% { box-shadow: 0 0 0 8px rgba(47,125,79,0); } 100% { box-shadow: 0 0 0 0 rgba(47,125,79,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.owner-booking + .owner-booking { margin-top: 14px; }
.owner-sitter { margin-top: 14px; padding-top: 4px; border-top: 1px solid var(--line); }
.owner-sitter-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.owner-sitter-row p { margin: 4px 0 6px; }
.owner-sitter-name { font: 600 1.15rem var(--font-head); color: var(--ink); }
.sitter-avatar.big { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: #FDE6CF; color: var(--ember); font: 600 1.6rem var(--font-head); }
.sitter-avatar.big img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.owner-sitter .flags { display: flex; flex-wrap: wrap; gap: 6px; }
.owner-checkins { margin-top: 14px; padding-top: 4px; border-top: 1px solid var(--line); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline-day { font: 600 .95rem var(--font-head); color: var(--ember); margin-top: 6px; }
.timeline-item { background: var(--sand); border-radius: var(--radius-sm); padding: 12px 14px; border-left: 4px solid var(--blue); }
.timeline-item.is-new { border-left-color: var(--orange); background: #FFF6EA; }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.timeline-head strong { font: 600 1.15rem var(--font-head); color: var(--blue); }
.checkin-note { margin: 8px 0 0; white-space: pre-wrap; }
.checkin-photo { display: block; margin-top: 10px; color: var(--muted); font-size: .9rem; }
.checkin-photo img { display: block; width: 100%; max-width: 420px; max-height: 420px; object-fit: cover; border-radius: var(--radius-sm); cursor: zoom-in; }
.owner-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.owner-details summary { cursor: pointer; font: 600 1rem var(--font-head); color: var(--blue); min-height: 32px; }
.owner-details .pet-rows { margin: 10px 0; }
.rate-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.portal-foot { margin: 28px 0 40px; text-align: center; }
.badge-link { text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* ---------- Calendar tab: bookings by date and sitter availability ---------- */
.cal { --c-new: #F4902E; --c-arr-bg: #D6E4EE; --c-paid: #17496B; --c-done-bg: #E4E9ED; --c-cancel-bg: #EFEFEF;
  --a-free: #2F7D4F; --a-booked: #17496B; --a-off: #B4560E; }
.cal-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-nav .btn-small { min-width: 44px; min-height: 44px; font-size: 1.05rem; }
.cal-title { flex: 1 1 auto; margin: 0; font-size: 1.35rem; text-align: center; min-width: 9em; }
.cal-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; margin-bottom: 10px; }
@media (min-width: 820px) { .cal-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .cal-filters { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.cal-filter { display: grid; gap: 2px; font-size: .85rem; font-weight: 700; color: var(--muted); min-width: 0; }
.cal-filter select, .cal-filter input { width: 100%; min-width: 0; min-height: 44px; padding: 6px 8px; font-size: 16px; /* 16px stops iPhone zooming in */
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.cal-show { align-items: center; margin-bottom: 6px; }
.cal-show .chip { min-height: 40px; }
.cal-legend { display: grid; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .88rem; }
.cal-legend-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.cal-legend-h { font-weight: 700; color: var(--ink); min-width: 5.5em; }
.cal-key { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.cal-swatch { display: inline-block; width: 22px; height: 12px; border-radius: 4px; flex: 0 0 22px; }
.cal-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; vertical-align: middle; }
.cal-swatch.c-new, .cal-bar.c-new { background: var(--c-new); color: var(--ink); }
.cal-swatch.c-arr, .cal-bar.c-arr { background: var(--c-arr-bg); color: var(--blue); box-shadow: inset 3px 0 0 var(--blue), inset 0 0 0 1px var(--blue); }
.cal-swatch.c-paid, .cal-bar.c-paid { background: var(--c-paid); color: #fff; }
.cal-swatch.c-done, .cal-bar.c-done { background: var(--c-done-bg); color: var(--ink); box-shadow: inset 3px 0 0 #8696A1; }
.cal-swatch.c-cancel, .cal-bar.c-cancel { background: repeating-linear-gradient(135deg, var(--c-cancel-bg) 0 4px, #fff 4px 8px); color: #666; box-shadow: inset 0 0 0 1px #CCC; }
.cal-bar.c-cancel .cal-bar-text { text-decoration: line-through; }
.cal-dot.a-free { background: var(--a-free); }
.cal-dot.a-booked { background: var(--a-booked); }
.cal-dot.a-off { background: var(--a-off); }
.cal-dot.a-clash { background: var(--a-off); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--a-booked); }
.cal-summary { margin: 4px 2px 10px; }
.cal-grid-wrap { background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-wd { text-align: center; font-size: .78rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-cell { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 64px; min-width: 0; padding: 4px 3px;
  background: var(--sand); border: 2px solid transparent; border-radius: 8px; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.cal-cell:hover { border-color: var(--line); }
.cal-cell:focus-visible { outline: 3px solid var(--orange); outline-offset: 1px; }
.cal-cell.out { background: transparent; cursor: default; opacity: .45; }
.cal-cell.today .cal-num { background: var(--orange); color: var(--ink); }
.cal-cell.selected { border-color: var(--blue); background: #fff; }
.cal-cell.a-free { background: #E3F1E8; }
.cal-cell.a-booked { background: #D6E4EE; }
.cal-cell.a-off, .cal-cell.a-clash { background: repeating-linear-gradient(135deg, #F8DCC4 0 6px, #FBEBDD 6px 12px); }
.cal-num { align-self: flex-start; font: 600 .9rem/1 var(--font-head); padding: 3px 5px; border-radius: 999px; }
.cal-bars { display: grid; gap: 2px; }
.cal-bar { display: block; height: 7px; border-radius: 3px; overflow: hidden; }
.cal-bar-text { display: none; }
.cal-more { font-size: .72rem; font-weight: 700; color: var(--muted); line-height: 1; }
.cal-avail { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: auto; font-size: .72rem; font-weight: 700; color: var(--muted); }
.cal-count { display: inline-flex; align-items: center; gap: 3px; }
.cal-count .cal-dot { width: 8px; height: 8px; flex-basis: 8px; }
.cal-avail-text { display: none; }
@media (min-width: 700px) {
  .cal-grid { gap: 4px; }
  .cal-cell { min-height: 104px; padding: 6px; }
  .cal-bar { height: auto; padding: 2px 6px; font-size: .78rem; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
  .cal-bar-text { display: inline; }
  .cal-avail { font-size: .8rem; }
  .cal-avail-text { display: inline; }
  .cal-avail.one { gap: 4px; align-items: center; }
}
.cal-hint { text-align: center; margin: 12px 0; }
.cal-day { margin-top: 14px; scroll-margin-top: 12px; }
.cal-day-h { margin: 0 0 8px; font-size: 1.2rem; }
.cal-day h4 { font-size: 1rem; margin: 14px 0 6px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.cal-booking { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; cursor: pointer; min-height: 44px; }
.cal-booking:hover { border-color: var(--blue); }
.cal-booking .cal-swatch { width: 10px; height: auto; align-self: stretch; flex: 0 0 10px; }
.cal-booking-main { min-width: 0; }
.cal-booking-sub { display: block; font-size: .88rem; color: var(--muted); margin-top: 2px; }
.cal-names { margin: 0; line-height: 1.7; }
.cal-off > span:first-child, .daysoff-item > span:first-child { flex: 1 1 14em; min-width: 0; }
.cal-off { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; background: #fff;
  border: 1px solid var(--line); border-left: 4px solid var(--ember); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; }
.cal-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.cal-two .field, .cal-two input { min-width: 0; width: 100%; max-width: 100%; }
.cal-add input, .cal-add select { font-size: 16px; }
.cal-list { display: grid; gap: 0; }
.cal-day.compact { margin-top: 8px; padding: 12px 14px; }
.cal-day.compact .cal-day-h { font-size: 1.05rem; }

/* ---------- Sitter portal: days off ---------- */
.daysoff-list { display: grid; gap: 8px; margin: 0 0 14px; }
.daysoff-item { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; background: #fff;
  border: 1px solid var(--line); border-left: 4px solid var(--ember); border-radius: 10px; padding: 10px 12px; }
.daysoff-form .cal-two input { font-size: 16px; }

/* Town filter next to the list chips (bookings and sitters) */
.chips .town-filter { min-height: 36px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line, #E8D9C4); font: inherit; font-size: 16px; max-width: 220px; background: #fff; }
.field-row-3 { display: grid; gap: 0 12px; }
@media (min-width: 720px) { .field-row-3 { grid-template-columns: 1fr 1fr 1fr; } }
