/* FellowAI brand, shared by the logged-in pages (back office now, client portal
   next). Same tokens as the public site (site/styles.css): deep green carries
   text and buttons; mango and coral are shapes and backgrounds only, never text,
   because neither has enough contrast on white. Phone first. */
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --ink: #0F3D2E;
  --ink-2: #1F5C45;
  --muted: #3E6355;
  --ground: #EEF6F0;
  --surface: #FFFFFF;
  --rule: #D3E5D9;
  --mango: #FFB627;
  --mango-sf: #FFF1D2;
  --coral: #FF8A70;
  --coral-sf: #FFE4DD;
  --mint: #7FD1A0;
  --mint-sf: #E3F3E8;
  --red-ink: #9A2B16;
  --f-display: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "Figtree", system-ui, sans-serif;
  --radius: 16px;
  /* Motion (b12): short and quiet, the owner uses this a hundred times a day. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --spring: linear(0, 0.032, 0.11, 0.211, 0.322, 0.433, 0.536, 0.629, 0.709, 0.777, 0.833, 0.879, 0.914, 0.942, 0.963, 0.978, 0.989, 0.997, 1.002, 1.005, 1.006, 1.007, 1.007, 1.007, 1.006, 1.005, 1.004, 1.004, 1.003, 1.002, 1.002, 1.001, 1.001);
}
@supports not (transition-timing-function: linear(0, 1)) { :root { --spring: cubic-bezier(0.34, 1.2, 0.64, 1); } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
a { color: var(--ink); }
.muted { color: var(--muted); }
.stack { display: grid; gap: 0.75rem; }
.grid2 { display: grid; gap: 0.75rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Shell: top bar, content, tab bar fixed to the bottom on phones. */
.app { overflow-x: clip; min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 16px; padding-top: max(0.9rem, env(safe-area-inset-top)); background: var(--ink); color: var(--ground); }
.brand { display: flex; align-items: center; gap: 0.6rem; font: 800 1.15rem var(--f-display); }
.brand img { width: 34px; height: 34px; }
.topbar .btn-quiet { color: var(--ground); border-color: rgba(238, 246, 240, 0.4); }
.view { max-width: 46rem; margin: 0 auto; padding: 1.2rem 16px 2rem; display: grid; gap: 1rem; }
.view > h1 { font-size: 1.7rem; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; isolation: isolate; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.tabs-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tab { appearance: none; border: 0; background: none; font: 600 0.82rem var(--f-body); color: var(--muted); min-height: 60px; padding: 0.5rem 0.2rem; cursor: pointer; position: relative; }
.tab[aria-selected="true"] { color: var(--ink); }
/* One marker for all tabs, moved by ui.js (FellowUI.markTab) with a soft spring. */
.tab-marker { position: absolute; top: 0; left: 0; width: 20%; height: 4px; pointer-events: none; transition: transform 340ms var(--spring); }
.tab-marker::before { content: ""; display: block; height: 4px; margin: 0 22%; border-radius: 0 0 4px 4px; background: var(--mango); }
/* Screens: in from the side of the tab (24 px and a fade), or a plain fade. */
.view.enter-right { animation: view-in-right 260ms var(--ease-out) both; }
.view.enter-left { animation: view-in-left 260ms var(--ease-out) both; }
.view.enter-fade { animation: view-fade 220ms var(--ease-out) both; }
@keyframes view-in-right { from { opacity: 0; transform: translateX(24px); } }
@keyframes view-in-left { from { opacity: 0; transform: translateX(-24px); } }
@keyframes view-fade { from { opacity: 0; } }
/* Grey shapes while a first visit loads, instead of "Cargando…". */
.sk { display: block; border-radius: 10px; background: linear-gradient(90deg, #E2EEE6 0 40%, #EDF5F0 50%, #E2EEE6 60% 100%) 0 0 / 300% 100%; animation: sk-shimmer 1.3s linear infinite; }
.sk-title { width: 45%; height: 1.9rem; }
.sk-row { height: 4.2rem; border-radius: var(--radius); }
@keyframes sk-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .view.enter-right, .view.enter-left { animation-name: view-fade; animation-duration: 150ms; }
  .tab-marker { transition: none; }
  .sk { animation: none; }
}
.tab .dot { display: inline-block; min-width: 1.2rem; margin-left: 0.2rem; padding: 0 0.3rem; border-radius: 999px; background: var(--coral); color: var(--ink); font-size: 0.72rem; }
@media (min-width: 900px) {
  .app { padding-bottom: 0; display: grid; grid-template-columns: 13rem minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .topbar, .admin-banner { grid-column: 1 / -1; }
  /* Last row always, so the 1-hour banner (row 2, empty when hidden) never takes the menu's place. */
  .tabs, .view { grid-row: 3; }
  /* A grid item with auto margins shrinks to its content; keep the 46rem column and stack cards from the top. */
  .view { width: 100%; align-content: start; }
  .tabs { position: static; display: flex; flex-direction: column; border-top: 0; border-right: 1px solid var(--rule); padding: 1rem 0.6rem; gap: 0.2rem; }
  .tab-marker { display: none; }
  .tab { text-align: left; padding: 0.7rem 1rem; border-radius: 12px; min-height: 48px; font-size: 0.95rem; }
  .tab[aria-selected="true"] { background: var(--mint-sf); }
  .tab[aria-selected="true"]::before { display: none; }
}

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem; display: grid; gap: 0.75rem; min-width: 0; }
.card h2 { font-size: 1.15rem; display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }

.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 0; border-top: 1px solid var(--rule); min-width: 0; }
.row:first-of-type { border-top: 0; }
.row-main { display: grid; gap: 0.15rem; min-width: 0; overflow-wrap: anywhere; }
.row-main strong { font-weight: 700; }
.row-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; align-items: center; flex-shrink: 0; max-width: 55%; }
button.row { width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; font: inherit; color: inherit; cursor: pointer; }

