/* =============================================================================
   Seguimiento de reparaciones · sattpv.net/r
   Móvil primero. Colores, radios, sombras y tipografía de la librería de la app
   (app/v4/ui, tokens --sat-*), copiados aquí para que la página no dependa de ella.
   ============================================================================= */

/* --- Tipografía: Poppins 400, 500 y 700 (latín y latín extendido) --- */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/poppins-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/poppins-400-latin-ext.woff2) format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/poppins-500-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/poppins-500-latin-ext.woff2) format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/poppins-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/poppins-700-latin-ext.woff2) format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* --- Tokens --- */
:root {
    --r-bg: #f4f5fa;
    --r-surface: #ffffff;
    --r-surface-subtle: #fafbfd;
    --r-surface-hover: #f4f5fa;
    --r-border: #e2e4ee;
    --r-border-strong: #d5d8e5;

    --r-text: #464e63;
    --r-text-strong: #1e2636;
    --r-text-muted: #5f6880;
    --r-text-subtle: #78809a;

    --r-primary: #1f82f2;
    --r-primary-hover: #1769d1;
    --r-primary-text: #1769d1;
    --r-primary-soft: #eef5ff;
    --r-primary-ring: rgb(54 153 255 / 0.28);

    --r-success: #15803d;
    --r-success-soft: #eaf8ef;
    --r-success-border: #9fdeb5;
    --r-warning: #8f5a00;
    --r-warning-solid: #ee9d01;
    --r-warning-soft: #fff7e6;
    --r-warning-border: #ffd68a;
    --r-danger: #b0202f;
    --r-danger-solid: #d92d43;
    --r-danger-soft: #feeff1;
    --r-danger-border: #fab3bd;

    --r-font: Poppins, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --r-mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

    --r-radius-sm: 8px;
    --r-radius: 12px;
    --r-radius-lg: 16px;
    --r-radius-full: 999px;

    --r-shadow-xs: 0 1px 2px rgb(30 38 54 / 0.06);
    --r-shadow-sm: 0 1px 3px rgb(30 38 54 / 0.08), 0 1px 2px rgb(30 38 54 / 0.04);
    --r-shadow-md: 0 4px 12px rgb(30 38 54 / 0.08), 0 1px 3px rgb(30 38 54 / 0.05);
    --r-shadow-lg: 0 12px 32px rgb(30 38 54 / 0.1), 0 2px 6px rgb(30 38 54 / 0.05);

    --r-gutter: 16px;
    --r-gap: 16px;
    --r-card-pad: 18px;
}

@media (min-width: 640px) {
    :root {
        --r-gutter: 24px;
        --r-gap: 20px;
        --r-card-pad: 24px;
    }
}

/* --- Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* hidden manda siempre (img, .r-btn… tienen su propio display) */
[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--r-bg);
    color: var(--r-text);
    font-family: var(--r-font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ol, ul, dl, dd, figure {
    margin: 0;
}

ol, ul {
    padding: 0;
    list-style: none;
}

a {
    color: var(--r-primary-text);
}

img {
    max-width: 100%;
    display: block;
}

button,
input {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--r-primary-ring);
    outline-offset: 2px;
}

.r-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.r-muted {
    color: var(--r-text-subtle);
}

.r-mono {
    font-family: var(--r-mono);
    font-size: 0.93em;
    letter-spacing: 0;
}

.r-icon {
    width: 1.15em;
    height: 1.15em;
    flex: none;
}

/* --- Estructura --- */
.r-wrap {
    width: 100%;
    max-width: calc(1040px + 2 * var(--r-gutter));
    margin-inline: auto;
    padding-inline: max(var(--r-gutter), env(safe-area-inset-left)) max(var(--r-gutter), env(safe-area-inset-right));
}

.r-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--r-gap);
    padding-top: var(--r-gap);
    padding-bottom: 40px;
}

.r-main--narrow {
    max-width: calc(560px + 2 * var(--r-gutter));
    justify-content: center;
}

/* Barra superior: la tienda y el cliente */
.r-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgb(255 255 255 / 0.92);
    border-bottom: 1px solid var(--r-border);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
}

