/*
 * Área de clientes · estilos propuestos (reemplazan public/assets/portal.css y dejan de cargar workspace.css).
 * Puntos de quiebre: 760px (navegación arriba) y 1024px (dos columnas).
 * Los tokens --brand-* los imprime el layout por empresa (PortalTheme). Los valores de abajo son los
 * de una empresa sin color elegido.
 * --safe-top / --safe-bottom usan env(); el prototipo los pisa para simular el iPhone.
 */
:root {
  color-scheme: light;
  --bg: #F4F5F6;
  --surface: #FFFFFF;
  --surface-2: #F8F9FA;
  --line: #E1E4E8;
  --line-strong: #8C95A0;
  --ink: #171A1F;
  --ink-2: #3D444D;
  --muted: #5B636D;

  --ok: #1B6B3A; --ok-bg: #E6F4EB; --ok-line: #BADFC7;
  --wait: #774900; --wait-bg: #FFF1D4; --wait-line: #EED39A;
  --bad: #B42318; --bad-bg: #FDECEA; --bad-line: #F3C0BA;
  --info: #1D4F8A; --info-bg: #E8F0FA; --info-line: #C3D6EE;
  --neutral-bg: #EDEFF2;

  --brand: #2B3138; --brand-fill: #2B3138; --on-brand-fill: #FFFFFF; --brand-fill-hover: #1B2025;
  --brand-fill-border: #2B3138; --brand-strong: #2B3138; --brand-strong-hover: #14181C;
  --brand-soft: #EEF0F2; --brand-soft-border: #D2D7DD; --stripe: #2B3138; --focus: #2B3138;

  --radius: 12px; --radius-s: 10px;
  --header-h: 60px; --nav-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-pop: 0 18px 40px rgba(17, 20, 24, .16), 0 2px 6px rgba(17, 20, 24, .06);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--safe-top) + 16px);
  scroll-padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; color: var(--ink); text-wrap: balance; }
