/* Partner + interpreter pages: availability editor, profile editor,
   reservation cards, certificates. Foundation vars only (css/theme.css);
   the two weekend tints mirror the app's availability_page.dart. */
:root {
  --weekend-sat: #7E93CF;
  --weekend-sun: #CF6E79;
}

/* ---------- Pending-approval banner ---------- */
.pending-banner {
  background: var(--brand-soft);
  border: 1px solid var(--brand);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.pending-banner .pb-title {
  color: var(--brand); font-size: 13px; font-weight: 800; margin-bottom: 4px;
}
.pending-banner .pb-body { color: var(--text-body); font-size: 13px; }

/* ---------- Reservation cards ---------- */
.res-section-title { margin: 20px 0 10px; }
.res-section-title:first-child { margin-top: 0; }
.res-meta { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.res-interp { color: var(--text-body); font-size: 13px; margin-top: 6px; }
.res-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.card.res-past { opacity: .65; }

/* ---------- Availability: pinned header (title + month + week strip) ----------
   Sticks to the top of the .app-scroll viewport. The scroller's own top
   padding is zeroed for this page (rule below) and the header carries it
   instead — no negative margins anywhere, so nothing can collapse the hour
   list up under the header: at scroll top the first row always sits fully
   below it, and when scrolled the opaque header covers rows edge-to-edge. */
.avail-top {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  padding-top: 16px; padding-bottom: 4px;
}
.app-scroll:has(.avail-top) { padding-top: 0; }
@media (min-width: 768px) {
  .avail-top { padding-top: 24px; }
}
.avail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.save-ind {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-secondary); min-height: 16px;
}

/* ---------- Availability: week strip ---------- */
.week-wrap { display: flex; align-items: center; gap: 2px; }
.week-nav {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border-alt); background: var(--surface-alt);
  color: var(--text-secondary); font-size: 16px; line-height: 1;
  cursor: pointer; display: none; align-items: center; justify-content: center;
}
.week-nav:disabled { opacity: .35; cursor: default; }
@media (min-width: 768px) { .week-nav { display: inline-flex; } }
.week-strip {
  flex: 1; display: flex; overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.week-strip::-webkit-scrollbar { display: none; }
.week-page {
  flex: 0 0 100%; min-width: 100%;
  scroll-snap-align: start;
  display: grid; grid-template-columns: repeat(7, 1fr);
}
.day-cell {
  border: 0; background: transparent; cursor: pointer; padding: 6px 0 2px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.day-cell:disabled { cursor: default; }
.day-init { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.day-cell.sat .day-init { color: var(--weekend-sat); }
.day-cell.sun .day-init { color: var(--weekend-sun); }
.day-num {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: var(--text-body);
  border: 1.2px solid transparent;
}
.day-cell.sat .day-num { color: var(--weekend-sat); }
.day-cell.sun .day-num { color: var(--weekend-sun); }
.day-num.today { border-color: var(--brand); font-weight: 800; }
.day-num.sel { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 800; }
.day-cell:disabled .day-init, .day-cell:disabled .day-num { color: var(--text-muted); opacity: .45; }

/* ---------- Availability: hour rows ---------- */
.hour-list { min-height: 200px; }
.hour-row {
  display: flex; align-items: center; gap: 10px;
  height: 52px; border-bottom: 1px solid var(--border);
}
.hour-time { width: 88px; flex: none; font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.hour-time.on { color: var(--text); }
.hour-cap { flex: 1; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.hour-cap.on { color: var(--brand); }
.hour-center { display: flex; align-items: center; justify-content: center; padding: 48px 0; }

/* ---------- Availability: booking-window setting ----------
   Collapsed control: one tappable row (label + current choice + chevron,
   .menu-row idiom) that opens a modal holding the radio list. */
.window-row {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 2px 0; color: var(--text); font-size: 14px; font-weight: 600;
}
.window-row:disabled { opacity: .55; cursor: default; }
.window-row .window-value {
  margin-left: auto; min-width: 0; text-align: right;
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
}
.window-row .chev { flex: none; color: var(--text-muted); font-size: 16px; }

/* Radio list (shown inside the picker modal): one option per row,
   mode-card/chip idiom: radio circle + label, selected row highlighted with
   the brand soft fill. Native inputs stay in the DOM (hidden) for
   keyboard/reader semantics; .selected is toggled by JS. */
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-row {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-alt); color: var(--text-body);
  border: 1px solid var(--border-alt); border-radius: var(--radius-input);
  padding: 12px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; user-select: none;
  transition: border-color .12s, background .12s, color .12s;
}
.radio-row input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; left: 0; top: 0; cursor: pointer; }
.radio-row .radio-dot {
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2px solid var(--border-alt);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .12s;
}
.radio-row .radio-dot::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: transparent; transition: background .12s;
}
.radio-row .radio-text { flex: 1; min-width: 0; }
.radio-row.selected { border-color: var(--brand); background: var(--brand-soft); color: var(--text); }
.radio-row.selected .radio-dot { border-color: var(--brand); }
.radio-row.selected .radio-dot::after { background: var(--brand); }
.radio-list.disabled .radio-row { opacity: .55; pointer-events: none; }

/* ---------- Availability: bottom actions (viewport-fixed bar) ----------
   Mirrors .cta-fixed in css/user.css: pinned above the mobile tab bar +
   safe area; the page container carries .page-cta-fixed so the last hour
   row scrolls clear of the bar. */
.avail-actions {
  position: fixed; left: 0; right: 0; z-index: 30;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
}
.avail-actions-inner {
  display: flex; gap: 10px;
  max-width: var(--content-max); margin: 0 auto;
}
.avail-actions-inner .btn { flex: 1; min-width: 0; }
@media (min-width: 768px) {
  /* no tab bar on desktop — the bar itself absorbs the safe area */
  .avail-actions { bottom: 0; padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px)); }
}
.btn-add-schedule { background: transparent; border-color: var(--brand); color: var(--brand); }
.btn-stop-day { background: transparent; border-color: var(--border-alt); color: var(--brand); }