.r-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 60px;
    padding-top: 8px;
    padding-bottom: 8px;
}

@media (min-width: 640px) {
    .r-topbar__inner {
        min-height: 68px;
    }
}

.r-shop {
    min-width: 0;
    display: flex;
    align-items: center;
}

.r-shop__logo {
    max-height: 40px;
    max-width: min(200px, 52vw);
    width: auto;
    object-fit: contain;
}

@media (min-width: 640px) {
    .r-shop__logo {
        max-height: 46px;
    }
}

.r-shop__name {
    overflow: hidden;
    color: var(--r-text-strong);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.r-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
    padding: 4px 4px 4px 12px;
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-full);
    background: var(--r-surface);
    color: var(--r-text-strong);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s;
}

a.r-user:hover {
    background: var(--r-surface-hover);
    border-color: var(--r-border-strong);
}

.r-user__name {
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.r-user__avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--r-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.r-topbar--brand {
    position: static;
    background: transparent;
    border-bottom: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.r-brand {
    display: inline-flex;
    color: var(--r-text-strong);
}

.r-brand .r-footer__logo {
    width: 104px;
    height: auto;
    opacity: 1;
}

/* --- Tarjetas --- */
.r-card {
    min-width: 0;
    padding: var(--r-card-pad);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-lg);
    background: var(--r-surface);
    box-shadow: var(--r-shadow-sm);
}

.r-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.r-card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--r-text-strong);
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
}

.r-card__title > .r-icon {
    color: var(--r-text-subtle);
}

.r-card__subtitle {
    margin-top: 2px;
    color: var(--r-text-muted);
    font-size: 14px;
}

.r-card__count {
    min-width: 26px;
    padding: 1px 8px;
    border-radius: var(--r-radius-full);
    background: var(--r-surface-hover);
    color: var(--r-text-muted);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.r-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--r-text-subtle);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.r-icon-box {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: var(--r-radius);
    background: var(--r-surface-hover);
    color: var(--r-text-muted);
}

.r-icon-box .r-icon {
    width: 20px;
    height: 20px;
}

.r-icon-box--lg {
    width: 48px;
    height: 48px;
}

.r-icon-box--lg .r-icon {
    width: 24px;
    height: 24px;
}

.r-icon-box--primary {
    background: var(--r-primary-soft);
    color: var(--r-primary-text);
}

.r-icon-box--warning {
    background: var(--r-warning-soft);
    color: var(--r-warning);
}

.r-icon-box--danger {
    background: var(--r-danger-soft);
    color: var(--r-danger);
}

/* --- Botones --- */
.r-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--r-radius);
    background: var(--r-surface);
    color: var(--r-text-strong);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.r-btn .r-icon {
    width: 18px;
    height: 18px;
}

.r-btn--primary {
    background: var(--r-primary);
    color: #fff;
    box-shadow: 0 1px 2px rgb(23 105 209 / 0.3);
}

.r-btn--primary:hover {
    background: var(--r-primary-hover);
}

.r-btn--danger {
    background: var(--r-danger-solid);
    color: #fff;
    box-shadow: 0 1px 2px rgb(217 45 67 / 0.3);
}

.r-btn--danger:hover {
    background: var(--r-danger);
}

.r-btn--danger:focus-visible {
    outline-color: rgb(217 45 67 / 0.35);
}

.r-btn--ghost {
    border-color: var(--r-border-strong);
    background: var(--r-surface);
}

.r-btn--ghost:hover {
    background: var(--r-surface-hover);
}

.r-btn--block {
    width: 100%;
}

.r-btn.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.r-btn[aria-busy="true"] {
    opacity: 0.75;
    pointer-events: none;
}

/* --- Insignias --- */
.r-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: none;
    height: 24px;
    padding: 0 10px;
    border-radius: var(--r-radius-full);
    background: var(--r-surface-hover);
    color: var(--r-text-muted);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.r-badge .r-icon {
    width: 14px;
    height: 14px;
}

