/* UniServ · estilos. Sobrio: neutros, un color de marca, sin degradados. */
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #eef1f5;

  --brand: #0e2e54;
  --brand-d: #091f3a;
  --brand-soft: #e8eef6;
  --brand-ink: #0e2e54;

  --ok: #068c65;     --ok-bg: #e3f4ee;
  --warn: #b45309;   --warn-bg: #fdf2dc;
  --danger: #b42318; --danger-bg: #fdeceb;
  --info: #1f5a99;   --info-bg: #e8eef6;
  --star: #f5a524;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 12px; --r-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 12px -4px rgba(15, 23, 42, .08);
  --shadow-lg: 0 10px 32px -8px rgba(15, 23, 42, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.25; font-weight: 600; letter-spacing: -.012em; }
h1 { font-size: 1.65rem; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; }
h3 { font-size: .98rem; }
p { margin: 0 0 .6rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small { color: var(--muted); font-size: .8rem; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; vertical-align: -.2em; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
code { background: var(--line-soft); padding: .05rem .35rem; border-radius: 5px; font-size: .9em; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: 40px; padding: 0 1rem; border-radius: var(--r-sm); border: 1px solid transparent; font-weight: 600; font-size: .9rem; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; text-decoration: none !important; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--brand-d); }
.btn.secondary { background: var(--brand-soft); color: var(--brand-ink); }
.btn.secondary:hover:not(:disabled) { background: #d3e0ef; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover:not(:disabled) { border-color: #cbd5e1; background: #f8fafc; }
.btn.danger { background: var(--danger-bg); color: var(--danger); }
.btn.sm { height: 32px; padding: 0 .75rem; font-size: .82rem; }
.btn.block { display: flex; width: 100%; margin-top: .7rem; }
.link-btn { background: none; border: 0; color: var(--brand); font-weight: 600; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Cabecera y navegación ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1180px; margin: 0 auto; height: 60px; padding: 0 1.5rem; display: flex; align-items: center; gap: 2rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 700; font-size: 1.02rem; letter-spacing: -.02em; text-decoration: none !important; }
.logo { width: auto; height: 31px; flex: none; }
.mainnav { display: flex; gap: .25rem; height: 100%; }
.navlink { position: relative; display: flex; align-items: center; gap: .45rem; padding: 0 .85rem; color: var(--muted); font-weight: 600; font-size: .9rem; text-decoration: none !important; }
.navlink:hover { color: var(--ink); }
.navlink.active { color: var(--ink); }
.navlink.active::after { content: ""; position: absolute; left: .85rem; right: .85rem; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }
.nav-badge { background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 99px; display: grid; place-items: center; padding: 0 5px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 8px; cursor: pointer; color: var(--text); }
.icon-btn:hover { background: var(--line-soft); }
.dot-badge { position: absolute; top: 4px; right: 4px; background: #dc2626; color: #fff; font-size: .65rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 99px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; box-sizing: content-box; }
.user-chip { display: flex; align-items: center; gap: .55rem; background: transparent; border: 0; border-radius: 8px; padding: .25rem .5rem .25rem .25rem; cursor: pointer; text-align: left; }
.user-chip:hover { background: var(--line-soft); }
.user-chip span { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip strong { font-size: .85rem; color: var(--ink); font-weight: 600; }
.user-chip small { font-size: .72rem; }
.menu-wrap { position: relative; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); width: 320px; max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); z-index: 40; }
.dd-head { padding: .75rem 1rem; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--ink); }
.dd-item { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; width: 100%; text-align: left; font-size: .88rem; font-weight: 500; padding: .7rem 1rem; background: none; border: 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; color: var(--text); }
.dd-item:last-child { border-bottom: 0; }
.dd-item:hover { background: var(--bg); }
.dd-item select { font-weight: 400; }
.notif-item { display: flex; flex-direction: column; gap: .15rem; width: 100%; text-align: left; font-size: .85rem; padding: .7rem 1rem; background: none; border: 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; color: var(--text); }
.notif-item.unread { background: #f1f5fa; box-shadow: inset 3px 0 0 var(--brand); }
.notif-item:hover { background: var(--bg); }
.pad { padding: 1rem; }

/* ---------- Estructura ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.5rem 3rem; }
.page-title { margin-bottom: 1.25rem; }
.page-title p { color: var(--muted); margin: .3rem 0 0; }
.back { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-weight: 500; font-size: .86rem; margin-bottom: 1rem; }
.footer { text-align: center; color: var(--faint); font-size: .78rem; padding: 0 1rem 2rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.15rem 1.25rem; }
.card h2 { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.card + .card { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.two > .card + .card { margin-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.note { font-size: .84rem; color: var(--muted); margin: .7rem 0 0; }
.note.ok { color: var(--ok); font-weight: 500; }

.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: .82rem; }
.avatar.xl { width: 72px; height: 72px; font-size: 1.4rem; }
.avatar.sm { width: 24px; height: 24px; font-size: .62rem; }

.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 600; padding: .15rem .55rem; border-radius: 6px; white-space: nowrap; vertical-align: middle; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--brand-ink); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.neutral { background: var(--line-soft); color: var(--text); }
.stars { color: var(--star); letter-spacing: 1px; font-size: .95em; }
.stars i { font-style: normal; color: #dbe2ea; }

.facts { margin: .6rem 0 0; }
.facts > div { display: flex; justify-content: space-between; gap: 1.2rem; padding: .55rem 0; border-bottom: 1px solid var(--line-soft); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; color: var(--ink); font-weight: 500; }
.facts .total dt, .facts .total dd { color: var(--ink); font-weight: 700; font-size: 1.05rem; }

.progress { height: 6px; border-radius: 99px; background: var(--line-soft); overflow: hidden; margin: .5rem 0 .8rem; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }

.checklist, .timeline { list-style: none; padding: 0; margin: .4rem 0; }
.checklist li, .timeline li { display: flex; gap: .8rem; align-items: flex-start; padding: .55rem 0; position: relative; }
.checklist li > div, .timeline li > div { flex: 1; }
.checklist small, .timeline small { display: block; margin-top: .05rem; }
.checklist strong, .timeline strong { color: var(--ink); font-weight: 600; }
.tick, .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #cbd5e1; display: grid; place-items: center; color: #fff; background: var(--surface); }
li.ok .tick, li.ok .dot { background: var(--ok); border-color: var(--ok); }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 10.5px; top: 2rem; bottom: -.2rem; width: 1.5px; background: var(--line); }
.timeline li.ok:not(:last-child)::before { background: var(--ok); }

/* ---------- Formularios ---------- */
label.field, .auth-form label, .svc-form label, .filters label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--muted); font-weight: 500; }
select, input:not([type="checkbox"]):not([type="range"]):not([type="radio"]), textarea { width: 100%; height: 40px; padding: 0 .8rem; border: 1px solid #cfd8e3; border-radius: var(--r-sm); background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: .6rem .8rem; resize: vertical; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 46, 84, .18); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="range"] { accent-color: var(--brand); width: 100%; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 16px; height: 16px; margin: 0; }

/* ---------- Explorar ---------- */
.explore { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.filters { position: sticky; top: 84px; display: grid; gap: 1.1rem; }
.filters h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: .4rem; }
.search-box { position: relative; }
.search-box .ic { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search-box input:not([type="checkbox"]):not([type="range"]):not([type="radio"]) { padding-left: 2.2rem; }
.opt { display: flex !important; flex-direction: row !important; align-items: center; gap: .55rem !important; padding: .3rem 0; font-size: .9rem !important; color: var(--text) !important; font-weight: 400 !important; cursor: pointer; }
.opt .cnt { margin-left: auto; color: var(--faint); font-size: .8rem; }
.price-line { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink); font-weight: 600; margin-bottom: .3rem; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.results-head > span { color: var(--muted); font-size: .88rem; }
.results-head select { width: auto; height: 34px; font-size: .86rem; }
.rows { display: grid; gap: .75rem; }
.row-card { display: grid; grid-template-columns: 96px minmax(0, 1fr) 170px; gap: 1.1rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s, box-shadow .15s; }
.row-card:hover { border-color: #c7d2e2; box-shadow: var(--shadow); }
.thumb { width: 96px; height: 96px; border-radius: 10px; background: #eef2f8; color: #4a5f80; display: grid; place-items: center; text-decoration: none !important; }
.row-main { min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.row-main h3 { font-size: 1.02rem; }
.row-main h3 a { color: var(--ink); }
.row-main h3 a:hover { color: var(--brand); text-decoration: none; }
.by { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .85rem; margin: 0; }
.by b { color: var(--ink); font-weight: 600; }
.scope { color: var(--text); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .88rem; }
.inline { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .82rem; color: var(--muted); }
.inline li { display: inline-flex; align-items: center; gap: .3rem; }
.inline .star-ic { color: var(--star); fill: var(--star); }
.verified { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--ok); font-weight: 500; margin: 0; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; text-align: right; gap: .6rem; }
.price { font-size: 1.35rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; line-height: 1.1; }
.price small { display: block; font-size: .72rem; font-weight: 400; margin-top: .15rem; }
.match { font-size: .74rem; color: var(--muted); }
.row-side .btn { width: 100%; }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); }
.empty .ic { color: var(--faint); margin-bottom: .5rem; }

/* ---------- Detalle de servicio ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
.detail-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.1rem; }
.detail-head .tag { color: var(--muted); font-size: .8rem; font-weight: 500; display: flex; align-items: center; gap: .35rem; margin-bottom: .3rem; }
.detail-side { position: sticky; top: 84px; }
.detail-side .price { font-size: 1.8rem; }
.assure { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .65rem; font-size: .86rem; }
.assure li { display: flex; gap: .6rem; align-items: flex-start; }
.assure .ic { color: var(--ok); margin-top: .1rem; }
.sup-card { display: flex; align-items: center; gap: .8rem; padding: .8rem; background: var(--bg); border-radius: 10px; margin-top: .6rem; }

/* ---------- Casos ---------- */
.cases { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.case-list { display: grid; gap: .5rem; }
.case-item { display: block; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); text-decoration: none !important; }
.case-item:hover { border-color: #c7d2e2; }
.case-item.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.case-item strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: .1rem; }
.case-item .meta { display: flex; justify-content: space-between; align-items: center; margin-top: .45rem; gap: .5rem; }
.case-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.case-head p { color: var(--muted); margin: .25rem 0 0; }
.case-head .amount { text-align: right; font-size: 1.3rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.case-head .amount small { display: block; font-size: .72rem; font-weight: 400; margin-top: .2rem; }

.tracker { display: flex; list-style: none; margin: 0 0 .75rem; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tracker li { flex: 1; display: flex; align-items: center; gap: .5rem; padding: .7rem .8rem; font-size: .8rem; font-weight: 500; color: var(--faint); border-right: 1px solid var(--line-soft); min-width: 0; }
.tracker li:last-child { border-right: 0; }
.tracker li span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracker .n { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #cbd5e1; display: grid; place-items: center; font-size: .66rem; font-weight: 700; }
.tracker li.done { color: var(--text); }
.tracker li.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.tracker li.now { color: var(--brand-ink); font-weight: 600; background: #f1f5fa; }
.tracker li.now .n { border-color: var(--brand); color: var(--brand); }
.nextline { display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; font-size: .88rem; color: var(--text); }
.nextline b { color: var(--ink); }
.nextline .ic { color: var(--brand); }

.tabs-bar { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tab { display: flex; align-items: center; gap: .45rem; padding: .65rem .9rem; color: var(--muted); font-weight: 500; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- Chat ---------- */
.chat-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.chat-grid .card + .card { margin-top: 0; }
.chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.chat-head small { display: flex; align-items: center; gap: .3rem; }
.chat-body { min-height: 280px; max-height: 400px; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; background: #fafbfc; }
.msg { max-width: 78%; display: flex; flex-direction: column; }
.msg span { padding: .55rem .85rem; border-radius: 14px; font-size: .9rem; line-height: 1.45; }
.msg.student span { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--ink); }
.msg.client { align-self: flex-end; align-items: flex-end; }
.msg.client span { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.who { color: var(--muted); font-size: .72rem; margin: 0 .4rem .15rem; }
.sys { align-self: center; display: inline-flex; align-items: center; gap: .4rem; background: var(--line-soft); color: var(--text); border-radius: 99px; padding: .3rem .8rem; font-size: .78rem; text-align: center; max-width: 92%; }
.quick { display: flex; flex-wrap: wrap; gap: .4rem; padding: .6rem 1rem 0; }
.chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 500; padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); cursor: pointer; color: var(--text); }
.chip:hover { border-color: #b9c6dc; background: #f8fafc; }
.chat-form { display: flex; gap: .5rem; padding: .75rem 1rem 1rem; }
.accepts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .9rem 0 .2rem; }
.accepts span { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .45rem; border-radius: 8px; background: var(--line-soft); color: var(--muted); font-size: .82rem; font-weight: 500; }
.accepts span.ok { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.toggle { display: flex; align-items: flex-start; gap: .5rem; font-size: .8rem; color: var(--muted); margin-top: .9rem; cursor: pointer; }
.toggle input { margin-top: .15rem; flex: none; }

/* ---------- Agenda, supervisión y pago ---------- */
.days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.day-card { border: 1px solid var(--line); border-radius: 10px; padding: .7rem; background: var(--surface); }
.day-card .dow { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day-card .dnum { font-size: 1.35rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.day-card .dmon { font-size: .76rem; color: var(--muted); margin-bottom: .5rem; }
.slots { display: flex; flex-wrap: wrap; gap: .3rem; }
.slot { font-size: .8rem; font-weight: 500; padding: .28rem .55rem; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; }
.slot:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.slot.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.slot:disabled { cursor: not-allowed; color: var(--faint); background: var(--bg); text-decoration: line-through; }
.callout { display: flex; gap: .6rem; align-items: flex-start; background: var(--info-bg); color: var(--brand-ink); border-radius: 10px; padding: .7rem .85rem; font-size: .85rem; margin-top: .9rem; }
.callout .ic { margin-top: .1rem; }
.callout.warn { background: var(--warn-bg); color: var(--warn); }
.big-slot { font-size: 1.25rem; font-weight: 600; color: var(--ink); margin: .2rem 0 .4rem; }

.status { display: flex; align-items: center; gap: 1rem; border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.2rem; margin-bottom: 1rem; background: var(--surface); }
.status .big-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--info-bg); color: var(--brand); display: grid; place-items: center; flex: none; }
.status.ok .big-ic { background: var(--ok-bg); color: var(--ok); }
.status.warn .big-ic { background: var(--warn-bg); color: var(--warn); }
.status h2 { margin: 0; }
.status p { margin: .1rem 0 0; color: var(--muted); font-size: .86rem; }
.status .amount { margin-left: auto; text-align: right; font-size: 1.4rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.status .amount small { display: block; font-size: .72rem; font-weight: 400; }

.rate-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding: .55rem 0; border-bottom: 1px solid var(--line-soft); }
.rate-row small { flex-basis: 100%; }
.star { font-size: 1.5rem; line-height: 1; background: none; border: 0; color: #dbe2ea; cursor: pointer; padding: 0 .05rem; }
.star.on { color: var(--star); }
.star:disabled { cursor: default; }
.rate-row .star { font-size: 1.1rem; }
.rep { display: flex; align-items: center; gap: .8rem; margin-top: .9rem; padding: .8rem; background: var(--bg); border-radius: 10px; }
.locked { opacity: .65; }
.dispute-form, .dispute-box { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.dispute-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--muted); }
.dispute-box { background: var(--warn-bg); border: 1px solid #f3d9a0; border-radius: 10px; padding: .85rem; margin-top: .8rem; }

/* ---------- Perfil ---------- */
.profile-top { display: flex; gap: 1.1rem; align-items: center; }
.profile-top h2 { font-size: 1.25rem; margin: 0 0 .15rem; }
.svc-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line-soft); }
.svc-row:last-of-type { border-bottom: 0; }
.svc-row small { display: block; margin-top: .1rem; }
.row-actions { display: flex; gap: .4rem; flex: none; }
.svc-form { margin-top: 1rem; padding: 1.1rem; background: var(--bg); border-radius: 10px; display: grid; gap: .9rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.form-grid .wide { grid-column: 1 / -1; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: .82rem; color: var(--muted); font-weight: 500; padding: 0; margin-bottom: .4rem; }
.days { display: flex; flex-wrap: wrap; gap: .4rem; }
.day-check { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: .35rem !important; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .3rem .65rem; cursor: pointer; font-size: .84rem !important; color: var(--text) !important; }
.form-actions { display: flex; gap: .6rem; }
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.people .card + .card { margin-top: 0; }

/* ---------- Portada y acceso ---------- */
body.is-auth .topbar, body.is-auth .footer { display: none; }
.landing { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.intro { position: relative; padding: 2.5rem clamp(1.5rem, 6vw, 5.5rem); display: flex; flex-direction: column; justify-content: center; gap: 2rem; background: var(--surface); }
.intro .brand { position: absolute; top: 1.75rem; }
.intro h1 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.1; letter-spacing: -.035em; font-weight: 700; max-width: 16ch; }
.intro .lead { font-size: 1.08rem; color: var(--muted); max-width: 46ch; margin: 1rem 0 0; }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; max-width: 46ch; }
.points li { display: flex; gap: .8rem; align-items: flex-start; }
.points .ic { color: var(--brand); margin-top: .2rem; }
.points strong { display: block; color: var(--ink); font-weight: 600; }
.points span { color: var(--muted); font-size: .9rem; }
.access { display: flex; flex-direction: column; justify-content: center; gap: 1.1rem; padding: 2.5rem clamp(1.4rem, 4vw, 4rem); max-width: 560px; width: 100%; margin: 0 auto; }
.access h2 { font-size: 1.4rem; }
.tabs { display: flex; gap: .2rem; background: var(--line-soft); border-radius: 10px; padding: .2rem; }
.tabs button { flex: 1; border: 0; background: transparent; padding: .5rem; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
.auth-form { display: grid; gap: .8rem; }
.demo-box { border: 1px dashed #cbd5e1; border-radius: var(--r); padding: 1rem 1.1rem; background: var(--surface); }
.demo-box h3 { display: flex; align-items: center; gap: .45rem; }
.demo-group { margin-top: .8rem; }
.demo-group > span { display: block; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: .3rem; }
.demo-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.demo-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .7rem .2rem .25rem; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: .82rem; font-weight: 500; cursor: pointer; color: var(--text); }
.demo-chip:hover { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- Guía de demo ---------- */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(580px, calc(100vw - 2rem)); box-shadow: var(--shadow-lg); color: var(--text); }
dialog::backdrop { background: rgba(15, 23, 42, .45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); }
.dlg-body { padding: .6rem 1.3rem 1.3rem; max-height: 70vh; overflow-y: auto; }
.guide { list-style: none; padding: 0; margin: 0; counter-reset: g; }
.guide li { display: grid; grid-template-columns: 28px 1fr auto; gap: .8rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line-soft); counter-increment: g; }
.guide li::before { content: counter(g); width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: .78rem; }
.guide strong { color: var(--ink); display: block; }
.guide small { display: block; }

/* ---------- Estados vacíos y aviso ---------- */
.empty-state { text-align: center; padding: 2.5rem 1rem; }
.empty-state .ic { color: var(--faint); }
.empty-state p { color: var(--muted); max-width: 46ch; margin: .6rem auto .9rem; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 16px); display: flex; align-items: center; gap: .55rem; background: var(--ink); color: #fff; padding: .65rem 1rem; border-radius: 10px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; font-weight: 500; font-size: .88rem; max-width: calc(100vw - 2rem); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .explore { grid-template-columns: 1fr; }
  .filters { position: static; }
  .detail { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .cases { grid-template-columns: 1fr; }
  .cases.has-detail .case-list { display: none; }
  .cases:not(.has-detail) .case-detail { display: none; }
  .chat-grid { grid-template-columns: 1fr; }
  .landing { grid-template-columns: 1fr; min-height: 0; }
  .intro { padding-top: 5rem; }
}
@media (max-width: 760px) {
  .topbar-in { padding: 0 1rem; gap: 1rem; }
  .user-chip span { display: none; }
  .mainnav { position: fixed; left: 0; right: 0; bottom: 0; height: 58px; background: var(--surface); border-top: 1px solid var(--line); z-index: 35; justify-content: space-around; }
  .navlink { flex: 1; flex-direction: column; justify-content: center; gap: .1rem; font-size: .7rem; padding: 0; }
  .navlink.active::after { top: -1px; bottom: auto; left: 25%; right: 25%; }
  body:not(.is-auth) { padding-bottom: 66px; }
  .page { padding: 1.25rem 1rem 2rem; }
  .grid.two, .form-grid, .people { grid-template-columns: 1fr; }
  .row-card { grid-template-columns: 72px minmax(0, 1fr); }
  .thumb { width: 72px; height: 72px; }
  .row-side { grid-column: 1 / -1; flex-direction: row; align-items: center; text-align: left; }
  .row-side .btn { width: auto; }
  .tracker { flex-wrap: wrap; }
  .tracker li { flex: 1 1 33%; border-bottom: 1px solid var(--line-soft); }
  .status { flex-wrap: wrap; }
  .dropdown { position: fixed; left: 1rem; right: 1rem; top: 66px; width: auto; }
  .svc-row { flex-direction: column; align-items: flex-start; }
  .case-head { flex-direction: column; }
  .case-head .amount { text-align: left; }
  .toast { bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

.mobile-only { display: none; }
@media (max-width: 1000px) { .mobile-only { display: inline-flex; } }
.grid + .card, .people + .card, .card + .grid { margin-top: 1rem; }
@media (max-width: 760px) {
  .hide-sm, .user-chip .ic { display: none; }
  .topbar-in { gap: .5rem; }
  .topbar-actions { gap: .15rem; }
  .brand { font-size: .95rem; }
  .navlink { position: relative; }
  .navlink .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); }
  html, body { overflow-x: hidden; }
}