/* ---------- Range (add schedule) modal ---------- */
.range-form { display: flex; gap: 12px; margin-top: 6px; }
.range-form .col { flex: 1; }
.range-form label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }

/* ---------- Profile editor: images ---------- */
.hero-box {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-input);
  overflow: hidden; background: var(--surface-alt); cursor: pointer;
  border: 1px solid var(--border-alt);
}
.hero-box img { width: 100%; height: 100%; object-fit: cover; }
.hero-box .img-tag {
  position: absolute; left: 8px; top: 8px;
  background: rgba(0,0,0,.55); color: #fff;
  border-radius: 6px; padding: 3px 8px; font-size: 10px; font-weight: 600;
}
.photo-box {
  position: relative; width: 72px; height: 72px; flex: none;
  border-radius: 16px; overflow: hidden; cursor: pointer;
  background: var(--surface-alt); border: 1.5px solid var(--brand);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.img-placeholder { color: var(--text-muted); font-size: 24px; }
.cam-badge {
  position: absolute; right: 6px; bottom: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); border: 2px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.cam-badge svg { width: 13px; height: 13px; color: #fff; }
.img-uploading {
  position: absolute; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Profile editor: misc ----------- */
.char-counter { font-size: 11px; color: var(--text-muted); }
.char-counter.limit { color: var(--danger); }
.field .label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.field .label-row label { display: inline; margin-bottom: 0; }
.years-row { display: flex; align-items: center; gap: 14px; }
.years-row input[type="range"] { flex: 1; accent-color: var(--brand); }
.years-value { color: var(--brand); font-size: 16px; font-weight: 800; white-space: nowrap; }

/* ---------- Dirty-state save bar (sticky) ---------- */
.save-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: none; gap: 10px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 10px 0 6px;
}
.save-bar.show { display: flex; }
@media (max-width: 767.98px) {
  /* the mobile tab bar is fixed over the scrollport bottom — stick above it */
  .save-bar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
}
.save-bar .sb-discard { flex: 2; }
.save-bar .sb-save { flex: 3; }

/* ---------- Certificates ---------- */
.cert-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  margin-top: 12px;
}
.cert-item {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; border-radius: var(--radius-input); overflow: hidden;
  background: var(--surface-alt); border: 1px solid var(--border-alt);
  color: var(--text-secondary); font-size: 11px; font-weight: 700;
  text-align: center; padding: 4px; word-break: break-all;
}
.cert-item img { width: 100%; height: 100%; object-fit: cover; }