.r-badge--success {
    background: var(--r-success-soft);
    color: var(--r-success);
}

.r-badge--warning {
    background: var(--r-warning-soft);
    color: var(--r-warning);
}

.r-badge--danger {
    background: var(--r-danger-soft);
    color: var(--r-danger);
}

/* Estado (color de la tienda: --st, --st-soft, --st-text) */
.r-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 3px 10px;
    border-radius: var(--r-radius-full);
    background: var(--st-soft);
    color: var(--st-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}

.r-status__dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--st);
}

/* --- Avisos --- */
.r-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius);
    background: var(--r-surface);
    color: var(--r-text);
    font-size: 14px;
}

.r-alert__icon {
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.r-alert__title {
    color: var(--r-text-strong);
    font-weight: 500;
}

.r-alert--success {
    border-color: var(--r-success-border);
    background: var(--r-success-soft);
}

.r-alert--success .r-alert__icon {
    color: var(--r-success);
}

.r-alert--warning {
    border-color: var(--r-warning-border);
    background: var(--r-warning-soft);
}

.r-alert--warning .r-alert__icon {
    color: var(--r-warning);
}

.r-alert--error {
    border-color: var(--r-danger-border);
    background: var(--r-danger-soft);
}

.r-alert--error .r-alert__icon {
    color: var(--r-danger);
}

/* --- Copiar un número --- */
.r-copy {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 4px 10px 4px 12px;
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-full);
    background: var(--r-surface-subtle);
    color: var(--r-text-strong);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.r-copy:hover {
    background: var(--r-surface-hover);
    border-color: var(--r-border-strong);
}

.r-copy__icon {
    display: inline-flex;
    color: var(--r-text-subtle);
}

.r-copy__icon .r-icon,
.r-copy__done .r-icon {
    width: 16px;
    height: 16px;
}

.r-copy__done {
    display: none;
    align-items: center;
    gap: 4px;
    color: var(--r-success);
    font-size: 13px;
}

.r-copy.is-copied .r-copy__icon {
    display: none;
}

.r-copy.is-copied .r-copy__done {
    display: inline-flex;
}

.r-copy--inline {
    min-height: 0;
    padding: 2px 8px;
    border-color: transparent;
    background: transparent;
    font-size: inherit;
    margin-right: -8px;
}

/* --- Estado actual (cabecera de la reparación) --- */
.r-hero {
    position: relative;
    overflow: hidden;
    padding-top: calc(var(--r-card-pad) + 4px);
    border-top: 0;
}

.r-hero::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--st);
}

.r-hero__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 14px;
}

.r-hero__status {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--st-text);
    font-size: clamp(22px, 5.6vw, 30px);
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.r-pulse {
    position: relative;
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--st);
    box-shadow: 0 0 0 5px var(--st-soft);
}

.r-pulse::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid var(--st);
    opacity: 0;
    animation: r-pulse 2.4s ease-out infinite;
}

@keyframes r-pulse {
    0% { transform: scale(0.6); opacity: 0.55; }
    100% { transform: scale(1.8); opacity: 0; }
}

.r-hero__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--r-text-muted);
    font-size: 14px;
}

.r-hero__meta .r-icon {
    width: 16px;
    height: 16px;
    color: var(--r-text-subtle);
}

.r-hero__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--r-border);
}

.r-hero__facts li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 4px 12px;
    border-radius: var(--r-radius-full);
    background: var(--r-surface-hover);
    color: var(--r-text-strong);
    font-size: 14px;
    font-weight: 500;
}

.r-hero__facts .r-icon {
    width: 17px;
    height: 17px;
    color: var(--r-text-subtle);
}

/* --- Acciones pendientes --- */
.r-pending {
    border-color: var(--r-danger-solid);
    box-shadow: 0 0 0 4px rgb(217 45 67 / 0.08), var(--r-shadow-sm);
}

.r-pending__head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.r-pending__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.r-pending__item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius);
    background: var(--r-surface-subtle);
}

.r-pending__name {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--r-text-strong);
    font-weight: 500;
}