.badge { display: inline-block; font-size: 0.78rem; font-weight: 700; border-radius: 8px; padding: 0.15rem 0.55rem; white-space: nowrap; }
.badge-red { background: var(--coral-sf); color: var(--red-ink); }
.badge-mango { background: var(--mango-sf); color: var(--ink); }
.badge-mint { background: var(--mint-sf); color: var(--ink); }
.badge-grey { background: #EEF1EF; color: var(--muted); }
/* The owner's own labels (VIP...): outlined, because the washes mean status. */
.badge-tag { background: none; border: 1px solid var(--rule); color: var(--ink); }
.order-id { font-size: 0.78rem; overflow-wrap: anywhere; }

.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 44px; padding: 0.6rem 1.1rem; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--ground); font: 700 0.95rem var(--f-body); cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-danger { background: transparent; color: var(--red-ink); border-color: var(--coral); }
.btn-danger-solid { background: var(--red-ink); border-color: var(--red-ink); color: #fff; }
.btn, .chip, .tab, button.row { -webkit-tap-highlight-color: transparent; transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease; }
.btn:active, .chip:active { transform: scale(0.97); }
.btn:focus-visible, .tab:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button.row:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; }

.field { display: grid; gap: 0.3rem; min-width: 0; }
.field label { font-weight: 600; font-size: 0.92rem; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 0.6rem 0.75rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); color: var(--ink); font: 16px var(--f-body); }
.field textarea { min-height: 6rem; resize: vertical; }
.check { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; font-weight: 600; }
.check input { width: 1.3rem; height: 1.3rem; accent-color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { appearance: none; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 0.45rem 0.85rem; min-height: 40px; font: 600 0.88rem var(--f-body); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }

.empty { display: grid; justify-items: center; gap: 0.6rem; text-align: center; padding: 1.5rem 0.5rem; color: var(--muted); }
.empty img { width: 9rem; height: auto; }
/* Toast and confirm sheet (b12) are the only app pieces that float, so the
   only ones with a shadow (DESIGN.md, the Counter-Top Rule). */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: 30rem; margin: 0 auto; background: var(--ink); color: var(--ground); padding: 0.8rem 1rem; border-radius: 14px; font-weight: 600; z-index: 20; box-shadow: 0 18px 36px -20px rgba(15, 61, 46, .5); pointer-events: none; opacity: 0; visibility: hidden; transform: translateY(24px); transition: transform 280ms var(--ease-out), opacity 200ms ease, visibility 0s linear 280ms; }