h1 { font-size: 1.5rem; letter-spacing: -.012em; }
h2 { font-size: 1.1875rem; letter-spacing: -.005em; }
h3 { font-size: 1rem; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img { max-width: 100%; }
button { font: inherit; }
a { color: var(--brand-strong); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-strong-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1[tabindex="-1"]:focus { outline: none; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.only-desktop, .only-wide { display: none !important; }
.prose { max-width: 68ch; }
.preserve { white-space: pre-line; }
.muted { color: var(--muted); }
.i { flex: none; display: block; }

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 200;
  background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: 8px;
  box-shadow: var(--shadow-pop); font-weight: 600;
}
.skip:focus { top: calc(var(--safe-top) + 8px); }

/* ---------- Barra del personal ("Ver como") y modo consulta ---------- */
.staff-bar {
  background: #1E2227; color: #FFFFFF; font-size: .875rem;
  padding: calc(8px + var(--safe-top)) 16px 8px;
  display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; justify-content: center; text-align: center;
}
.staff-bar a { color: #FFFFFF; font-weight: 700; }
.staff-bar a:focus-visible { outline-color: #FFFFFF; }
.staff-bar + .app-header { padding-top: 0; }

/* ---------- Encabezado ---------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: var(--safe-top);
}
.app-header::before { content: ""; display: block; height: 4px; background: var(--stripe); }
.header-inner {
  max-width: 1180px; margin: 0 auto; height: var(--header-h);
  display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto;
  color: var(--ink); text-decoration: none; padding: 4px 0; border-radius: 8px;
}
.brand:hover { color: var(--ink); }
.brand-logo { display: block; width: auto; height: auto; max-height: 32px; max-width: 140px; object-fit: contain; }
.brand-logo.is-square { max-height: 38px; max-width: 46px; border-radius: 8px; }
.brand-mono {
  flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-fill); color: var(--on-brand-fill); box-shadow: inset 0 0 0 1px var(--brand-fill-border);
  font-weight: 700; font-size: .9375rem; letter-spacing: .02em;
}
.brand-text { display: grid; min-width: 0; line-height: 1.2; }
.brand-name {
  font-weight: 700; font-size: .9375rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.brand-sub { font-size: .8125rem; color: var(--muted); display: none; }
.brand-divider { display: none; }

.header-actions { display: flex; align-items: center; gap: 2px; position: relative; }
.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 10px; border: 0; background: transparent;
  color: var(--ink-2); display: grid; place-items: center; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn[aria-expanded="true"] { background: var(--brand-soft); color: var(--brand-strong); }
.icon-btn .nav-icon { width: 21px; height: 21px; }
.count {
  position: absolute; top: 5px; right: 3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--bad); color: #FFFFFF; font-size: .6875rem; font-weight: 700; line-height: 19px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.account-btn {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; border: 0; background: transparent;
  border-radius: 10px; cursor: pointer; color: var(--ink);
}
.account-btn:hover { background: var(--surface-2); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; font-size: .8125rem;
  box-shadow: inset 0 0 0 1px var(--brand-soft-border);
}
.avatar-photo { object-fit: cover; }
.account-name { display: none; font-weight: 600; font-size: .9375rem; }

/* ---------- Navegación: una sola <nav>. Abajo en celular, en el encabezado desde 760px ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.nav ul { list-style: none; display: flex; max-width: 560px; margin: 0 auto; }
.nav li { flex: 1; min-width: 0; }
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--nav-h); color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 600;
  border-radius: 0;
}
.nav a .pill { width: 56px; height: 30px; border-radius: 15px; display: grid; place-items: center; }
.nav a .pill .nav-icon { width: 22px; height: 22px; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--brand-strong); }
.nav a[aria-current="page"] .pill { background: var(--brand-soft); }
.nav a:focus-visible { outline-offset: -4px; border-radius: 12px; }
body.has-nav { padding-bottom: calc(var(--nav-h) + var(--safe-bottom)); }
.nav.hide-mobile { display: none; }

/* ---------- Contenido ---------- */
.main { max-width: 1180px; margin: 0 auto; padding: 16px 16px 40px; display: grid; gap: 20px; }
.main:focus { outline: none; }
.stack { display: grid; gap: 16px; min-width: 0; }
.stack-l { display: grid; gap: 28px; min-width: 0; }

.back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; width: max-content;
  margin: -6px 0 -8px -8px; padding: 0 10px 0 4px;
  color: var(--ink-2); font-weight: 600; text-decoration: none; border-radius: 10px;
}
.back:hover { color: var(--ink); background: var(--surface); }
.crumbs { display: none; }

.page-head { display: grid; gap: 8px; min-width: 0; }
.page-head h1 { overflow-wrap: anywhere; }
.home-head-copy { display: grid; gap: 8px; min-width: 0; }
.home-request { justify-self: start; }
.home-request .nav-icon { width: 20px; height: 20px; flex: none; }
.eyebrow { font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: .9375rem; }
.meta > span { display: inline-flex; align-items: center; gap: 6px; }
.head-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.section { display: grid; gap: 12px; min-width: 0; }
.visit-more:not([hidden]) { display: grid; gap: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.section-head h2 .n { color: var(--muted); font-weight: 600; }
.more { font-weight: 600; font-size: .9375rem; min-height: 44px; display: inline-flex; align-items: center; gap: 2px; text-decoration: none; padding: 0 4px; }
.more:hover { text-decoration: underline; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; min-width: 0; }
.card > h2 + *, .card > .card-head + * { margin-top: 12px; }
.card.stack > h2 + *, .card.stack > .card-head + *, .card.form > * + * { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-flush { padding: 0; overflow: hidden; }
.card > h2 ~ .table-wrap { margin-top: 12px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 4px 0; }

/* Dos columnas en escritorio: principal + lateral */
.layout { display: grid; gap: 20px; min-width: 0; }
.layout > * { min-width: 0; }

/* ---------- Listas ---------- */
.list { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 14px 12px 14px 14px; min-height: 68px; color: inherit; text-decoration: none; position: relative;
}
a.row:hover, button.row:hover { background: var(--surface-2); color: inherit; }
a.row:focus-visible, button.row:focus-visible { outline-offset: -3px; border-radius: calc(var(--radius) - 2px); }
button.row { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.row-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--neutral-bg); color: var(--ink-2); }
.row-ico.k-quote { background: #EEF2FF; color: #3730A3; }
.row-ico.k-report { background: #E9F6F1; color: #1F6B50; }
.row-ico.k-invoice { background: #FBF0E6; color: #8A4A12; }
.row-main { display: grid; gap: 3px; min-width: 0; }
.row-title { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; line-height: 1.35; }
.row-meta { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.row-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.row-cols { display: none; }
.row-navigate { grid-template-columns: minmax(0, 1fr); padding-right: 62px; }
.row-navigate.row-with-icon { grid-template-columns: auto minmax(0, 1fr); }
.row-navigate::after, .workshop-row-main::after {
  content: ""; position: absolute; top: 50%; right: 19px; width: 19px; height: 19px;
  border-top: 3px solid var(--line-strong); border-right: 3px solid var(--line-strong);
  transform: translateY(-50%) rotate(45deg); pointer-events: none;
}
.row-navigate:hover::after, .workshop-row-main:hover::after { border-color: var(--muted); }

/* Equipos: seguimientos abiertos y registro general */
.workshop-section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 18px; }
.workshop-section-head p, .inventory-head p { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.workshop-count { flex: none; padding: 5px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); font-size: .8125rem; font-weight: 700; }
.workshop-row { position: relative; }
.workshop-row-main { position: relative; display: grid; gap: 9px; padding: 15px 62px 15px 18px; color: var(--ink); text-decoration: none; }
.workshop-row-main:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.workshop-row-main:focus-visible { outline-offset: -3px; }
.workshop-row-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; }
.workshop-reference, .workshop-step { color: var(--muted); font-size: .8125rem; }
.workshop-row-details { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; color: var(--ink-2); font-size: .875rem; }
.workshop-row-details .chip { font-size: .75rem; }
.workshop-row-quote { padding: 0 18px 14px; }
.workshop-row-quote a { display: inline-flex; align-items: center; min-height: 36px; font-size: .875rem; font-weight: 650; }
.inventory-head { display: grid; gap: 2px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pagination-page { margin-right: auto; color: var(--muted); font-size: .875rem; }
.pagination a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-size: .875rem; font-weight: 650; text-decoration: none; }
.pagination a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }

/* ---------- Estados ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; width: max-content; max-width: 100%;
  padding: 3px 10px 3px 7px; border-radius: 999px; font-size: .8125rem; font-weight: 650; line-height: 1.4;
  background: var(--neutral-bg); color: var(--ink-2); white-space: nowrap;
}
.chip .i { width: 14px; height: 14px; }
.chip.t-wait { background: var(--wait-bg); color: var(--wait); }
.chip.t-ok { background: var(--ok-bg); color: var(--ok); }
.chip.t-bad { background: var(--bad-bg); color: var(--bad); }
.chip.t-info { background: var(--info-bg); color: var(--info); }
.chip.t-muted { background: #F1F2F4; color: var(--muted); }
.chip.t-brand { background: var(--brand-soft); color: var(--brand-strong); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--radius-s);
  border: 1px solid var(--brand-fill-border); background: var(--brand-fill); color: var(--on-brand-fill);
  font: 650 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--brand-fill-hover); color: var(--on-brand-fill); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--ink); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--brand-strong); padding: 0 10px; }
.btn-quiet:hover { background: var(--brand-soft); color: var(--brand-strong-hover); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--line-strong); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-ink { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.btn-ink:hover { background: #000000; color: #FFFFFF; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .9375rem; }
.btn[disabled], .btn[aria-disabled="true"] { background: #E6E8EB; color: #4F5761; border-color: #E6E8EB; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"] .i { display: none; }
.btn[aria-busy="true"]::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row > .btn { flex: 1 1 auto; }

/* ---------- Avisos ---------- */
.notice {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start;
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--info-line); background: var(--info-bg); color: var(--ink);
}
.notice > .i { color: var(--info); margin-top: 1px; }
.notice strong { display: block; }
.notice p + p { margin-top: 4px; }
.notice .notice-body { display: grid; gap: 4px; min-width: 0; }
.notice .notice-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.notice.success { background: var(--ok-bg); border-color: var(--ok-line); }
.notice.success > .i { color: var(--ok); }
.notice.warning { background: var(--wait-bg); border-color: var(--wait-line); }
.quote-expired-notice { display: block; overflow-wrap: anywhere; }
.quote-expired-notice .quote-contact { display: block; margin-top: 8px; font-size: .875rem; }
.notice.warning > .i { color: var(--wait); }
.notice.error { background: var(--bad-bg); border-color: var(--bad-line); }
.notice.error > .i { color: var(--bad); }
.notice.plain { background: var(--surface); border-color: var(--line); }
.notice.plain > .i { color: var(--ink-2); }
.notice a { color: inherit; font-weight: 650; }
.site-banner { border-bottom: 1px solid var(--info-line); background: var(--info-bg); }
.site-banner .notice { max-width: 1180px; margin: 0 auto; border: 0; border-radius: 0; background: transparent; padding: 12px 16px; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; min-width: 0; }
.label { font-weight: 650; font-size: .9375rem; color: var(--ink); }
.label .opt { font-weight: 400; color: var(--muted); }
.help { font-size: .875rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--radius-s);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 400 1rem/1.4 var(--font); /* 16px: iOS no hace zoom al enfocar */
}
.textarea { min-height: 132px; resize: vertical; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%233D444D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input:focus, .select:focus, .textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--brand-strong); }
.input[readonly] { background: var(--surface-2); color: var(--ink-2); border-style: dashed; }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.err { display: flex; align-items: flex-start; gap: 6px; color: var(--bad); font-size: .9375rem; font-weight: 650; }
.err .i { margin-top: 2px; }
.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 2px; top: 2px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink-2); border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label {
  display: grid; gap: 2px; min-height: 56px; align-content: center; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); cursor: pointer; font-weight: 650;
}
.seg label small { font-weight: 400; color: var(--muted); font-size: .8125rem; }
.seg input:checked + label { border: 2px solid var(--brand-strong); padding: 9px 13px; background: var(--brand-soft); color: var(--ink); }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; min-height: 44px; padding: 10px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--brand-strong); }
.check span { display: grid; gap: 2px; }
.check small { color: var(--muted); font-size: .875rem; }
.checks > .check + .check { border-top: 1px solid var(--line); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 32px; border-radius: 16px; background: #8C95A0; position: relative; cursor: pointer; margin: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked { background: var(--brand-strong); }
.switch input:checked::after { transform: translateX(20px); }
fieldset[disabled] .check { opacity: .55; cursor: not-allowed; }

/* Fotos */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--neutral-bg); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(17, 20, 24, .74); color: #FFFFFF; display: grid; place-items: center; cursor: pointer; }
.thumb.has-error { outline: 2px solid var(--bad); outline-offset: -2px; }
.thumb.has-error::after { content: "No se pudo usar"; position: absolute; left: 0; right: 0; bottom: 0; background: var(--bad); color: #FFFFFF; font-size: .75rem; font-weight: 700; padding: 3px 6px; }
.add-photo {
  aspect-ratio: 1; border: 1.5px dashed var(--line-strong); border-radius: 10px; background: var(--surface);
  display: grid; place-items: center; align-content: center; gap: 4px; color: var(--brand-strong); font-weight: 650; font-size: .875rem; cursor: pointer; text-align: center; padding: 6px;
}
.add-photo:hover { background: var(--brand-soft); }
.add-photo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.add-photo:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.progress { display: grid; gap: 6px; }
.progress-bar { height: 8px; border-radius: 4px; background: var(--neutral-bg); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--brand-strong); border-radius: 4px; }