.r-pending__name .r-icon {
    color: var(--r-text-subtle);
}

@media (min-width: 560px) {
    .r-pending__item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* --- Disposición de la reparación: principal + lateral --- */
.r-layout {
    display: grid;
    gap: var(--r-gap);
    align-items: start;
}

.r-layout__main,
.r-layout__side {
    display: flex;
    flex-direction: column;
    gap: var(--r-gap);
    min-width: 0;
}

/* Sin verificar, en el móvil el formulario va antes que el historial */
.r-layout--locked .r-layout__side {
    order: -1;
}

@media (min-width: 900px) {
    .r-layout {
        grid-template-columns: minmax(0, 1fr) 350px;
    }

    .r-layout--locked .r-layout__side {
        order: 0;
    }

    .r-layout__side {
        position: sticky;
        top: 92px;
    }
}

/* --- Historial --- */
.r-timeline {
    position: relative;
}

.r-timeline__item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 0 0 18px;
}

.r-timeline__item:last-child {
    padding-bottom: 0;
}

/* Línea que une los puntos */
.r-timeline__item::before {
    content: '';
    position: absolute;
    top: 18px;
    bottom: -2px;
    left: 7px;
    width: 2px;
    border-radius: 2px;
    background: var(--r-border);
}

.r-timeline__item:last-child::before {
    display: none;
}

.r-timeline__dot {
    position: relative;
    z-index: 1;
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 3px;
    border: 3px solid var(--r-surface);
    border-radius: 50%;
    background: var(--st);
    box-shadow: 0 0 0 1px var(--st-ring);
}

.r-timeline__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.r-timeline__name {
    color: var(--r-text-strong);
    font-weight: 500;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.r-timeline__date {
    color: var(--r-text-subtle);
    font-size: 13px;
}

.r-timeline__item.is-current .r-timeline__dot {
    box-shadow: 0 0 0 4px var(--st-soft), 0 0 0 5px var(--st-ring);
}

.r-timeline__item.is-current .r-timeline__name {
    color: var(--st-text);
    font-weight: 700;
}

.r-badge--status {
    background: var(--st-soft);
    color: var(--st-text);
}

/* Historial plegado (r.js añade is-folded si hay JavaScript): solo los últimos cambios */
.r-timeline.is-folded .is-extra {
    display: none;
}

.r-timeline.is-folded .is-fold-edge {
    padding-bottom: 0;
}

.r-timeline.is-folded .is-fold-edge::before {
    bottom: 0;
    background: linear-gradient(var(--r-border), transparent);
}

.r-timeline__toggle {
    margin-top: 16px;
    min-height: 40px;
    color: var(--r-text-muted);
    font-size: 14px;
}

@media (min-width: 640px) {
    .r-timeline__body {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
        gap: 16px;
    }

    .r-timeline__date {
        flex: none;
        text-align: right;
    }
}

/* --- Documentos --- */
.r-docs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.r-doc {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 10px;
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius);
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.r-doc:hover {
    border-color: var(--r-border-strong);
    background: var(--r-surface-subtle);
    box-shadow: var(--r-shadow-xs);
}

.r-doc .r-icon-box {
    background: var(--r-primary-soft);
    color: var(--r-primary-text);
}

.r-doc__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.r-doc__name {
    color: var(--r-text-strong);
    font-weight: 500;
    line-height: 1.35;
}

.r-doc__meta {
    color: var(--r-text-subtle);
    font-size: 13px;
}

.r-doc__go {
    display: inline-flex;
    color: var(--r-text-subtle);
}

/* En pantallas muy estrechas, la insignia baja debajo del nombre */
@media (max-width: 400px) {
    .r-doc {
        flex-wrap: wrap;
    }

    .r-doc .r-badge {
        order: 3;
        margin-left: 52px;
    }

    .r-doc__body {
        flex-basis: calc(100% - 100px);
    }
}

/* --- Imágenes --- */
.r-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
}

@media (min-width: 640px) {
    .r-gallery {
        grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
        gap: 12px;
    }
}

.r-gallery__item {
    display: block;
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius);
    background: var(--r-surface-hover);
}