.toast.show { opacity: 1; visibility: visible; transform: none; transition: transform 420ms var(--spring), opacity 160ms ease, visibility 0s; }
body.chat-open .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
.sheet-wrap { position: fixed; inset: 0; z-index: 30; }
.sheet-wrap[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 61, 46, .45); opacity: 0; transition: opacity 240ms ease; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 34rem; margin: 0 auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 0.6rem 20px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 0.7rem; transform: translateY(100%); transition: transform 240ms var(--ease-in-out); }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; transition: transform 380ms var(--spring); }
.sheet-grab { justify-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--rule); margin-bottom: 0.3rem; }
.sheet-title { font: 800 1.3rem/1.2 var(--f-display); margin: 0; }
.sheet-text { color: var(--muted); margin: 0; white-space: pre-line; }
.sheet-actions { display: grid; gap: 0.5rem; margin-top: 0.3rem; }
.sheet-actions .btn { min-height: 48px; }
@media (min-width: 900px) { .sheet { bottom: 50%; transform: translateY(calc(50% + 40px)); opacity: 0; border-radius: 24px; } .sheet-wrap.open .sheet { transform: translateY(50%); opacity: 1; } .sheet { transition: transform 240ms var(--ease-in-out), opacity 200ms ease; } .sheet-grab { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .toast, .toast.show { transform: none; transition: opacity 150ms ease, visibility 0s; }
  .sheet, .sheet-wrap.open .sheet { transition: opacity 150ms ease; }
  .sheet { transform: none; opacity: 0; } .sheet-wrap.open .sheet { opacity: 1; }
  @media (min-width: 900px) { .sheet, .sheet-wrap.open .sheet { transform: translateY(50%); } }
  .btn, .chip, .tab, button.row { transition: background-color 160ms ease, color 160ms ease; }
  .btn:active, .chip:active { transform: none; }
}
@media (min-width: 900px) { .toast { bottom: 24px; } }

.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); }
.login form { width: min(24rem, 100%); background: var(--surface); border: 1px solid var(--rule); border-radius: 20px; padding: 1.5rem; display: grid; gap: 1rem; }
.login .brand { color: var(--ink); }
.error { color: var(--red-ink); font-weight: 600; }