/* Pedir atención */
.request-head { max-width: 68ch; }
.request-head p { color: var(--ink-2); }
.card.request-editor { gap: 0; padding: 0; }
.request-section { display: grid; gap: 16px; padding: 22px 18px; min-width: 0; }
.request-section + .request-section { border-top: 1px solid var(--line); }
.request-section-head { display: flex; align-items: flex-start; gap: 12px; }
.request-section-head > div { display: grid; gap: 4px; min-width: 0; }
.request-section-head h2 { font-size: 1.125rem; }
.request-section-head p { color: var(--muted); font-size: .875rem; }
.request-step { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-strong); font-size: .875rem; font-weight: 750; }
.request-fields { display: grid; gap: 16px; }
.request-selected { gap: 3px; border-color: var(--brand-soft-border); background: var(--brand-soft); }
.request-selected strong { font-size: 1.0625rem; }
.request-change { width: max-content; min-height: 44px; display: inline-flex; align-items: center; font-weight: 650; }
.request-site { display: grid; gap: 5px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2); }
.request-priority label { gap: 2px; }
.request-priority label small { font-size: .8125rem; }
.request-upload { position: relative; display: grid; justify-items: center; gap: 4px; padding: 24px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); text-align: center; cursor: pointer; }
.request-upload:hover, .request-upload.is-dragging { border-color: var(--brand-strong); background: var(--brand-soft); }
.request-upload:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.request-upload-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 5px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong); }
.request-upload strong { color: var(--ink); }
.request-upload > span:last-child { color: var(--muted); font-size: .875rem; }
.request-file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.request-photo-status:empty, .request-thumbs:empty, .request-actions [data-upload-status]:empty { display: none; }
.request-photo-status { color: var(--ink-2); font-size: .875rem; }
.request-photo-status.is-error { color: var(--bad); font-weight: 650; }
.request-actions { margin: 0; }
.request-actions .btn { width: 100%; }
.request-guide { display: grid; gap: 18px; align-content: start; }
.request-guide h2 { margin: 0; }
.request-guide ol { display: grid; gap: 18px; margin: 12px 0 0; padding: 0; list-style: none; }
.request-guide li { display: flex; gap: 12px; align-items: flex-start; }
.request-guide li > span { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; font-size: .875rem; }
.request-guide li p { padding-top: 2px; color: var(--ink-2); font-size: .9375rem; }