.r-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.r-gallery__item:hover img {
    transform: scale(1.04);
}

/* --- Imagen ampliada (galería) --- */
html.r-lightbox-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.r-lightbox {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #0c1018;
    color: #fff;
    overflow: hidden;
    overscroll-behavior: contain;
    /* El deslizamiento lateral pasa de imagen (no «atrás» del navegador); el zoom con dos dedos sigue */
    touch-action: pan-y pinch-zoom;
}

.r-lightbox[open] {
    display: block;
    animation: r-lightbox-in 0.18s ease-out;
}

.r-lightbox::backdrop {
    background: transparent;
}

@keyframes r-lightbox-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.r-lightbox__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 68px 12px 24px;
}

.r-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 12px 40px rgb(0 0 0 / 0.45);
    user-select: none;
    -webkit-user-drag: none;
}

.r-lightbox__bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px 0 20px;
}

.r-lightbox__count {
    color: rgb(255 255 255 / 0.78);
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.r-lightbox__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: var(--r-radius-full);
    background: rgb(255 255 255 / 0.12);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.15s;
}

.r-lightbox__btn:hover {
    background: rgb(255 255 255 / 0.22);
}

.r-lightbox__btn:focus-visible {
    outline-color: rgb(255 255 255 / 0.7);
}

.r-lightbox__btn .r-icon {
    width: 22px;
    height: 22px;
}

.r-lightbox__nav {
    position: absolute;
    top: 50%;
    z-index: 1;
    margin: -22px 0 0;
    background: rgb(0 0 0 / 0.45);
}

.r-lightbox__nav:hover {
    background: rgb(0 0 0 / 0.65);
}

.r-lightbox__nav--prev {
    left: 8px;
}

.r-lightbox__nav--next {
    right: 8px;
}

@media (min-width: 640px) {
    .r-lightbox__stage {
        padding: 72px 80px 40px;
    }

    .r-lightbox__bar {
        padding: 16px 16px 0 24px;
    }

    .r-lightbox__btn {
        width: 48px;
        height: 48px;
    }

    .r-lightbox__nav {
        margin-top: -24px;
        background: rgb(255 255 255 / 0.12);
    }

    .r-lightbox__nav:hover {
        background: rgb(255 255 255 / 0.22);
    }

    .r-lightbox__nav--prev {
        left: 16px;
    }

    .r-lightbox__nav--next {
        right: 16px;
    }
}

/* --- Detalles --- */
.r-details {
    display: flex;
    flex-direction: column;
}

.r-details__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--r-border);
}

.r-details__row:first-child {
    padding-top: 0;
}

.r-details__row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.r-details dt {
    flex: none;
    max-width: 45%;
    color: var(--r-text-muted);
    font-size: 14px;
}

.r-details dd {
    min-width: 0;
    color: var(--r-text-strong);
    font-weight: 500;
    text-align: right;
    overflow-wrap: anywhere;
}

.r-details__row--long {
    flex-direction: column;
    gap: 2px;
}

.r-details__row--long dt {
    max-width: none;
}

.r-details__row--long dd {
    font-weight: 400;
    text-align: left;
}

/* --- Verificar identidad --- */
.r-verify {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.r-verify__head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.r-verify__title {
    color: var(--r-text-strong);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
}

.r-verify__text {
    color: var(--r-text-muted);
    font-size: 14px;
}

.r-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.r-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.r-label {
    color: var(--r-text-strong);
    font-size: 14px;
    font-weight: 500;
}

.r-hint {
    color: var(--r-text-subtle);
    font-size: 13px;
}

/* 16 px: el iPhone no hace zoom al escribir */
.r-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--r-border-strong);
    border-radius: var(--r-radius);
    background: var(--r-surface);
    color: var(--r-text-strong);
    font-size: 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.r-input:hover {
    border-color: #c2c6d6;
}

.r-input:focus {
    border-color: var(--r-primary);
    box-shadow: 0 0 0 3px var(--r-primary-ring);
    outline: none;
}

