/* Hazme el Favor — estilos
   Idea visual: etiquetas de equipaje (código de ciudad grande, agujero, perforación)
   y una moneda amarilla como único elemento llamativo para los créditos. */

:root {
  --paper: #F2F4EF;
  --surface: #FFFFFF;
  --surface-2: #F8F9F6;
  --ink: #15201E;
  --ink-2: #4B5856;
  --ink-3: #7D8A87;
  --line: #DCE2DB;
  --line-2: #E9EDE7;
  --teal: #0F6B5F;
  --teal-hover: #0B564C;
  --teal-soft: #DDEFEA;
  --coin: #FFC23A;
  --coin-hi: #FFE08A;
  --coin-deep: #B37A00;
  --sky: #E4EDFB;
  --sky-ink: #2B4F86;
  --amber-soft: #FFF2CF;
  --amber-ink: #7A5200;
  --danger: #B93A26;
  --danger-soft: #FBE6E1;
  --radius-l: 20px;
  --radius-m: 14px;
  --radius-s: 10px;
  --shadow: 0 1px 0 rgba(21, 32, 30, .04), 0 6px 18px -10px rgba(21, 32, 30, .18);
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.5 var(--body); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1.06rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--teal) 45%, transparent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.ico { width: 20px; height: 20px; flex: none; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp1 { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Moneda ---------- */
.coin {
  --s: 30px;
  display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--coin-hi), var(--coin) 55%, #F4AE12);
  box-shadow: inset 0 0 0 2px var(--coin-deep), inset 0 0 0 4px rgba(255, 255, 255, .45), 0 1px 0 var(--coin-deep);
  color: #3A2800; font: 800 calc(var(--s) * .42)/1 var(--display); font-variant-numeric: tabular-nums;
}
.coin-sm { --s: 20px; box-shadow: inset 0 0 0 1.5px var(--coin-deep); font-size: 10px; }
.coin-md { --s: 40px; }
.coin-lg { --s: 48px; }
.coin-xl { --s: 104px; box-shadow: inset 0 0 0 3px var(--coin-deep), inset 0 0 0 9px rgba(255, 255, 255, .4), 0 3px 0 var(--coin-deep), 0 16px 30px -12px rgba(179, 122, 0, .6); }

.price { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.price-open { color: var(--ink-2); font-weight: 500; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none !important;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-hover); border-color: var(--teal-hover); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(21, 32, 30, .06); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; color: var(--ink); position: relative;
}
.icon-btn:hover { background: rgba(21, 32, 30, .07); }
.link { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; text-decoration: underline; }

/* ---------- Estructura ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 18px; display: flex; flex-direction: column; gap: 18px;
  background: var(--ink); color: #E9EFEC;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font: 750 1.2rem/1.05 var(--display); letter-spacing: -0.02em; text-decoration: none !important; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px 9px 9px 2px; background: var(--coin); position: relative; flex: none;
  box-shadow: inset 0 0 0 2px var(--coin-deep);
}
.brand-mark::after { content: ''; position: absolute; top: 7px; left: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.balance {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-m);
  background: rgba(255, 255, 255, .06); color: inherit; text-decoration: none !important; border: 1px solid rgba(255, 255, 255, .08);
}
.balance:hover, .balance.on { background: rgba(255, 255, 255, .1); }
.balance b { display: block; font-family: var(--display); }
.balance small { color: #A9B7B3; }
.btn-ask { background: var(--coin); border-color: var(--coin); color: var(--ink); }
.btn-ask:hover { background: #FFCF5E; border-color: #FFCF5E; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .me-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-s);
  color: #C7D2CF; font-weight: 550; text-decoration: none !important;
}
.nav a:hover, .me-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on, .me-link.on { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--coin); color: var(--ink); font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.me-link { margin-top: auto; }
.me-link > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 12px clamp(16px, 4vw, 48px); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px);
}
.brand-mobile { display: none; color: var(--ink); font-size: 1.1rem; }
.topbar-right { display: flex; align-items: center; gap: 6px; position: relative; }
.balance-mini { display: none; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none !important; font-family: var(--display); }
.bell { background: var(--surface); border: 1px solid var(--line); }
.bell .dot { position: absolute; top: 7px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); font-size: 0; }
.view { width: 100%; max-width: 1180px; padding: 4px clamp(16px, 4vw, 48px) 64px; outline: none; }

.tabbar { display: none; }

/* ---------- Notificaciones ---------- */
.notif-panel {
  position: absolute; top: 50px; right: 0; width: min(360px, calc(100vw - 32px)); max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 20px 40px -18px rgba(21, 32, 30, .35); z-index: 30;
}
.notif-panel header { padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.notif-panel ul { list-style: none; margin: 0; padding: 6px; }
.notif-panel li a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-size: .9rem; }
.notif-panel li a:hover { background: var(--surface-2); }
.notif-panel li.new a { background: var(--amber-soft); }
.notif-panel small { color: var(--ink-3); }
.notif-panel > p { padding: 16px; }

/* ---------- Cabeceras ---------- */
.page-head { padding: 12px 0 22px; max-width: 720px; }
.page-head .lede { margin-top: 10px; color: var(--ink-2); font-size: 1.06rem; max-width: 60ch; }
.page-head-explore h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.2rem); font-weight: 750; letter-spacing: -0.025em; max-width: 16ch; }
.page-head-tight { padding: 0 0 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 550; margin-bottom: 14px; }