/* Perfil del área de clientes */
.portal-profile-layout { display: grid; gap: 20px; min-width: 0; align-items: start; }
.portal-profile-layout > * { min-width: 0; }
.profile-section-head { display: grid; gap: 5px; }
.profile-section-head p, .portal-profile-data > p { color: var(--muted); font-size: .9375rem; }
.portal-profile-photo-row { display: grid; gap: 18px; align-items: center; }
.portal-profile-preview { width: 104px; height: 104px; overflow: hidden; border-radius: 50%; background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand-soft-border); }
.portal-profile-preview img { width: 100%; height: 100%; object-fit: cover; }
.portal-profile-preview span { display: grid; place-items: center; width: 100%; height: 100%; color: var(--brand-strong); font-size: 1.875rem; font-weight: 750; }
.portal-profile-upload { display: grid; gap: 8px; min-width: 0; }
.portal-profile-upload .request-upload { padding: 16px; }
.profile-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-password-form { max-width: 520px; }
.profile-password-actions { display: flex; justify-content: flex-start; }
.portal-profile-data { align-content: start; }
.portal-profile-data > p { border-top: 1px solid var(--line); padding-top: 14px; }
@media (min-width: 900px) {
  .portal-profile-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
  .portal-profile-photo { grid-column: 1; grid-row: 1; }
  .portal-profile-password { grid-column: 2; grid-row: 1 / span 2; }
  .portal-profile-data { grid-column: 1; grid-row: 2; }
}