.r-input.is-invalid {
    border-color: var(--r-danger-solid);
}

/* --- Avisos a página completa --- */
.r-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 40px;
    padding-bottom: 40px;
    text-align: center;
}

.r-empty__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 6px;
    border-radius: 50%;
    background: var(--r-surface-hover);
    color: var(--r-text-muted);
}

.r-empty__icon .r-icon {
    width: 26px;
    height: 26px;
}

.r-empty__title {
    color: var(--r-text-strong);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.r-empty__text {
    max-width: 420px;
    margin-bottom: 10px;
    color: var(--r-text-muted);
}

/* --- Buscador --- */
.r-page-search .r-main {
    padding-top: 8px;
}

.r-search__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 680px;
    width: 100%;
    margin: 12px auto 8px;
    text-align: center;
}

@media (min-width: 640px) {
    .r-search__hero {
        margin-top: 48px;
        margin-bottom: 24px;
    }
}

.r-search__hero .r-eyebrow {
    padding: 4px 12px;
    border-radius: var(--r-radius-full);
    background: var(--r-primary-soft);
    color: var(--r-primary-text);
    letter-spacing: 0.04em;
}

.r-search__title {
    color: var(--r-text-strong);
    font-size: clamp(26px, 6.4vw, 42px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

.r-search__lead {
    max-width: 480px;
    color: var(--r-text-muted);
    font-size: 16px;
}

.r-search__form {
    width: 100%;
    margin-top: 12px;
    text-align: left;
}

.r-search__field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.r-search__icon {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 22px;
    height: 22px;
    color: var(--r-text-subtle);
    pointer-events: none;
}

.r-search__input {
    width: 100%;
    height: 58px;
    padding: 0 16px 0 52px;
    border: 1px solid var(--r-border-strong);
    border-radius: var(--r-radius-lg);
    background: var(--r-surface);
    box-shadow: var(--r-shadow-md);
    color: var(--r-text-strong);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.r-search__input::placeholder {
    color: #9aa1b5;
    font-weight: 400;
}

.r-search__input:focus {
    border-color: var(--r-primary);
    box-shadow: 0 0 0 4px var(--r-primary-ring), var(--r-shadow-md);
    outline: none;
}

.r-search__field.is-invalid .r-search__input {
    border-color: var(--r-danger-solid);
}

.r-search__btn {
    min-height: 52px;
    border-radius: var(--r-radius);
    font-size: 16px;
}

@media (min-width: 520px) {
    .r-search__field {
        display: block;
    }

    .r-search__input {
        height: 64px;
        padding-right: 150px;
        font-size: 19px;
    }

    .r-search__icon {
        top: 21px;
    }

    .r-search__btn {
        position: absolute;
        top: 8px;
        right: 8px;
        min-height: 48px;
        padding: 0 22px;
    }
}

.r-field-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    border: 1px solid var(--r-danger-border);
    border-radius: var(--r-radius);
    background: var(--r-danger-soft);
    color: var(--r-danger);
    font-size: 14px;
}

.r-field-error .r-icon {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.r-search__help {
    display: grid;
    gap: var(--r-gap);
    width: 100%;
    max-width: 880px;
    margin-inline: auto;
}

@media (min-width: 760px) {
    .r-search__help {
        grid-template-columns: 1fr 1fr;
    }
}

.r-help {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.r-help__art {
    flex: none;
    width: 112px;
    margin: -6px 0 -6px -6px;
}

.r-help__art svg {
    display: block;
    width: 100%;
    height: auto;
}

.r-help__title {
    margin-bottom: 4px;
    color: var(--r-text-strong);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
}

.r-help__text {
    color: var(--r-text-muted);
    font-size: 14px;
}

@media (max-width: 420px) {
    .r-help {
        flex-direction: column;
        gap: 10px;
    }

    .r-help__art {
        width: 132px;
        margin: -4px 0 0;
    }
}

/* --- Área de cliente --- */
.r-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding-top: 4px;
}

.r-page-head__title {
    margin-top: 4px;
    color: var(--r-text-strong);
    font-size: clamp(22px, 5vw, 28px);
    font-weight: 700;
    line-height: 1.2;
}

.r-page-head__meta {
    color: var(--r-text-muted);
    font-size: 14px;
}

.r-repairs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.r-repairs__head {
    display: none;
}

.r-repair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        'id go'
        'device go'
        'status go'
        'paid go';
    gap: 6px 12px;
    padding: 14px 14px 14px 16px;
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-lg);
    background: var(--r-surface);
    box-shadow: var(--r-shadow-xs);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.r-repair:hover {
    border-color: var(--r-border-strong);
    box-shadow: var(--r-shadow-md);
}

.r-repair__id {
    grid-area: id;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.r-repair__number {
    color: var(--r-text-strong);
    font-weight: 700;
}

.r-repair__date {
    color: var(--r-text-subtle);
    font-size: 13px;
}

.r-repair__device {
    grid-area: device;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.r-repair__model {
    color: var(--r-text-strong);
    font-weight: 500;
    overflow-wrap: anywhere;
}

.r-repair__serial {
    color: var(--r-text-subtle);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.r-repair__status {
    grid-area: status;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.r-repair__paid {
    grid-area: paid;
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 14px;
}

.r-repair__paid strong {
    color: var(--r-text-strong);
    font-weight: 500;
}

.r-repair__label {
    color: var(--r-text-subtle);
}

.r-repair__go {
    grid-area: go;
    align-self: center;
    display: inline-flex;
    color: var(--r-text-subtle);
}

@media (min-width: 900px) {
    .r-repairs {
        gap: 0;
        overflow: hidden;
        border: 1px solid var(--r-border);
        border-radius: var(--r-radius-lg);
        background: var(--r-surface);
        box-shadow: var(--r-shadow-sm);
    }

    .r-repairs__head,
    .r-repair {
        grid-template-columns: 170px minmax(0, 1.3fr) minmax(0, 1.2fr) 190px 24px;
        grid-template-areas: 'id device status paid go';
        align-items: center;
        gap: 16px;
    }

    .r-repairs__head {
        display: grid;
        padding: 12px 20px;
        border-bottom: 1px solid var(--r-border);
        background: var(--r-surface-subtle);
        color: var(--r-text-subtle);
        font-size: 12px;
        font-weight: 500;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .r-repairs > li + li:not(.r-repairs__head) .r-repair,
    .r-repairs__head + li .r-repair {
        border-top: 0;
    }

    .r-repairs > li:not(:last-child) .r-repair {
        border-bottom: 1px solid var(--r-border);
    }

    .r-repair {
        padding: 14px 20px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .r-repair:hover {
        background: var(--r-surface-subtle);
        box-shadow: none;
    }

    .r-repair__id {
        flex-direction: column;
        gap: 0;
    }

    .r-repair__status {
        margin-top: 0;
    }

    .r-repair__paid {
        flex-direction: column;
        gap: 0;
    }

    .r-repair__label {
        display: none;
    }
}

.r-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.r-pager__info {
    color: var(--r-text-muted);
    font-size: 14px;
    text-align: center;
}

@media (max-width: 420px) {
    .r-pager .r-btn {
        padding: 0 12px;
    }
}

/* --- Pie --- */
.r-footer {
    flex: none;
    padding: 8px 0 calc(28px + env(safe-area-inset-bottom));
    color: var(--r-text-subtle);
    font-size: 13px;
    text-align: center;
}

.r-footer .r-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.r-footer__legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
}

.r-footer__legal a {
    color: var(--r-text-muted);
    text-decoration: none;
}

.r-footer__legal a:hover {
    color: var(--r-text-strong);
    text-decoration: underline;
}

.r-footer__brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--r-text-subtle);
    font-size: 15px;
    text-decoration: none;
}

.r-footer__logo {
    width: 108px;
    height: auto;
    color: var(--r-text-strong);
    opacity: 0.7;
    transition: opacity 0.15s;
}

.r-footer__brand:hover .r-footer__logo {
    opacity: 1;
}

/* --- Menos movimiento --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