/* ---------- Cómo funciona ---------- */
.howto { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px 56px 18px 20px; margin-bottom: 20px; }
.howto ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.howto li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; font-size: .92rem; color: var(--ink-2); }
.howto li::before { content: counter(s); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font: 700 .9rem/28px var(--display); text-align: center; }
.howto b { color: var(--ink); font-family: var(--display); font-size: 1rem; }
.howto .icon-btn { position: absolute; top: 10px; right: 10px; }

/* ---------- Búsqueda y filtros ---------- */
.searchbar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 0 20px; height: 56px; max-width: 720px; transition: border-color .15s; }
.searchbar:focus-within { border-color: var(--teal); }
.searchbar .ico { color: var(--ink-3); }
.searchbar input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1.05rem; min-width: 0; }
.toolbar { display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; }
.segmented { display: inline-flex; background: #E5E9E3; padding: 4px; border-radius: 999px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; }
.segmented button span { font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(21, 32, 30, .12); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; margin: 0 -4px; padding-left: 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 550; font-size: .9rem; color: var(--ink); }
.chip .ico { width: 16px; height: 16px; }
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-soft { background: transparent; }
.chips-cats { margin-bottom: 8px; }
.results { margin-top: 12px; }

/* ---------- Etiqueta de favor ---------- */
.grid-tags { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.grid-tags-tight { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tag {
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-l);
  border: 1px solid var(--line); color: var(--ink); text-decoration: none !important; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
a.tag:hover { border-color: var(--ink-3); box-shadow: var(--shadow); }
.tag-top {
  position: relative; display: flex; align-items: flex-end; gap: 12px; padding: 18px 18px 16px 44px;
  background: var(--sky); color: var(--sky-ink);
  border-bottom: 2px dashed color-mix(in srgb, var(--sky-ink) 30%, transparent);
}
.tag-mine .tag-top { background: var(--teal-soft); color: var(--teal); border-bottom-color: color-mix(in srgb, var(--teal) 30%, transparent); }
.tag-hole { position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px color-mix(in srgb, currentColor 35%, transparent); }
.tag-code { font: 800 2.3rem/0.85 var(--display); letter-spacing: -0.02em; }
.tag-where { display: flex; flex-direction: column; font-size: .85rem; line-height: 1.3; min-width: 0; }
.tag-where b { font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.tag-body h3 { font-size: 1.1rem; }
.tag-body p { color: var(--ink-2); font-size: .92rem; }
.tag-cat { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.tag-cat .ico { width: 16px; height: 16px; }
.tag-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; }
.who { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 550; min-width: 0; }
.tag-note { font-size: .82rem; font-weight: 600; color: var(--teal); background: var(--teal-soft); padding: 6px 10px; border-radius: 8px; align-self: flex-start; }

.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--av); color: #fff; font-family: var(--display); font-weight: 700; letter-spacing: .01em; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: .88rem; }
.rating .ico { width: 15px; height: 15px; color: var(--coin-deep); fill: var(--coin); }

/* ---------- Personas ---------- */
.grid-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.person-head { display: flex; gap: 12px; align-items: center; }
.person-head h3 a { color: var(--ink); }
.person p { color: var(--ink-2); font-size: .92rem; }
.code-inline { font-family: var(--display); color: var(--sky-ink); }
.chips-static { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-static span { font-size: .8rem; font-weight: 550; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); }
.person-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }

/* ---------- Vacíos ---------- */
.empty { text-align: center; padding: 48px 20px; max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty p { color: var(--ink-2); }
.empty .btn { margin-top: 8px; }
.empty-coin .coin { opacity: .9; }
.small-empty { padding: 24px 8px; }

/* ---------- Estados ---------- */
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.st-open { background: var(--amber-soft); color: var(--amber-ink); }
.st-agreed { background: var(--sky); color: var(--sky-ink); }
.st-done { background: var(--teal-soft); color: var(--teal); }
.st-cancel { background: #ECEEEB; color: var(--ink-3); }

/* ---------- Detalle ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 14px; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
.ticket-top { position: relative; display: flex; align-items: center; gap: 18px; padding: 24px 24px 22px 54px; background: var(--sky); color: var(--sky-ink); border-bottom: 2px dashed color-mix(in srgb, var(--sky-ink) 30%, transparent); flex-wrap: wrap; }
.ticket-top .tag-hole { left: 20px; width: 18px; height: 18px; }
.ticket-code { font: 800 clamp(3rem, 2rem + 4vw, 4.6rem)/.8 var(--display); letter-spacing: -0.03em; }
.ticket-meta { display: flex; flex-direction: column; gap: 4px; font-size: .95rem; }
.ticket-meta b { color: var(--ink); }
.ticket-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ticket-meta span.tm-place { display: block; }
.ticket-top .pill { background: var(--surface); }
.ticket-meta .ico { width: 16px; height: 16px; }
.ticket-top .pill { margin-left: auto; }
.ticket-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 12px; }
.ticket-body h1 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); }
.ticket-body .desc { color: var(--ink-2); font-size: 1.02rem; max-width: 65ch; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 6px 0 0; }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-size: .8rem; color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 600; }
.owner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); color: var(--ink); text-decoration: none !important; }
.owner > div { display: flex; flex-direction: column; }
.owner .rating { margin-left: auto; }
.owner:hover { border-color: var(--ink-3); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 80px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel-head .muted { display: inline-flex; align-items: center; gap: 6px; }
.panel-foot { border-top: 1px solid var(--line-2); padding-top: 10px; }
.panel-deal { border-color: color-mix(in srgb, var(--sky-ink) 30%, var(--line)); }
.panel-done { border-color: color-mix(in srgb, var(--teal) 35%, var(--line)); }
.deal-row { display: flex; align-items: center; gap: 12px; }
.deal-row > div:nth-child(2) { flex: 1; min-width: 0; }
.deal-amount { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .75rem; color: var(--ink-2); }
.note { display: flex; gap: 8px; font-size: .9rem; color: var(--ink-2); background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-s); }
.note .ico { width: 18px; height: 18px; color: var(--teal); margin-top: 1px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.waiting { display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: var(--surface-2); border-radius: var(--radius-m); }
.waiting p { font-size: .9rem; margin-top: 2px; }
.pulse { width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; background: var(--coin); flex: none; box-shadow: 0 0 0 0 rgba(255, 194, 58, .7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 194, 58, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 194, 58, 0); } }

.proposals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.proposal { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; display: flex; flex-direction: column; gap: 10px; animation: arrive .35s ease-out; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } }
.proposal-head { display: flex; align-items: center; gap: 12px; }
.proposal-head > div:nth-child(2) { flex: 1; min-width: 0; }
.proposal-head a { color: var(--ink); }
.quote { font-size: .92rem; color: var(--ink-2); background: var(--surface-2); padding: 10px 12px; border-radius: 4px 12px 12px 12px; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend, .field .label { font-weight: 600; font-size: .92rem; }
.field legend { margin-bottom: 6px; padding: 0; }
.field input:not([type=radio]):not([type=checkbox]), .field textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--radius-s);
  padding: 12px 14px; min-height: 48px; outline: none; transition: border-color .15s;
}
.field textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field textarea:focus { border-color: var(--teal); }
.field input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.field small { font-size: .82rem; }
.field-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.cat-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-pick input { position: absolute; opacity: 0; pointer-events: none; }
.cat-pick span { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 550; font-size: .9rem; }
.cat-pick .ico { width: 17px; height: 17px; }
.cat-pick input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.cat-pick input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--teal) 45%, transparent); outline-offset: 2px; }

.stepper { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px; align-self: flex-start; }
.stepper .icon-btn { width: 40px; height: 40px; font-size: 1.3rem; font-weight: 600; background: var(--surface); border: 1px solid var(--line); }
.stepper input { width: 64px; border: 0 !important; background: transparent !important; text-align: center; font: 700 1.3rem var(--display); padding: 0 !important; min-height: 40px !important; outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-coin .coin { --s: 26px; font-size: 0; }
.budget { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; font-size: .95rem; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 44px; height: 26px; border-radius: 999px; background: #C9D0C8; position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--teal) 45%, transparent); outline-offset: 2px; }

.compose { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 32px; align-items: start; }
.compose-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 24px; }
.compose-preview { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 10px; }
.compose-preview .tag { pointer-events: none; }

/* ---------- Mis favores ---------- */
.rows { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.row-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); color: var(--ink); text-decoration: none !important; }
.row-card:hover { border-color: var(--ink-3); }
.row-code { font: 800 1.5rem/1 var(--display); color: var(--sky-ink); background: var(--sky); border-radius: var(--radius-s); width: 72px; height: 56px; display: grid; place-items: center; flex: none; }
.row-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.row-main b { font-family: var(--display); font-weight: 650; font-size: 1.03rem; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.hl { color: var(--amber-ink); }
.progress { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.progress li { font-size: 0; width: 26px; height: 5px; border-radius: 3px; background: var(--line); }
.progress li.on { background: var(--teal); }

/* ---------- Mensajes ---------- */
.inbox { display: grid; grid-template-columns: 340px 1fr; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; height: calc(100vh - 110px); min-height: 480px; }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; padding: 18px 10px; }
.inbox-list .page-head { padding: 0 10px 12px; }
.inbox-list h1 { font-size: 1.6rem; }
.thread { display: flex; gap: 12px; align-items: center; padding: 12px 10px; border-radius: var(--radius-m); color: var(--ink); text-decoration: none !important; }
.thread:hover { background: var(--surface-2); }
.thread.on { background: var(--teal-soft); }
.thread-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thread-top { display: flex; justify-content: space-between; gap: 8px; }
.thread-favor { color: var(--sky-ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { min-width: 22px; height: 22px; border-radius: 11px; background: var(--coin); font-size: .75rem; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-3); }
.chat-empty .ico { width: 40px; height: 40px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-back { display: none; }
.chat-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-who a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-deal { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-2); }
.chat-deal .coin { --s: 34px; font-size: 14px; box-shadow: inset 0 0 0 2px var(--coin-deep); }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.bubble { max-width: min(75%, 520px); align-self: flex-start; background: var(--surface); border: 1px solid var(--line-2); padding: 10px 14px 6px; border-radius: 4px 16px 16px 16px; }
.bubble.me { align-self: flex-end; background: var(--teal); color: #fff; border-color: var(--teal); border-radius: 16px 4px 16px 16px; }
.bubble time { display: block; text-align: right; font-size: .7rem; opacity: .65; margin-top: 2px; }
.sys { align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ink-2); background: var(--amber-soft); padding: 6px 12px; border-radius: 999px; text-align: center; margin: 6px 0; max-width: 90%; }
.sys .ico { width: 14px; height: 14px; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; min-width: 0; height: 44px; border: 1.5px solid var(--line); border-radius: 999px; padding: 0 18px; outline: none; }
.chat-input input:focus { border-color: var(--teal); }

/* ---------- Cartera ---------- */
.wallet { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; background: var(--ink); color: #E9EFEC; border-radius: var(--radius-l); padding: 28px; }
.wallet-main { display: flex; align-items: center; gap: 22px; }
.wallet-main .muted { color: #A9B7B3; font-size: .95rem; }
.wallet-sub { margin-top: 4px; font-size: 1.05rem; max-width: 30ch; }
.wallet-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.wallet-stats div { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--radius-m); padding: 14px 16px; }
.wallet-stats dt { display: flex; align-items: center; gap: 6px; color: #A9B7B3; font-size: .85rem; }
.wallet-stats dt .ico { width: 16px; height: 16px; }
.wallet-stats dd { margin: 4px 0 0; font: 750 2rem/1 var(--display); color: #fff; }
.wallet-stats small { color: #8E9C98; font-size: .78rem; }
.buy { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 24px; margin-top: 18px; display: flex; flex-direction: column; gap: 18px; }
.buy-head h2 { margin-bottom: 4px; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pack {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 12px 18px;
  border: 1.5px solid var(--line); background: var(--surface-2); border-radius: var(--radius-m); cursor: pointer; font-size: .9rem;
  transition: border-color .15s, transform .1s;
}
.pack:hover { border-color: var(--teal); }
.pack:active { transform: translateY(1px); }
.pack b { font-family: var(--display); font-size: 1.05rem; margin-top: 4px; }
.pack-price { font: 750 1.5rem/1.1 var(--display); color: var(--ink); }
.pack small { color: var(--ink-3); }
.pack-tag { font-size: .75rem; font-weight: 700; color: var(--teal); background: var(--teal-soft); padding: 3px 10px; border-radius: 999px; min-height: 22px; }
.pack-tag-empty { visibility: hidden; }
.pack-best { border-color: var(--teal); background: var(--surface); box-shadow: 0 0 0 3px var(--teal-soft); }
.demo-note { margin: 0; }
.how-credits { margin-top: 28px; }
.how-credits h2, .model h2 { margin-bottom: 12px; }
.how-credits ul, .model ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.how-credits li { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; font-size: .92rem; color: var(--ink-2); }
.how-credits li b { color: var(--ink); font-family: var(--display); font-size: 1rem; }
.model { margin-top: 28px; }
.model ul { grid-template-columns: 1fr; gap: 8px; max-width: 75ch; }
.model li { color: var(--ink-2); }
.model li b { color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px 20px; }
.kpi b { font: 750 1.9rem/1.1 var(--display); }
.net { font-size: .88rem; margin-top: 4px; padding: 8px 12px; background: var(--teal-soft); border-radius: var(--radius-s); color: var(--ink); }
.tx-purchase .tx-ico { background: var(--amber-soft); color: var(--amber-ink); }
.tx-purchase .tx-amt { color: var(--teal); }
.coin-long { font-size: calc(var(--s) * .3); letter-spacing: -0.03em; }
.coin-xl.coin-long { font-size: calc(var(--s) * .3); }
.history { margin-top: 28px; }
.history h2 { margin-bottom: 10px; }
.tx-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.tx { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.tx:last-child { border-bottom: 0; }
.tx > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tx b { font-weight: 550; font-size: .95rem; }
.tx-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.tx-ico .ico { width: 18px; height: 18px; }
.tx-amt { font: 700 1.1rem var(--display); font-variant-numeric: tabular-nums; }
.tx-bonus .tx-ico, .tx-earn .tx-ico, .tx-refund .tx-ico { background: var(--teal-soft); color: var(--teal); }
.tx-bonus .tx-amt, .tx-earn .tx-amt, .tx-refund .tx-amt { color: var(--teal); }
.tx-hold .tx-ico { background: var(--amber-soft); color: var(--amber-ink); }

/* ---------- Perfil ---------- */
.profile-card { display: flex; align-items: center; gap: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 24px; flex-wrap: wrap; }
.profile-id { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.profile-id p { display: inline-flex; align-items: center; gap: 4px; }
.profile-id .ico { width: 16px; height: 16px; }
.profile-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: .92rem; color: var(--ink-2); }
.profile-stats span { display: inline-flex; align-items: center; gap: 4px; }
.profile-stats .ico { width: 16px; height: 16px; color: var(--coin-deep); fill: var(--coin); }
.profile-stats b { color: var(--ink); }
.profile-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; margin-top: 28px; }
.profile-grid h2 { margin: 0 0 10px; }
.profile-grid > div > * + h2 { margin-top: 26px; }
.profile-grid p { color: var(--ink-2); max-width: 60ch; }
.reviews { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.reviews li { display: flex; gap: 12px; }
.reviews li > div { flex: 1; }
.rv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.reviews p { color: var(--ink); font-size: .95rem; margin: 2px 0; }
.stars { display: inline-flex; gap: 1px; }
.star .ico { width: 16px; height: 16px; color: #C9D0C8; fill: #E6EAE4; }
.star.on .ico { color: var(--coin-deep); fill: var(--coin); }
.reset { margin-top: 40px; }

/* ---------- Modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 16px; }
.modal-root.open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(21, 32, 30, .5); backdrop-filter: blur(3px); animation: fade .2s; }
.modal { position: relative; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 24px; padding: 28px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .4); animation: pop .25s cubic-bezier(.2, .9, .3, 1.2); }
.modal > h2 { margin-bottom: 18px; padding-right: 36px; font-size: 1.4rem; }
.modal-sm { width: min(440px, 100%); }
.modal-sm > p { margin-bottom: 20px; }
.modal-close { position: absolute; top: 14px; right: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.onb { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.onb h2 { font-size: 1.6rem; max-width: 18ch; }
.onb > p { max-width: 38ch; margin-bottom: 8px; }
.onb .form { width: 100%; text-align: left; }
.onb-coin { margin: 6px 0 8px; }
.modal-onb .onb-coin .coin { animation: flip 1.1s cubic-bezier(.3, .7, .3, 1) .15s both; }
@keyframes flip { 0% { transform: translateY(-30px) rotateY(0); opacity: 0; } 60% { transform: translateY(4px) rotateY(540deg); opacity: 1; } 100% { transform: translateY(0) rotateY(720deg); } }
.rate-pick { display: flex; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
.rate-pick input { position: absolute; opacity: 0; }
.rate-pick span { cursor: pointer; display: grid; padding: 2px; border-radius: 8px; }
.rate-pick .ico { width: 36px; height: 36px; color: #C9D0C8; fill: #EEF1EC; transition: transform .1s; }
.rate-pick label:hover .ico, .rate-pick label:hover ~ label .ico,
.rate-pick input:checked + span .ico, .rate-pick label:has(input:checked) ~ label .ico { color: var(--coin-deep); fill: var(--coin); }
.rate-pick input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--teal) 45%, transparent); }

/* ---------- Toast ---------- */
.toast-root { position: fixed; z-index: 60; bottom: 24px; left: 50%; translate: -50% 0; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(440px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius-m); font-size: .92rem; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .4); opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; }
.toast.in { opacity: 1; transform: none; }
.toast .ico { color: var(--coin); width: 18px; height: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .detail, .compose { grid-template-columns: 1fr; }
  .panel, .compose-preview { position: static; }
  .compose-preview { order: -1; }
  .wallet { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { justify-content: space-between; padding: 10px 16px; }
  .brand-mobile { display: flex; }
  .brand-mobile .brand-mark { width: 28px; height: 28px; }
  .brand-mobile .brand-mark::after { top: 6px; left: 6px; width: 6px; height: 6px; }
  .balance-mini { display: inline-flex; }
  .view { padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--ink-3); font-size: .7rem; font-weight: 600; text-decoration: none; }
  .tabbar a.on { color: var(--ink); }
  .tabbar .ico { width: 24px; height: 24px; }
  .tabbar .nav-badge { position: absolute; top: 0; left: 55%; min-width: 18px; height: 18px; font-size: .68rem; }
  .tab-ask span { width: 52px; height: 52px; border-radius: 16px; background: var(--coin); color: var(--ink); display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--coin-deep); margin-top: -18px; }
  .howto { padding: 16px 48px 16px 16px; }
  .howto ol { grid-template-columns: 1fr; gap: 12px; }
  .grid-tags, .grid-people { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row .field:first-child { grid-column: 1 / -1; }
  .compose-form { padding: 18px; }
  .compose-preview { display: none; }
  .row-card { flex-wrap: wrap; gap: 12px; }
  .row-code { width: 56px; height: 48px; font-size: 1.2rem; }
  .row-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 150px); height: calc(100dvh - 150px); border-radius: var(--radius-m); }
  .inbox-list { border-right: 0; }
  .inbox .chat { display: none; }
  .inbox.has-active .inbox-list { display: none; }
  .inbox.has-active .chat { display: flex; }
  .chat-back { display: inline-grid; }
  .chat-head { padding: 10px 12px; gap: 10px; }
  .bubble { max-width: 85%; }
  .wallet { padding: 22px; }
  .packs { grid-template-columns: 1fr; }
  .pack { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; gap: 4px 12px; padding: 14px; }
  .pack .coin { order: -2; }
  .pack-tag { order: 5; margin: 4px 0 0 60px; }
  .pack-tag-empty { display: none; }
  .pack b { margin: 0; }
  .pack-price { margin-left: auto; font-size: 1.25rem; }
  .pack small { width: 100%; padding-left: 60px; margin-top: -4px; }
  .how-credits ul, .kpis { grid-template-columns: 1fr; }
  .buy { padding: 18px; }
  .wallet-main { gap: 16px; }
  .coin-xl { --s: 84px; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-card { padding: 20px; }
  .ticket-top { padding: 20px 20px 18px 46px; }
  .ticket-top .tag-hole { left: 16px; }
  .ticket-top .pill { margin-left: 0; }
  .ticket-body { padding: 18px 20px 20px; }
  .modal { padding: 22px; border-radius: 20px; }
  .toast-root { bottom: calc(86px + env(safe-area-inset-bottom)); }
  body[data-page="mensajes"] .view { padding-bottom: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Confirmación, incidencias y mediación ---------- */
.st-dispute { background: var(--danger-soft); color: var(--danger); }
.panel-dispute { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.timer { display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: var(--amber-soft); border-radius: var(--radius-m); }
.timer p { font-size: .92rem; margin-top: 2px; }
.countdown { font-variant-numeric: tabular-nums; }
.demo-tag { display: inline-block; margin-top: 6px; font-size: .75rem; color: var(--amber-ink); background: rgba(255, 255, 255, .6); padding: 2px 8px; border-radius: 999px; }
.panel-foot p { margin-top: 4px; }
.dispute { display: flex; flex-direction: column; gap: 10px; }
.dispute-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-m); background: var(--surface-2); border: 1px solid var(--line-2); }
.dispute-item p { font-size: .92rem; color: var(--ink-2); }
.strike { display: inline-flex; align-items: center; gap: 4px; color: var(--danger); font-weight: 600; }
.strike .ico { width: 16px; height: 16px; color: var(--danger) !important; fill: none !important; }
.suspended { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 12px; border-radius: var(--radius-s); background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: .9rem; }
.cases { display: flex; flex-direction: column; gap: 18px; }
.case { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.case-head { display: flex; align-items: center; gap: 14px; }
.case-head > div:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.evidence summary { cursor: pointer; font-weight: 600; color: var(--teal); padding: 4px 0; }
.chat-mini { max-height: 320px; border-radius: var(--radius-m); margin-top: 8px; padding: 14px; }
.resolve { border-top: 1px solid var(--line-2); padding-top: 14px; gap: 14px; }
.split-field { display: none; max-width: 280px; }
.resolve:has(input[value="split"]:checked) .split-field, .resolve.is-split .split-field { display: flex; }
@media (max-width: 820px) {
  .case-grid { grid-template-columns: 1fr; }
  .case { padding: 16px; }
}

/* ---------- Sesión, roles y superadmin ---------- */
.boot { min-height: 50vh; display: grid; place-items: center; }
.boot .coin { animation: flip 1.2s cubic-bezier(.3, .7, .3, 1) infinite; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.side-foot .me-link { margin-top: 0; }
.me-static { cursor: default; }
.me-static:hover { background: transparent !important; }
.logout { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius-s); color: #93A3A0; font-size: .9rem; font-weight: 550; }
.logout .ico { width: 18px; height: 18px; }
.logout:hover { color: #fff; background: rgba(255, 255, 255, .06); text-decoration: none; }
.logout-mini { display: none; }
.admin-badge { align-self: flex-start; font-size: .75rem; font-weight: 700; color: var(--ink); background: var(--coin); padding: 3px 10px; border-radius: 999px; margin-top: -6px; }
.impersonation { position: sticky; top: 0; z-index: 45; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; background: var(--coin); color: var(--ink); font-size: .92rem; box-shadow: inset 0 -2px 0 var(--coin-deep); }
.impersonation .btn { background: var(--ink); color: #fff; border-color: var(--ink); }
.is-impersonating .sidebar { top: 44px; height: calc(100vh - 44px); }
.is-impersonating .topbar { top: 44px; }
.tag-note-target { background: var(--amber-soft); color: var(--amber-ink); }
.onb-actions { justify-content: center; margin-top: 10px; }
.reset a { color: var(--ink-2); }

.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; max-width: none; }
.admin-search { margin-bottom: 12px; }
.admin-count { margin: 0 0 10px; }
.kpis-admin { grid-template-columns: repeat(4, 1fr); }
.kpis-admin .kpi { color: var(--ink); text-decoration: none; transition: border-color .15s; }
.kpis-admin a.kpi:hover { border-color: var(--ink-3); }
.kpi-hot { border-color: var(--danger); background: var(--danger-soft); }
.kpi-hot b { color: var(--danger); }
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-row { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(200px, 1fr) auto; grid-template-areas: "main stats actions" "badges badges actions"; gap: 8px 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; }
.admin-row-main { grid-area: main; display: flex; gap: 12px; align-items: center; min-width: 0; }
.admin-row-main > div { display: flex; flex-direction: column; min-width: 0; }
.admin-row-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-row-stats { grid-area: stats; display: flex; gap: 18px; }
.admin-row-stats span { display: flex; flex-direction: column; line-height: 1.2; }
.admin-row-stats b { font: 700 1.1rem var(--display); }
.admin-row-stats small { color: var(--ink-3); font-size: .75rem; }
.admin-row-badges { grid-area: badges; display: flex; gap: 6px; flex-wrap: wrap; }
.admin-row-badges:empty { display: none; }
.admin-row-actions { grid-area: actions; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.admin-ticket { margin-bottom: 8px; }
.tx a { color: var(--ink); }
.tx-fee .tx-ico, .tx-adjust .tx-ico { background: var(--sky); color: var(--sky-ink); }
.tx-fee .tx-amt { color: var(--teal); }
.settings { max-width: 860px; gap: 22px; }
.settings-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.field-row-3 { grid-template-columns: repeat(3, 1fr); }
.packs-editor { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pack-edit { display: flex; gap: 10px; align-items: flex-end; }
.pack-edit .field { width: 150px; }
.pack-edit .icon-btn { margin-bottom: 4px; }
.case-head h3 a { color: var(--ink); }

@media (max-width: 1080px) {
  .kpis-admin { grid-template-columns: repeat(2, 1fr); }
  .admin-row { grid-template-columns: 1fr; grid-template-areas: "main" "stats" "badges" "actions"; }
  .admin-row-actions { justify-content: flex-start; }
}
@media (max-width: 820px) {
  .logout-mini { display: inline-grid; }
  .field-row-3 { grid-template-columns: 1fr; }
  .is-impersonating .topbar { top: 0; }
  .impersonation { position: static; font-size: .85rem; }
  .tabbar a span:not(.nav-badge) { white-space: nowrap; }
}
.pack-edit + .pack-edit .field > span { display: none; }

/* Tu cuenta */
.me-button { border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; font: inherit; }
.modal-account { width: min(500px, 100%); }
.account-block { gap: 12px; padding: 18px 0; border-top: 1px solid var(--line-2); }
.account-block:first-of-type { border-top: 0; padding-top: 4px; }
.account-block h3 { font-size: 1.05rem; }
.account-block .form-actions { justify-content: flex-start; }
.settings-me { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.settings-me > div { display: flex; gap: 12px; align-items: center; }
.settings-me > div > div { display: flex; flex-direction: column; }
.profile-cta { display: flex; gap: 8px; flex-wrap: wrap; }
.account-email { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-s); }
.account-email .ico { width: 16px; height: 16px; color: var(--ink-3); }
.nav-button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-s); color: #C7D2CF; font: inherit; font-weight: 550; background: transparent; border: 0; cursor: pointer; text-align: left; width: 100%; }
.nav-button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.panel-foot-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Campo de ciudad con sugerencias */
.city-field { position: relative; }
.city-field input[data-city-input], .city-field input[readonly] { width: 100%; padding-right: 40px !important; }
.city-field::after { content: ''; position: absolute; right: 14px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--line); transition: background .2s; }
.city-field.has-coords::after { background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.city-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 16px 32px -16px rgba(21, 32, 30, .35); max-height: 280px; overflow-y: auto; }
.city-list li { display: flex; flex-direction: column; padding: 8px 10px; border-radius: var(--radius-s); cursor: pointer; line-height: 1.3; }
.city-list li span { font-size: .82rem; color: var(--ink-3); }
.city-list li:hover, .city-list li.on { background: var(--teal-soft); }
.city-list li.city-empty { cursor: default; color: var(--ink-2); font-size: .9rem; }
.city-list li.city-empty:hover { background: transparent; }
.field select { width: 100%; min-height: 48px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
/* ¿Dónde vives? */
.locate { display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--coin-deep) 30%, transparent); border-radius: var(--radius-l); padding: 20px 22px; margin-bottom: 20px; }
.locate > div { flex: 1 1 320px; }
.locate h2 { margin-bottom: 4px; }
.locate-form { display: flex; gap: 8px; flex: 1 1 320px; align-items: flex-start; }
.locate-form .city-field { flex: 1; }
.locate-form input[data-city-input] { min-height: 48px; border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 0 14px; background: var(--surface); }
.chip-count { background: var(--coin); color: var(--ink); border-radius: 999px; padding: 0 7px; font-size: .75rem; font-weight: 700; margin-left: 2px; }
.chip.on .chip-count { color: var(--ink); }
.near-note { margin: 0 0 12px; }