/* ---------- Client portal ---------- */
.login-title { font-size: 1.6rem; margin-bottom: 0.2rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chat-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge-red { text-transform: none; }

/* A conversation reads like WhatsApp: the customer on the left, the business
   (bot or owner) on the right. The owner's own messages are mango so they stand
   out from the bot's. */
.chat { gap: 0.5rem; }
.bubble { display: grid; gap: 0.15rem; max-width: 85%; padding: 0.55rem 0.8rem; border-radius: 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble-who { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.bubble-customer { justify-self: start; background: var(--ground); border-bottom-left-radius: 4px; }
.bubble-bot { justify-self: end; background: var(--mint-sf); border-bottom-right-radius: 4px; }
.bubble-owner { justify-self: end; background: var(--mango-sf); border-bottom-right-radius: 4px; }
.handoff-state { color: var(--muted); }

/* ---------- the chat as its own screen (b12) ---------- */
.pay-hint { appearance: none; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; width: 100%; min-height: 48px; padding: 0.7rem 1rem; border: 0; border-radius: 14px; background: var(--mango-sf); color: var(--ink); font: 700 0.95rem var(--f-body); text-align: left; cursor: pointer; }
.pay-hint-go { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
button.row.chat-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
.chat-line { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; min-width: 0; }
.chat-line strong { font-size: 1rem; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.chat-phone { font-size: 0.82rem; }
.chat-row .chat-preview { -webkit-line-clamp: 2; color: var(--muted); overflow-wrap: anywhere; }
.chat-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.25rem; }
.when { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chat-row.is-waiting .when { color: var(--red-ink); font-weight: 700; }
.icon { width: 22px; height: 22px; }

body.chat-open .tabs { transform: translateY(100%); }
.tabs { transition: transform 260ms var(--ease-out); }
body.chat-open .app { padding-bottom: 0; }
/* The chat fills the screen under the top bar, so even a short one keeps the
   reply box at the bottom (sticky only helps once the chat is long). */
body.chat-open .view { padding-bottom: 0; gap: 0.75rem; display: flex; flex-direction: column; min-height: calc(100dvh - 4.4rem); }
body.chat-open .view > .chat { flex: 1; align-content: end; }
/* A chat on a phone is its own screen: its header is the top bar, as on WhatsApp. */
@media (max-width: 899px) { body.chat-open .topbar { display: none; } body.chat-open .view { padding-top: max(0.75rem, env(safe-area-inset-top)); min-height: 100dvh; } }
body.chat-open .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
.view.enter-push { animation: view-push 300ms var(--ease-out) both; }
.view.enter-back { animation: view-in-left 240ms var(--ease-out) both; }
@keyframes view-push { from { transform: translateX(100%); } }
.chat-head { display: flex; align-items: center; gap: 0.5rem; }
.chat-back { appearance: none; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; margin-left: -4px; }
.chat-who { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.chat-who strong { font: 800 1.2rem/1.2 var(--f-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-who .muted { font-size: 0.82rem; }
.chat-pause { flex: none; }
.chat-pause.is-on { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.handoff-state { display: flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0.5rem 0.8rem; border-radius: 12px; background: var(--mint-sf); color: var(--ink); font-size: 0.88rem; transition: background-color 260ms ease; }
.handoff-state.handoff-paused { background: var(--mango-sf); }
.state-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); flex: none; }
.handoff-paused .state-dot { background: var(--mango); }
.chat { display: grid; gap: 0.45rem; padding-bottom: 0.5rem; }
/* On the open ground (no card) the customer's bubble is white, as in WhatsApp. */
.chat .bubble-customer { background: var(--surface); }
.bubble-meta { display: flex; align-items: center; justify-content: flex-end; gap: 0.3rem; font-size: 0.72rem; color: var(--muted); }
.bubble-meta .icon { width: 14px; height: 14px; }
.bubble.is-new { animation: bubble-in 300ms var(--spring) both; transform-origin: bottom right; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
.bubble.is-failed { box-shadow: inset 0 0 0 1px var(--coral); cursor: pointer; }
.bubble.is-failed .bubble-meta { color: var(--red-ink); font-weight: 700; }
/* The reply box stays at the bottom of the screen while the chat scrolls. */
.composer { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: flex-end; gap: 0.5rem; margin: 0 -16px; padding: 0.6rem 16px calc(0.6rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--rule); }
.composer textarea { flex: 1; min-width: 0; resize: none; min-height: 44px; max-height: 120px; padding: 0.6rem 0.9rem; border: 1px solid var(--rule); border-radius: 22px; background: var(--ground); color: var(--ink); font: 16px/1.4 var(--f-body); }
.composer textarea:focus-visible { outline: 3px solid var(--mango); outline-offset: 1px; }
.chat-send { appearance: none; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: var(--ground); cursor: pointer; transition: transform 160ms var(--ease-out); }
.chat-send:active { transform: scale(0.94); }
.chat-attach { appearance: none; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; transition: transform 160ms var(--ease-out); }
.chat-attach:active { transform: scale(0.94); }
.chat-attach:focus-visible, .chat-send:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; }
.sheet-slot[hidden] { display: none; }
.sheet-preview { display: block; width: 100%; max-height: 45vh; object-fit: contain; border-radius: 12px; background: var(--ground); }
.sheet-file { display: flex; align-items: center; gap: 0.6rem; margin: 0; padding: 0.8rem 1rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--ground); font-weight: 600; overflow-wrap: anywhere; }
.sheet-file .icon { flex: none; width: 22px; height: 22px; }
.sheet-caption { width: 100%; resize: none; padding: 0.6rem 0.75rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); color: var(--ink); font: 16px/1.4 var(--f-body); }
.sheet-caption:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; }
@media (min-width: 900px) { body.chat-open .tabs { transform: none; } .composer { margin: 0; border-radius: 16px 16px 0 0; border: 1px solid var(--rule); } }
@media (prefers-reduced-motion: reduce) {
  .view.enter-push, .view.enter-back { animation: view-fade 150ms ease both; }
  .bubble.is-new { animation: view-fade 150ms ease both; }
  .tabs { transition: none; }
}
.handoff-paused { color: var(--ink); font-weight: 700; }

.order-total { font-family: var(--f-display); }
.address { margin: 0; padding: 0.6rem 0.75rem; border-radius: 12px; background: var(--mango-sf); overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-3 .stat { padding: 0.65rem 0.55rem; }
.stat > span { overflow-wrap: normal; font-size: 0.85rem; }
.stat-wide { grid-column: 1 / -1; }
.stat-wide strong { font-size: 1.7rem; }
.stat { display: grid; gap: 0.1rem; padding: 0.75rem; border-radius: 12px; background: var(--ground); min-width: 0; overflow-wrap: anywhere; }
.stat strong { font: 800 clamp(1.1rem, 5.2vw, 1.35rem) var(--f-display); white-space: nowrap; overflow-wrap: normal; font-variant-numeric: tabular-nums; }

/* Browsers size time inputs very differently, so the day name takes its own
   line on a phone and the two times share the next one. */
.hours-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.4rem 0.6rem; align-items: center; padding: 0.6rem 0; border-top: 1px solid var(--rule); }
.hours-day { grid-column: 1 / -1; font-weight: 700; }
.hours-row input[type="time"] { min-height: 44px; width: 100%; padding: 0.4rem 0.5rem; border: 1px solid var(--rule); border-radius: 10px; font: 16px var(--f-body); color: var(--ink); background: var(--surface); }
.hours-row .check { grid-column: 1 / -1; min-height: 36px; }
@media (min-width: 560px) {
  .hours-row { grid-template-columns: 7rem minmax(0, 1fr) minmax(0, 1fr) auto; }
  .hours-day, .hours-row .check { grid-column: auto; }
}
.check-ok { font-weight: 700; margin: 0; }
.warn { margin: 0; padding: 0.5rem 0.75rem; border-radius: 10px; background: var(--mango-sf); }

/* Portal catalog */
.admin-banner { margin: 0; padding: 0.6rem 1rem; background: var(--mango-sf); color: var(--ink); font-weight: 600; text-align: center; }
.stepper { display: flex; gap: 0.5rem; align-items: center; }
.stepper input { width: 7rem; text-align: center; }
.stepper .btn { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.3rem; }
.private-box { border-top: 1px dashed var(--rule); padding-top: 0.75rem; }
.search { width: 100%; min-height: 44px; padding: 0.6rem 0.75rem; border: 1px solid var(--rule); border-radius: 12px; font: 16px var(--f-body); background: var(--surface); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font: 600 0.92rem var(--f-body); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }

/* Payments to check: comprobante thumbnails and the full-size view. */
.receipt { display: block; width: 100%; max-width: 22rem; max-height: 14rem; object-fit: cover; border-radius: 12px; border: 1px solid var(--mint-rule, #D3E5D9); cursor: zoom-in; }
.photo-full { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 16px; background: rgba(15, 61, 46, 0.92); }
.photo-full img { max-width: 100%; max-height: 80vh; border-radius: 12px; }
.payment-check { padding-top: 0.75rem; border-top: 1px solid var(--mint-rule, #D3E5D9); }

/* ---------- Oficina: a client at a glance, the rest in folding groups (b12) ---------- */
.glance { gap: 0.9rem; }
.glance-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.state-pill { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--mint-sf); }
.state-pill.is-off { background: #EEF1EF; color: var(--muted); }
.state-pill.is-off .state-dot { background: var(--muted); }
.glance-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.glance-list li { display: flex; align-items: center; gap: 0.55rem; }
.glance-list li.is-missing { color: var(--muted); }
.glance-mark { width: 18px; height: 18px; border-radius: 50%; flex: none; position: relative; background: var(--mint); }
.glance-mark::after { content: ""; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.is-missing .glance-mark { background: none; box-shadow: inset 0 0 0 2px var(--rule); }
.is-missing .glance-mark::after { display: none; }
.glance .chips:empty { display: none; }

.group { padding: 0; gap: 0; }
.group > summary, details.group.card > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 0.75rem; padding: 0.95rem 1rem; min-height: 56px; border-radius: var(--radius); -webkit-tap-highlight-color: transparent; }
.group > summary::-webkit-details-marker { display: none; }
.group > summary::after { content: ""; grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 10px; height: 10px; border: solid var(--ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); margin: 0 0.3rem 0.3rem; transition: transform 240ms var(--ease-out); }
.group[open] > summary::after { transform: rotate(-135deg); margin-bottom: -0.2rem; }
.group > summary:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; }
.group-title { font: 800 1.15rem/1.2 var(--f-display); }
.group-hint { grid-column: 1; color: var(--muted); font-size: 0.88rem; }
.group-body { display: grid; gap: 0; padding: 0 1rem 1rem; }
/* Portal Más: its cards sit inside a group as plain parts, never as cards in a card. */
.group-body > .card { border: 0; border-top: 1px solid var(--rule); border-radius: 0; background: none; padding: 1rem 0 0; margin-top: 1rem; }
.group-body > .card:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.group-body > .btn { margin-top: 1rem; justify-self: start; }
.group[open] > .group-body { animation: view-fade 220ms var(--ease-out) both; }
.part { display: grid; gap: 0.75rem; padding: 1rem 0; border-top: 1px solid var(--rule); min-width: 0; }
.part h3 { margin: 0; font-size: 1rem; display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .group > summary::after { transition: none; } }

/* Prospectos (Oficina, b11) */
.prospect-head > p, .prospect-head > h1 { margin: 0; }
.sign-row { display: grid; gap: 0.3rem; }
.sign-label { font-weight: 600; font-size: 0.92rem; }
.sheet-form { max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.sheet-form input[type="text"], .sheet-form input[type="tel"], .sheet-form input[type="datetime-local"] { width: 100%; min-height: 44px; padding: 0.6rem 0.75rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); color: var(--ink); font: 16px var(--f-body); }
.paste-box { min-height: 10rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }
details.card > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