/* Barra de acción fija (formularios en celular) */
.action-bar {
  position: sticky; bottom: 0; z-index: 30; display: grid; gap: 10px;
  margin: 8px -16px -40px; padding: 12px 16px calc(12px + var(--safe-bottom));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 20px rgba(17, 20, 24, .06);
}
body.keyboard-open .action-bar { position: static; box-shadow: none; }

/* ---------- Diálogo (hoja inferior en celular) ---------- */
dialog.sheet {
  border: 0; padding: 0; color: var(--ink); background: var(--surface);
  width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 18px 18px 0 0;
  overflow: auto; overscroll-behavior: contain; box-shadow: var(--shadow-pop);
}
dialog.sheet::backdrop { background: rgba(17, 20, 24, .52); }
dialog.sheet[open] { animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 16px 0 20px; }
.sheet-head h2 { padding-top: 8px; }
.sheet-body { display: grid; gap: 16px; padding: 12px 20px 0; }
.sheet-actions { display: grid; gap: 8px; padding: 20px 20px calc(20px + var(--safe-bottom)); }
.summary-box { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--radius-s); background: var(--surface-2); border: 1px solid var(--line); }

/* ---------- Menús flotantes (cuenta, novedades) ---------- */
.pop {
  position: absolute; right: 4px; top: calc(100% + 6px); z-index: 60;
  width: min(360px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-pop); padding: 8px;
}
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 10px; }
.pop-who { display: grid; gap: 2px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.pop-who small { color: var(--muted); overflow-wrap: anywhere; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border-radius: 8px;
  border: 0; background: transparent; color: var(--ink); text-decoration: none; text-align: left; cursor: pointer; font-weight: 550;
}
.menu-item:hover { background: var(--surface-2); color: var(--ink); }
.pop-foot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }

/* ---------- Novedades ---------- */
.notif { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 14px; }
.notif .row-ico { width: 36px; height: 36px; }
.notif-title { font-weight: 550; }
.notif.unread .notif-title { font-weight: 750; }
.notif-time { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.pop .notif-empty { padding: 10px; color: var(--muted); }
.pop-notif-foot { display: flex; justify-content: flex-end; margin-top: 6px; padding: 6px 2px 0; border-top: 1px solid var(--line); }
.pop-notif-all { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px; border-radius: 8px; color: var(--ink-2); font-size: .875rem; font-weight: 600; text-decoration: none; }
.pop-notif-all:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-strong); margin-top: 6px; }
.day { font-size: .8125rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 2px 0; }

/* ---------- Piezas de detalle ---------- */
.facts { margin: 0; display: grid; }
.facts > div { display: grid; grid-template-columns: minmax(104px, 38%) minmax(0, 1fr); gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.money { display: grid; gap: 6px; font-variant-numeric: tabular-nums; }
.money-row { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.money-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); font-weight: 700; }
.money-total strong { font-size: 1.5rem; letter-spacing: -.01em; }
.big-amount { font-size: 1.75rem; font-weight: 750; letter-spacing: -.015em; font-variant-numeric: tabular-nums; line-height: 1.15; }

.lines { list-style: none; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; padding-top: 4px; }
.line-name { font-weight: 600; overflow-wrap: anywhere; }
.line-detail { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.line-amount { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: .8125rem; font-weight: 700; color: var(--muted); padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table .r { text-align: right; white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }

.file { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.file-ico { width: 40px; height: 48px; border-radius: 6px; background: #FBEAEA; color: #A3261C; display: grid; place-items: center; font-size: .6875rem; font-weight: 800; letter-spacing: .03em; }
.file-ico.k-xml { background: #EDEFF2; color: var(--ink-2); }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-meta { font-size: .875rem; color: var(--muted); }
.file-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.document-actions { display: grid; gap: 8px; padding-top: 4px; }
.document-actions .btn { width: 100%; }
.document-actions .nav-icon, .invoice-file-actions .nav-icon { width: 20px; height: 20px; flex: none; }
.card.invoice-detail { padding: 0; overflow: hidden; }
.invoice-main { padding: 24px 20px 28px; }
.invoice-status-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.invoice-kicker { color: var(--muted); font-size: .875rem; font-weight: 600; }
.invoice-amount { display: grid; gap: 4px; padding: 32px 0 30px; }
.invoice-amount > span { color: var(--ink-2); font-size: .9375rem; font-weight: 600; }
.invoice-amount strong { font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 750; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.invoice-amount p { margin-top: 4px; color: var(--muted); font-size: .9375rem; }
.invoice-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding-top: 22px; border-top: 1px solid var(--line); }
.invoice-dates > div { display: grid; gap: 3px; min-width: 0; }
.invoice-dates dt { color: var(--muted); font-size: .875rem; }
.invoice-dates dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.invoice-files { min-width: 0; padding: 24px 20px 28px; border-top: 1px solid var(--line); }
.invoice-files h2 { margin-bottom: 18px; }
.invoice-file { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 12px; align-items: center; min-width: 0; }
.invoice-file + .invoice-file { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.invoice-file-name { display: grid; gap: 2px; min-width: 0; }
.invoice-file-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.invoice-file-actions .btn { flex: 1 1 auto; }

.date-tile { flex: none; width: 52px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-align: center; background: var(--surface); }
.date-tile .m { display: block; padding: 2px 0; background: var(--brand-soft); color: var(--brand-strong); font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.date-tile .d { display: block; padding: 2px 0 4px; font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; }

.steps { list-style: none; display: grid; }
.step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 18px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step .dot-step { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #A9B0B8; background: var(--surface); display: grid; place-items: center; color: #FFFFFF; position: relative; z-index: 1; }
.step.done .dot-step { background: var(--brand-strong); border-color: var(--brand-strong); }
.step.done::before { background: var(--brand-strong); }
.step.current .dot-step { border-color: var(--brand-strong); box-shadow: 0 0 0 4px var(--brand-soft); }
.step.current .dot-step::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-strong); }
.step.alt .dot-step { background: var(--ink-2); border-color: var(--ink-2); }
.step-label { font-weight: 550; color: var(--ink-2); padding-top: 2px; }
.step.current .step-label { font-weight: 750; color: var(--ink); }
.step small { display: block; color: var(--muted); font-size: .875rem; }

.segbar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.segbar span { height: 6px; border-radius: 3px; background: var(--neutral-bg); }
.segbar span.on { background: var(--brand-strong); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo-btn { padding: 0; border: 0; background: var(--neutral-bg); border-radius: 10px; overflow: hidden; aspect-ratio: 1; cursor: zoom-in; display: block; }
.photo-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Visor de fotos ---------- */
.viewer { position: fixed; inset: 0; z-index: 120; background: #0C0E11; color: #FFFFFF; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(6px + var(--safe-top)) 6px 6px 16px; }
.viewer-top h2 { color: #FFFFFF; font-size: 1rem; }
.viewer .icon-btn { color: #FFFFFF; }
.viewer .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #FFFFFF; }
.viewer :focus-visible { outline-color: #FFFFFF; }
.viewer-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 8px; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #FFFFFF; display: grid; place-items: center; cursor: pointer; }
.viewer-nav.prev { left: 10px; } .viewer-nav.next { right: 10px; }
.viewer-nav[disabled] { opacity: .3; cursor: default; }
.viewer-bottom { display: grid; gap: 10px; justify-items: center; padding: 10px 16px calc(14px + var(--safe-bottom)); }
.viewer-strip { display: flex; gap: 8px; }
.viewer-strip button { width: 52px; height: 52px; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: #22262B; opacity: .7; cursor: pointer; }
.viewer-strip button[aria-current="true"] { border-color: #FFFFFF; opacity: 1; }
.viewer-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer a { color: #FFFFFF; }
.viewer-msg { display: grid; gap: 12px; justify-items: center; text-align: center; color: #E6E8EB; max-width: 30ch; }

/* ---------- Vacíos, carga ---------- */
.empty { display: grid; justify-items: start; gap: 10px; padding: 22px 18px; background: var(--surface); border: 1px dashed #C4CAD1; border-radius: var(--radius); }
.empty-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--neutral-bg); color: var(--ink-2); display: grid; place-items: center; }
.empty h3 { font-size: 1.0625rem; }
.empty p { color: var(--ink-2); max-width: 60ch; }
.calm { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.calm .i { color: var(--ok); }
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, #E9ECEF 0, #F4F5F7 45%, #E9ECEF 90%); background-size: 300% 100%; animation: sk 1.3s ease-in-out infinite; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }

.filters { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.list-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filter-field { display: grid; gap: 5px; min-width: 0; color: var(--ink-2); font-size: .875rem; font-weight: 650; }
.filter-search, .filter-actions { grid-column: 1 / -1; }
.filter-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
@media (min-width: 900px) {
  .list-filters { grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(155px, 1fr)) auto; align-items: end; }
  .filter-search, .filter-actions { grid-column: auto; }
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-weight: 650; font-size: .9375rem; cursor: pointer;
}
.filter .n { color: var(--muted); font-weight: 600; }
.filter[aria-pressed="true"] { border: 2px solid var(--brand-strong); padding: 0 15px; background: var(--brand-soft); color: var(--ink); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.pager .info { color: var(--muted); font-size: .875rem; text-align: center; }

.attn { display: grid; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--wait-line); }
.attn-title { font-weight: 700; font-size: 1.0625rem; line-height: 1.35; overflow-wrap: anywhere; }

.hello { display: grid; gap: 14px; }
.hello p { color: var(--ink-2); }

.cards { display: grid; gap: 12px; }
.visit { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; }
.visits-list > li.more-visit { display: none; }
.visits-list.expanded > li.more-visit { display: block; }
.visit-main { display: grid; gap: 3px; min-width: 0; }
.visit-when { font-weight: 700; }

/* ---------- Ingreso, invitación y recuperación ---------- */
body.auth { display: flex; flex-direction: column; min-height: 100dvh; }
.auth-stripe { height: 4px; background: var(--stripe); margin-top: var(--safe-top); flex: none; }
.auth-layout { flex: 1; display: grid; align-content: start; }
.auth-layout > *, .auth-panel > * { min-width: 0; }
.auth-content { min-width: 0; display: flex; flex-direction: column; }
.auth-brand { display: grid; padding: 28px 20px 4px; justify-items: center; text-align: center; }
.auth-brand .brand { display: grid; justify-items: center; gap: 14px; margin: 0; padding: 0; }
.auth-brand .brand-logo { max-height: 64px; max-width: 220px; }
.auth-brand .brand-logo.is-square { max-height: 80px; max-width: 80px; border-radius: 16px; }
.auth-brand .brand-mono { width: 80px; height: 80px; border-radius: 20px; font-size: 1.75rem; }
.auth-brand .brand-name { font-size: 1.375rem; line-height: 1.15; font-weight: 750; }
.auth-brand .brand-sub { display: block; margin-top: 6px; font-size: .875rem; }
.auth-main { flex: 1; padding: 16px 16px 32px; display: grid; justify-items: center; row-gap: 16px; }
.auth-main > .notice { width: 100%; max-width: 440px; }
.auth-main > .notice.error { grid-template-columns: minmax(0, 1fr); gap: 6px; line-height: 1.45; }
.auth-main > .notice.error ul { list-style: none; padding: 0; }
.auth-main > .notice.error li + li { margin-top: 4px; }
.auth-panel { width: 100%; max-width: 440px; display: grid; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px 20px; }
.auth-panel h1 { font-size: 1.5rem; }
.auth-panel > p, .auth-intro { color: var(--ink-2); }
.auth-alt { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 6px; color: var(--ink-2); font-size: .9375rem; }
.auth-foot { width: 100%; max-width: 440px; margin-inline: auto; padding: 0 16px calc(20px + var(--safe-bottom)); display: grid; justify-items: center; gap: 5px; text-align: center; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.auth-foot-owner { color: var(--ink-2); font-weight: 600; }
.auth-foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.auth-foot-links > span { white-space: nowrap; }
.auth-foot a { color: var(--muted); text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }
.auth-foot-links > span a { color: var(--ink-2); font-weight: 600; }
.big-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); }
.big-ico.t-wait { background: var(--wait-bg); color: var(--wait); }
.big-ico.t-ok { background: var(--ok-bg); color: var(--ok); }
.big-ico.t-neutral { background: var(--neutral-bg); color: var(--ink-2); }
.remember { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.remember-brand { display: flex; align-items: center; gap: 12px; }

/* ---------- Pie ---------- */
.footer {
  max-width: 1180px; margin: 0 auto; padding: 8px 16px 28px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 16px;
  color: var(--muted); font-size: .8125rem; text-align: center;
}
.footer a { color: var(--muted); }
.made-with { white-space: nowrap; }

/* ---------- Escritorio y tableta ---------- */
@media (min-width: 760px) {
  .portal-profile-photo-row { grid-template-columns: 104px minmax(0, 1fr); }
  .home-head, .requests-head { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 24px; }
  .home-head-copy { grid-column: 1; grid-row: 1; }
  .home-request { grid-column: 2; grid-row: 1; justify-self: end; }
  .home-welcome { grid-column: 1 / -1; }
  :root { --header-h: 68px; }
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.25rem; }
  .only-mobile { display: none !important; }
  .only-desktop { display: revert !important; }
  .header-inner { gap: 20px; padding: 0 20px 0 24px; }
  .brand { margin-right: 8px; }
  .brand-logo { max-height: 40px; max-width: 180px; }
  .brand-name { font-size: 1rem; -webkit-line-clamp: 1; }
  .brand-sub { display: block; }
  .brand-divider { display: block; width: 1px; height: 28px; background: var(--line); }
  .brand > .brand-sub { white-space: nowrap; }
  .account-name { display: inline; }
  .header-actions { margin-left: auto; gap: 6px; }

  .nav, .nav.hide-mobile { display: block; position: static; padding: 0; border: 0; background: none; align-self: stretch; }
  .nav ul { max-width: none; height: 100%; gap: 2px; }
  .nav li { flex: none; }
  .nav a { flex-direction: row; gap: 8px; height: 100%; padding: 0 12px; font-size: .9375rem; color: var(--ink-2); border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
  .nav a .pill { width: auto; height: auto; background: none !important; }
  .nav a .pill .nav-icon { width: 20px; height: 20px; }
  .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand-strong); }
  .nav a[aria-current="page"] .nav-icon { color: var(--brand-strong); }
  .nav a:focus-visible { outline-offset: -6px; }
  body.has-nav { padding-bottom: 0; }

  .main { padding: 28px 24px 56px; gap: 24px; }
  .card { padding: 22px 24px; }
  .back { display: none; }
  .crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: .9375rem; }
  .crumbs a { color: var(--ink-2); text-decoration: none; font-weight: 550; }
  .crumbs a:hover { text-decoration: underline; color: var(--ink); }
  .crumbs .i { width: 16px; height: 16px; }

  .row { padding: 14px 18px; }
  .row-cols { display: contents; }
  .list-cols .row { grid-template-columns: auto minmax(0, 1fr) 180px 150px auto; }
  .list-cols .row-col { color: var(--ink-2); font-size: .9375rem; overflow-wrap: anywhere; }
  .list-cols .hide-desk { display: none; }
  .list-head.only-desktop { display: grid !important; grid-template-columns: 40px minmax(0, 1fr) 180px 150px 20px; gap: 12px; padding: 10px 18px; background: var(--surface-2); font-size: .8125rem; font-weight: 700; color: var(--muted); }

  .action-bar { position: static; margin: 4px 0 0; padding: 0; border: 0; box-shadow: none; background: none; display: flex; justify-content: flex-start; }
  .request-section { padding: 26px 28px; }
  .request-actions { margin: 0; padding: 24px 28px; border-top: 1px solid var(--line); justify-content: flex-end; }
  .request-actions [data-upload-status]:not(:empty) { margin-right: auto; }
  .request-actions .btn { width: auto; }

  dialog.sheet { width: min(540px, calc(100% - 48px)); margin: auto; border-radius: 18px; }
  .sheet-head { padding: 24px 20px 0 28px; }
  .sheet-body { padding: 12px 28px 0; }
  .sheet-actions { padding: 24px 28px 28px; grid-auto-flow: column; justify-content: end; }

  .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
  .visits-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; background: none; border: 0; border-radius: 0; overflow: visible; }
  .visits-list > li, .visits-list > li + li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .visits-list .visit { padding: 16px; }
  .filters { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; }
  .hello { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .file-actions { grid-template-columns: auto auto; justify-content: start; }
  .invoice-main { padding: 32px; }
  .invoice-files { padding: 32px; }
  .attn { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .attn > .chip { grid-column: 1 / -1; }
  .attn > .btn { grid-column: 2; grid-row: 2; }

  .auth-layout { grid-template-columns: minmax(0, 1fr); align-content: center; padding: 40px 24px; }
  .auth-panel { padding: 32px; }
  .auth-brand { padding: 0 0 20px; }
  .auth-main { padding: 0; }
}
@media (min-width: 1024px) {
  .main { padding: 32px 32px 64px; }
  .layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
  .invoice-detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
  .invoice-files { border-top: 0; border-left: 1px solid var(--line); background: var(--surface-2); }
  .layout > .aside { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: calc(var(--header-h) + 28px); }
  .layout > .main-col { grid-column: 1; }
  .layout-narrow { max-width: 760px; }
  .only-wide { display: revert !important; }
  .auth-layout.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 0; align-content: stretch; }
  .split .auth-brand { justify-items: start; text-align: left; align-content: center; padding: 48px clamp(40px, 6vw, 96px); background: var(--brand-soft); border-right: 1px solid var(--brand-soft-border); }
  .split .auth-brand .brand { justify-items: start; }
  .split .auth-brand .brand-logo { max-height: 90px; max-width: 280px; }
  .split .auth-brand .brand-logo.is-square { max-height: 112px; max-width: 112px; }
  .split .auth-brand .brand-mono { width: 104px; height: 104px; font-size: 2rem; border-radius: 24px; }
  .split .auth-brand .brand-name { font-size: 1.75rem; }
  .split .auth-main { align-content: center; padding: 48px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .btn, .chip, .filter, .nav a[aria-current="page"] { border: 1px solid CanvasText; }
}
@media print {
  .app-header, .nav, .footer, .staff-bar, .action-bar { display: none !important; }
  body { background: #FFFFFF; }
}
