/* =====================================================================
   El laboratorio del fotógrafo — estilos de toda la plataforma
   Mobile first: la base es el celular; desde 640px tablet y desde 900px computadora.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------------- */
:root {
    /* Paleta PixSell: fondos y tarjetas pedidos, acento medido de las referencias (#ABE5CF) */
    --bg: #0b0f12;
    --surface: #10161a;
    --card: #11191d;
    --surface-2: #151e22;
    --surface-3: #1c272c;
    --input: #131b21;
    --border: #1f2a30;
    --border-strong: #2d3b42;
    --text: #f2f5f4;
    --muted: #93a1a8;               /* gris azulado */
    --accent: #abe5cf;              /* verde menta (configurable por fotógrafo) */
    --accent-ink: #06130e;
    --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
    --ok: #7cc29a;
    --warn: #e2b659;
    --error: #e8806f;
    --fav: var(--accent);

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --tap: 48px;                     /* alto mínimo de todo lo que se toca */
    --appbar-h: 56px;
    --tabbar-h: 62px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    --font-display: var(--font);      /* para usar otra tipografía en títulos, definila acá */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
    --ease: cubic-bezier(.2, .8, .2, 1);

    color-scheme: dark;
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

body.no-scroll { overflow: hidden; }

img { max-width: 100%; }
a { color: var(--accent); }
button, a, input, select, textarea, label { touch-action: manipulation; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

[hidden] { display: none !important; }

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

.muted { color: var(--muted); }
.small-print { font-size: 0.85rem; text-align: center; }

@media (max-width: 899px) { .hide-mobile { display: none !important; } }

/* ---------------------------------------------------------------------
   3. Tipografía
   --------------------------------------------------------------------- */
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; }

h1 {
    font-size: clamp(1.6rem, 5.5vw, 2.3rem);
    font-weight: 750;
    margin: 0 0 0.5rem;
}

h2 {
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.005em;
    margin: 0 0 0.9rem;
}

.lead {
    color: var(--muted);
    font-size: 1.02rem;
    max-width: 62ch;
    margin: 0;
}

code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--surface-2);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

/* Número de foto al estilo del borde de la película: el único adorno de la marca */
.g-num, .pc__num, .photo-num, .mini-grid span {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgb(0 0 0 / 0.9);
}

/* ---------------------------------------------------------------------
   4. Botones
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: var(--tap);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
    user-select: none;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
@media (hover: hover) { .btn:hover { border-color: var(--muted); } }

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

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

@media (hover: hover) { .btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); border-color: transparent; } }

.btn-lg { min-height: 54px; padding: 0.8rem 1.5rem; font-size: 1.04rem; }

.btn-small { min-height: 40px; padding: 0.4rem 0.95rem; font-size: 0.92rem; }

.btn-danger {
    background: transparent;
    color: var(--error);
    border-color: color-mix(in srgb, var(--error) 45%, transparent);
}

@media (hover: hover) { .btn-danger:hover { background: color-mix(in srgb, var(--error) 12%, transparent); border-color: var(--error); } }

.link-btn {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.35rem 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.link-btn:hover, .link-btn:active { color: var(--text); }
.link-btn--danger:hover, .link-btn--danger:active { color: var(--error); }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

@media (max-width: 639px) {
    /* En el celular, las acciones principales ocupan todo el ancho: fáciles de tocar con el pulgar */
    .form > .btn,
    .actions > .btn,
    .intro .actions > .btn,
    .empty .actions > .btn { width: 100%; }
}

/* ---------------------------------------------------------------------
   5. Formularios
   --------------------------------------------------------------------- */
.form { display: grid; gap: 1.1rem; margin-top: 1.25rem; }
.form--narrow { max-width: 640px; }

.field { display: grid; gap: 0.4rem; min-width: 0; }
.field > span { font-weight: 600; font-size: 0.95rem; }
.field > span em, .field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field small { color: var(--muted); font-size: 0.86rem; }
.field small a { color: var(--muted); }
.field small a:hover { color: var(--accent); }

.field input, .field select, .field textarea,
.inline-form input, .inline-form select, .search input,
.inline-number input, .discount-row .num {
    width: 100%;
    min-height: var(--tap);
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 16px;                 /* 16px evita el zoom automático del iPhone */
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field textarea { resize: vertical; min-height: 96px; line-height: 1.45; }

.field input:focus, .field select:focus, .field textarea:focus,
.inline-form input:focus, .inline-form select:focus, .search input:focus,
.inline-number input:focus, .discount-row .num:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.field input:disabled { opacity: 0.6; }

.fieldset {
    display: grid;
    gap: 0.9rem;
    margin: 0;
    padding: 1rem 1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    min-width: 0;
}

.fieldset legend { padding: 0 0.4rem; font-weight: 650; }
.fieldset > p { margin: 0; }
legend .icon { width: 16px; height: 16px; vertical-align: -2px; }

.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.choice {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 0.35rem 0;
    cursor: pointer;
}

.choice input { flex: none; width: 20px; height: 20px; margin-top: 0.15rem; accent-color: var(--accent); }
.choice > span { display: grid; gap: 0.1rem; }
.choice small { color: var(--muted); font-size: 0.87rem; }
.choice--mp > span { min-width: 0; }

/* Aviso de ventaja dentro de una opción de pago (Mercado Pago: "¡Fotos al instante!"). Informativo, no publicitario. */
.perk {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    margin-top: 0.6rem;
    padding: 0.85rem 1rem;
    border: 1.5px solid color-mix(in srgb, var(--accent) 60%, var(--border));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    box-shadow: 0 0 22px -10px color-mix(in srgb, var(--accent) 50%, transparent);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.perk .icon { flex: none; width: 24px; height: 24px; margin-top: 0.05rem; color: var(--accent); fill: currentColor; stroke-width: 1.5; }
.perk__text {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    color: color-mix(in srgb, var(--text) 78%, var(--muted));
    font-size: 0.95rem;
    line-height: 1.45;
}
@media (min-width: 640px) { .perk__text { text-wrap: balance; } }   /* en pantallas anchas, dos líneas parejas; en el móvil, el corte natural (menos alto) */
.perk__text strong { color: var(--accent); font-size: 1.05rem; font-weight: 700; }
.choice:has(input:checked) .perk {
    border-color: var(--accent);
    box-shadow: 0 0 24px -8px color-mix(in srgb, var(--accent) 60%, transparent);
}
.indent { margin-left: 2rem; }

.slug-input, .money-input {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.slug-input:focus-within, .money-input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.slug-prefix, .money-input > span {
    display: flex;
    align-items: center;
    padding-left: 0.85rem;
    color: var(--muted);
    font-size: 0.88rem;
    white-space: nowrap;
}

.slug-prefix { max-width: 45%; overflow: hidden; text-overflow: ellipsis; direction: rtl; }
.money-input { max-width: 240px; }
.field .slug-input input, .field .money-input input, .money-input input {
    border: 0;
    box-shadow: none;
    background: transparent;
    min-width: 0;
    padding-left: 0.3rem;
    width: 100%;
    color: var(--text);
    font: inherit;
    font-size: 16px;
    min-height: var(--tap);
    outline: none;
}

.inline-number { display: flex; align-items: center; gap: 0.5rem; }
.inline-number input { width: 100px; }

.range-field > span { display: flex; justify-content: space-between; }
.range-field output { color: var(--muted); font-variant-numeric: tabular-nums; }
.range-field input[type=range] { width: 100%; min-height: 36px; accent-color: var(--accent); padding: 0; border: 0; background: none; box-shadow: none; }

.color-field input[type=color] { width: 72px; padding: 0.25rem; cursor: pointer; }

.search input { width: min(340px, 100%); }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.25rem; }
.inline-form input { flex: 1; min-width: 200px; width: auto; }
.inline-form select { width: auto; flex: 1; min-width: 160px; }

/* ---------------------------------------------------------------------
   6. Mensajes, estados y etiquetas
   --------------------------------------------------------------------- */
.alert {
    margin: 0 0 1.1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}

.alert p { margin: 0.15rem 0; }
.alert--error { background: color-mix(in srgb, var(--error) 12%, var(--bg)); border-color: color-mix(in srgb, var(--error) 40%, transparent); }
.alert--ok { background: color-mix(in srgb, var(--ok) 12%, var(--bg)); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.alert--info { background: var(--surface); }

.notice {
    display: grid;
    gap: 0.2rem;
    margin-bottom: 1.25rem;
    padding: 0.95rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
    background: color-mix(in srgb, var(--warn) 9%, var(--bg));
    color: var(--text);
    text-decoration: none;
}

.notice span { color: var(--muted); font-size: 0.93rem; }
.notice strong .icon { width: 18px; height: 18px; vertical-align: -3px; margin-right: 0.3rem; }
.notice form { margin-top: 0.5rem; }
.notice--accent { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }

.status, .order-status, .badge, .config-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}

.status, .order-status { margin-right: 0.35rem; }
.config-tag { margin-left: 0.35rem; }

.status--published, .order-status--paid, .order-status--delivered, .badge--active { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.status--private, .config-tag.is-custom { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.status--archived { opacity: 0.7; }
.order-status--payment_review { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.order-status--rejected, .order-status--cancelled, .badge--suspended, .badge--disabled { color: var(--error); border-color: color-mix(in srgb, var(--error) 40%, transparent); }
/* v2026.10.19-8: pago y entrega por separado */
.order-states { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; justify-content: flex-end; }
.order-states .order-status { margin: 0; }
.order-status--pay-paid, .order-status--dl-sent { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.order-status--pay-review, .order-status--dl-expired { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.order-status--pay-rejected, .order-status--pay-cancelled { color: var(--error); border-color: color-mix(in srgb, var(--error) 40%, transparent); }
.order-status--dl-available { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.order-status--dl-count { gap: 0.3rem; }
.order-status--dl-count .icon { flex: none; }
.app .order-status--dl-count::before, .app .order-status--dl-none::before { display: none; }
.lead .order-states { justify-content: flex-start; margin-right: 0.4rem; }
@media (max-width: 560px) { .order-side .order-states { flex-direction: column; align-items: flex-end; } }

.chip {
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.delta { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.delta--up { color: var(--ok); }
.delta--down { color: var(--error); }

/* ---------------------------------------------------------------------
   7. Páginas simples (ingreso, verificación, mis fotos)
   --------------------------------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: calc(0.8rem + var(--safe-top)) clamp(1rem, 4vw, 2.5rem) 0.8rem;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
}

/* Logo de la plataforma: imagen real (assets/img/pixsell-logo.*) o, si falta, el nombre en texto */
.brand-logo { display: block; width: auto; height: 28px; max-width: 160px; object-fit: contain; }
.brand-logo--text { height: auto; color: var(--text); font-size: 1.45rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }

/* Anillo de lente */
.brand-mark {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 5px var(--accent);
}

.env-badge {
    font-size: 0.78rem;
    color: var(--warn);
    border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    white-space: nowrap;
}

.page {
    max-width: 880px;
    margin: 0 auto;
    padding: clamp(1.5rem, 6vw, 3.5rem) clamp(1rem, 4vw, 2rem) calc(3rem + var(--safe-bottom));
}

.intro { margin-bottom: 2rem; }
.intro.narrow { max-width: 540px; }
.dev-links { margin-top: 2.5rem; font-size: 0.9rem; }

.auth { max-width: 440px; margin: 0 auto; }
.auth--wide { max-width: 640px; }
.auth-alt { margin-top: 1.5rem; color: var(--muted); text-align: center; }

.summary { margin: 0; padding-left: 0.9rem; border-left: 3px solid; font-size: 1.02rem; }
.summary--ok { border-color: var(--ok); }
.summary--warn { border-color: var(--warn); }
.summary--error { border-color: var(--error); }

.checks { list-style: none; margin: 0; padding: 0; }
.check { display: flex; gap: 0.8rem; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.check:first-child { border-top: 0; padding-top: 0; }
.check-dot { flex: none; width: 10px; height: 10px; margin-top: 0.45rem; border-radius: 50%; background: var(--muted); }
.check--ok .check-dot { background: var(--ok); }
.check--warn .check-dot { background: var(--warn); }
.check--error .check-dot { background: var(--error); }
.check-body { min-width: 0; }
.check-body strong { font-weight: 600; }
.check-body p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.93rem; overflow-wrap: anywhere; }
.check--error .check-body p { color: color-mix(in srgb, var(--error) 70%, var(--text)); }

.code {
    margin: 0;
    overflow-x: auto;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
}

.code code { background: none; padding: 0; font-size: 0.84rem; line-height: 1.6; }

/* ---------------------------------------------------------------------
   8. Panel: estructura tipo app
   --------------------------------------------------------------------- */

/* --- Celular: barra superior + barra inferior --- */
.app .shell {
    min-height: 100vh;
    padding-top: calc(var(--appbar-h) + var(--safe-top));
    padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
}

.sidebar { display: none; }

.appbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: calc(var(--appbar-h) + var(--safe-top));
    padding: var(--safe-top) 0.75rem 0 1rem;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.appbar-brand { display: grid; place-items: center; min-width: 36px; height: 36px; }
.appbar-brand .brand-logo { height: 24px; max-width: 120px; }
.brand .brand-logo { height: 30px; max-width: 170px; }
.appbar-title { flex: 1; min-width: 0; font-weight: 700; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.appbar-action {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--muted);
}

.appbar-action:active { background: var(--surface-2); color: var(--text); }

.tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    height: calc(var(--tabbar-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-top: 1px solid var(--border);
}

.tabbar-item {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.3rem 0.2rem;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.tabbar-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 56px;
    height: 30px;
    border-radius: 999px;
    transition: background-color .2s var(--ease);
}

.tabbar-icon .icon { width: 22px; height: 22px; }
.tabbar-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.tabbar-item.is-active { color: var(--text); }
.tabbar-item.is-active .tabbar-icon { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.tabbar-item:active .tabbar-icon { background: var(--surface-2); }

.tabbar-badge, .nav-badge {
    display: grid;
    place-items: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--warn);
    color: #1b1409;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
}

.tabbar-badge { position: absolute; top: -3px; right: 8px; box-shadow: 0 0 0 2px var(--surface); }

.fab {
    position: fixed;
    right: 1rem;
    bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 1rem);
    z-index: 35;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 56px;
    padding: 0 1.3rem 0 1.1rem;
    border-radius: 18px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 28px rgb(0 0 0 / 0.45);
    transition: transform .1s ease;
}

.fab:active { transform: scale(0.96); }
.fab .icon { width: 22px; height: 22px; }

.workspace {
    min-width: 0;
    padding: 1.25rem 1rem 6rem;       /* abajo deja lugar al botón flotante */
}

/* Hoja "Más" (y hojas en general) */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgb(0 0 0 / 0.55);
    animation: fade-in .2s ease;
}

.sheet {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 120;
    display: flex;
    flex-direction: column;
    max-height: 88vh;
    max-width: 560px;
    margin: 0 auto;
    padding-bottom: var(--safe-bottom);
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -16px 40px rgb(0 0 0 / 0.4);
    animation: sheet-up .28s var(--ease);
}

.sheet-grip { width: 40px; height: 4px; margin: 0.6rem auto 0.2rem; border-radius: 2px; background: var(--surface-3); }

.more-sheet { padding: 0 0.75rem calc(0.75rem + var(--safe-bottom)); }
.more-who { display: grid; padding: 0.6rem 0.75rem 0.9rem; border-bottom: 1px solid var(--border); margin-bottom: 0.4rem; }
.more-who .muted { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; }
.more-list { display: grid; }

.more-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    min-height: 54px;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--text);
    font: inherit;
    font-weight: 550;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.more-item .icon { color: var(--muted); }
.more-item:active, .more-item.is-active { background: var(--surface-2); }
.more-item.is-active .icon { color: var(--accent); }
.more-item--danger { color: var(--error); }
.more-item--danger .icon { color: var(--error); }

@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* --- Computadora: menú lateral --- */
@media (min-width: 900px) {
    .app .shell {
        display: grid;
        grid-template-columns: 248px minmax(0, 1fr);
        padding: 0;
    }

    .appbar, .tabbar, .fab, .more-sheet, [data-more-backdrop] { display: none !important; }

    .sidebar {
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        height: 100vh;
        padding: 1.25rem 0.9rem;
        background: var(--surface);
        border-right: 1px solid var(--border);
        overflow-y: auto;
    }

    .sidebar .brand { padding: 0 0.5rem; }

    .workspace {
        max-width: 1120px;
        padding: 2.5rem clamp(1.5rem, 3vw, 3rem) 4rem;
    }
}

.nav { display: flex; flex-direction: column; gap: 0.15rem; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0 0.75rem;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 550;
    text-decoration: none;
}

.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.nav-link.is-active .icon { color: var(--accent); }
.nav-badge { margin-left: auto; }
.nav-button { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; }

.sidebar-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); display: grid; gap: 0.25rem; }
.who { display: grid; gap: 0.1rem; margin: 0.25rem 0 0.25rem; padding: 0 0.75rem; font-size: 0.9rem; min-width: 0; }
.who span { color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon { flex: none; }

/* ---------------------------------------------------------------------
   9. Piezas comunes del panel
   --------------------------------------------------------------------- */
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.page-head > div { min-width: 0; }
.page-head h1 { margin-bottom: 0.35rem; overflow-wrap: anywhere; }

@media (max-width: 639px) {
    .page-head { gap: 0.9rem; margin-bottom: 1.25rem; }
    .page-head .search, .page-head .search input { width: 100%; }
}

.back-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.93rem;
    text-decoration: none;
}

.back-link::before { content: "‹"; font-size: 1.4rem; line-height: 1; margin-right: 0.35rem; }
.back-link:hover { color: var(--text); }

.panel {
    margin-bottom: 1.25rem;
    padding: 1.1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    min-width: 0;
}

@media (min-width: 640px) { .panel { padding: 1.4rem; } }
.panel > p { color: var(--muted); margin-top: 0; }
.panel > h2:last-child, .panel > p:last-child { margin-bottom: 0; }

/* Pestañas: se deslizan de costado en el celular */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin: 0 -1rem 1.5rem;
    padding: 0 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
    mask-image: linear-gradient(to right, #000 88%, transparent);
}

.tabs::-webkit-scrollbar { display: none; }

@media (min-width: 900px) {
    .tabs { margin: 0 0 1.75rem; padding: 0; -webkit-mask-image: none; mask-image: none; }
}

.tab {
    flex: none;
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 0.9rem;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }

.tab-count {
    display: inline-block;
    min-width: 1.5em;
    margin-left: 0.3rem;
    padding: 0 0.35em;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 0.76rem;
    text-align: center;
}

.segmented {
    display: inline-flex;
    max-width: 100%;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow-x: auto;
    scrollbar-width: none;
}

.segmented button, .seg-link {
    flex: none;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 1rem;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    cursor: pointer;
}

.segmented button[aria-pressed="true"], .seg-link[aria-current="page"] { background: var(--surface-3); color: var(--text); }

@media (max-width: 639px) { .page-head .segmented { width: 100%; } .page-head .seg-link { flex: 1; justify-content: center; padding: 0 0.5rem; } }

/* Indicadores */
.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--border);
    overflow: hidden;
}

@media (min-width: 900px) { .stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }

.stat { display: grid; align-content: start; gap: 0.25rem; padding: 1rem 1.1rem; background: var(--surface); min-width: 0; }
.stat-label { color: var(--muted); font-size: 0.86rem; }
.stat-value { font-size: clamp(1.35rem, 5vw, 1.8rem); font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-hint { color: var(--muted); font-size: 0.8rem; }
.stats--small .stat-value { font-size: 1.25rem; }

/* Estado vacío */
.empty {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    padding: clamp(2.5rem, 10vw, 5rem) 1.25rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.empty p { max-width: 46ch; margin: 0.25rem 0; }

.empty-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 0.75rem;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--accent);
}

/* Barras de progreso y medidores */
.progress, .meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress { margin: 0.5rem 0 1rem; }
.progress span, .meter span { display: block; width: 0; height: 100%; border-radius: 4px; background: var(--accent); transition: width .3s ease; }
.meter--warn span { background: var(--warn); }

/* Listas tipo "fila tocable" (pedidos, clientes, avisos, mis fotos, categorías) */
.order-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.order-list > li + li { border-top: 1px solid var(--border); }

.order-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 64px;
    padding: 0.85rem 1rem;
    color: var(--text);
    text-decoration: none;
}

a.order-row:active { background: var(--surface-2); }
@media (hover: hover) { a.order-row:hover { background: var(--surface-2); } }

.order-main, .order-side { display: grid; gap: 0.15rem; min-width: 0; }
.order-main strong { overflow-wrap: anywhere; }
.order-main .muted { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-side { flex: none; justify-items: end; text-align: right; }
.order-side .order-status { margin: 0; }
.order-date { font-size: 0.8rem; }
.notice-row.is-unread { box-shadow: inset 3px 0 0 var(--accent); }
.notice-row .muted { white-space: normal; }

/* Menú desplegable "Cambiar estado" */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }

.menu-body {
    position: absolute;
    right: 0;
    z-index: 60;
    width: min(330px, 88vw);
    margin-top: 0.4rem;
    padding: 0.35rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    box-shadow: 0 18px 44px rgb(0 0 0 / 0.5);
}

@media (max-width: 639px) {
    /* En el celular el menú aparece como hoja desde abajo */
    .menu-body {
        position: fixed;
        inset: auto 0 0 0;
        width: auto;
        margin: 0;
        padding: 0.5rem 0.5rem calc(0.75rem + var(--safe-bottom));
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        animation: sheet-up .25s var(--ease);
        z-index: 130;
    }
    .menu[open] > summary::after { content: ""; position: fixed; inset: 0; z-index: 125; background: rgb(0 0 0 / 0.55); }
}

.menu-item {
    display: grid;
    gap: 0.1rem;
    width: 100%;
    min-height: 56px;
    padding: 0.6rem 0.8rem;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.menu-item:hover, .menu-item:active { background: var(--surface); }
.menu-item small { color: var(--muted); font-size: 0.85rem; }

/* Secciones plegables */
.collapsible > summary, .collapsible-inline > summary { list-style: none; cursor: pointer; }
.collapsible > summary::-webkit-details-marker, .collapsible-inline > summary::-webkit-details-marker { display: none; }
.collapsible > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.collapsible > summary h2 { margin: 0; }
.collapsible > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.collapsible[open] > summary::after { content: "−"; }
.collapsible[open] > summary { margin-bottom: 1rem; }
.collapsible-inline { margin-top: 0.75rem; }
.collapsible-inline > summary { color: var(--accent); }
.collapsible-inline[open] > summary { margin-bottom: 0.5rem; }

.danger-zone { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.danger-zone p { margin-top: 0; }
.restore { margin-top: 1rem; }
.public-url { font-family: var(--mono); font-size: 0.88rem; color: var(--text) !important; overflow-wrap: anywhere; margin-bottom: 0; }
.share .public-url { margin-top: 0; }

/* ---------------------------------------------------------------------
   10. Inicio del panel
   --------------------------------------------------------------------- */
.setup { list-style: none; margin: 0; padding: 0; display: grid; }
.setup-item { display: flex; gap: 0.9rem; padding: 0.75rem 0; }
.setup-item + .setup-item { border-top: 1px solid var(--border); }
.setup-item a { color: var(--text); text-decoration: none; }
.setup-item a:hover strong { color: var(--accent); }
.setup-item p { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.92rem; }

.setup-mark {
    flex: none;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin-top: 0.05rem;
    border-radius: 50%;
    border: 2px solid var(--border);
}

.setup-mark .icon { width: 14px; height: 14px; }
.setup-item.is-done .setup-mark { border-color: var(--ok); background: var(--ok); color: var(--bg); }
.setup-item.is-done strong { color: var(--muted); font-weight: 500; }

/* ---------------------------------------------------------------------
   11. Álbumes y fotos (panel)
   --------------------------------------------------------------------- */
.album-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 0.9rem;
}

@media (min-width: 640px) { .album-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.6rem 1.25rem; } }

.album-card { display: grid; gap: 0.65rem; color: var(--text); text-decoration: none; }

.album-cover {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    overflow: hidden;
}

.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
@media (hover: hover) { .album-card:hover .album-cover img { transform: scale(1.03); } }
.album-card:active .album-cover { transform: scale(0.99); }

.album-meta { display: grid; gap: 0.15rem; justify-items: start; min-width: 0; }
.album-meta strong { font-size: 1rem; line-height: 1.25; overflow-wrap: anywhere; }
.album-meta .muted { font-size: 0.86rem; }
.album-meta .status { margin-top: 0.25rem; }

.status-help { margin: 0.35rem 0 0; font-size: 0.92rem; }
.status-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-start; }
.status-actions .btn-lg, .status-actions .menu > summary { min-height: 50px; }

@media (max-width: 639px) {
    .status-actions { width: 100%; }
    .status-actions > form { flex: 1; }
    .status-actions > form .btn { width: 100%; }
    .status-actions .menu { flex: 1; }
    .status-actions .menu > summary { width: 100%; }
}

/* Subida */
.dropzone {
    display: grid;
    justify-items: center;
    gap: 0.3rem;
    padding: 1.75rem 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.dropzone:hover, .dropzone.is-over, .dropzone:focus-within { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.dropzone:active { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.dropzone .empty-icon { margin-bottom: 0.4rem; }

.upload-summary { margin: 1rem 0 0.5rem; font-weight: 600; }
.upload-summary:empty { display: none; }
.upload-queue { list-style: none; margin: 0 0 1rem; padding: 0; max-height: 260px; overflow-y: auto; }
.upload-row { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-state { color: var(--muted); }
.upload-row.is-ok .upload-state { color: var(--ok); }
.upload-row.is-error .upload-state { color: var(--error); }
.upload-bar { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.upload-bar span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s ease; }
.upload-row.is-error .upload-bar { display: none; }

/* Cargador: tamaño máximo, progreso en dos etapas y reintento */
.uploader__config { margin-bottom: 0.9rem; }
.uploader__side { max-width: 22rem; }
.uploader__side-input { display: flex; align-items: center; gap: 0.5rem; }
.uploader__side-input input { width: 8rem; text-align: right; font-variant-numeric: tabular-nums; }
.uploader__side-input b { color: var(--muted); font-weight: 600; letter-spacing: 0.04em; }
.uploader__side-note:empty { display: none; }
.uploader__progress { margin-top: 1rem; }
.uploader__progress .upload-summary { margin-top: 0; }
.uploader__stage { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 0.6rem; font-size: 0.92rem; }
.uploader__stage b { font-variant-numeric: tabular-nums; }
.uploader__progress .progress { margin: 0.35rem 0 0.2rem; }
.uploader__note { margin: 0.75rem 0 0; font-size: 0.88rem; }
.uploader__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.upload-state .upload-retry { margin-left: 0.25rem; }
/* Con un error el nombre de la foto queda arriba y el motivo (con su botón Reintentar) debajo, siempre a la vista */
.upload-row.is-error { grid-template-columns: 1fr; }
.upload-row.is-error .upload-name { color: var(--text); font-weight: 600; }
.upload-row.is-error .upload-state { overflow-wrap: anywhere; }

/* Organizar */
.organize-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem; margin-top: 1.25rem; }
.organize-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.organize-hint { margin: 0.5rem 0 0; font-size: 0.85rem; }
@media (hover: none) { .organize-hint { display: none; } }

.save-order, .bulk-bar {
    position: sticky;
    top: calc(var(--appbar-h) + var(--safe-top) + 0.5rem);
    z-index: 15;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.35);
}

@media (min-width: 900px) { .save-order, .bulk-bar { top: 0.75rem; } }
.bulk-bar .btn-danger { margin-left: auto; }

.photo-grid {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.9rem; } }

.photo-tile { min-width: 0; }
.photo-tile[draggable="true"] { cursor: grab; }
.photo-tile.is-dragging { opacity: 0.35; }

.photo-thumb {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: var(--bg);
    overflow: hidden;
}

.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-state { padding: 0.5rem; text-align: center; color: var(--muted); font-size: 0.8rem; }
.photo-num { position: absolute; right: 0.4rem; bottom: 0.25rem; font-size: 0.72rem; }

.cover-badge {
    position: absolute;
    left: 0.35rem;
    top: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 0.68rem;
    font-weight: 800;
}

.photo-check {
    display: none;
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    z-index: 2;
    width: 24px;
    height: 24px;
    accent-color: var(--accent);
}

.is-selecting .photo-check { display: block; }
.is-selecting .photo-tile { cursor: pointer; }
.photo-tile.is-selected .photo-thumb { box-shadow: 0 0 0 3px var(--accent); }
.photo-tile.is-selected img { opacity: 0.7; }

.photo-actions { display: flex; justify-content: space-between; gap: 0.35rem; padding-top: 0.2rem; }
.photo-actions .link-btn { font-size: 0.78rem; min-height: 36px; }
@media (max-width: 639px) { .photo-actions .link-btn { font-size: 0.74rem; } }

/* ---------------------------------------------------------------------
   12. Configuración
   --------------------------------------------------------------------- */
.brand-uploads { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 640px) { .brand-uploads { grid-template-columns: minmax(160px, 220px) 1fr; } }
.brand-slot { display: grid; gap: 0.6rem; align-content: start; }
.brand-preview { display: grid; place-items: center; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
.brand-preview--logo { aspect-ratio: 1; max-width: 200px; padding: 1rem; }
.brand-preview--logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-preview--cover { aspect-ratio: 16 / 7; }
.brand-preview--cover img { width: 100%; height: 100%; object-fit: cover; }
.inline-upload { display: grid; gap: 0.3rem; justify-items: start; }
.inline-upload .btn { cursor: pointer; }

.discount-rows { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; gap: 0.5rem; }
.discount-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.discount-row .num { width: 78px; text-align: center; padding: 0.5rem; }

.example { margin: 0.5rem 0 0; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 0.92rem; }

.wm-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
.wm-layout .form { margin-top: 0; }
.wm-preview { margin: 0; display: grid; gap: 0.6rem; order: -1; }
.wm-preview img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); transition: opacity .2s ease; }
.wm-preview img.is-loading { opacity: 0.55; }
.wm-preview figcaption { font-size: 0.86rem; }

@media (max-width: 899px) {
    /* La vista previa queda a mano mientras se mueven los controles */
    .wm-preview { position: sticky; top: calc(var(--appbar-h) + var(--safe-top) + 0.5rem); z-index: 5; background: var(--bg); padding-bottom: 0.5rem; }
    .wm-preview figcaption { display: none; }
}

@media (min-width: 900px) {
    .wm-layout { grid-template-columns: minmax(280px, 380px) 1fr; gap: 2rem; }
    .wm-preview { order: 0; position: sticky; top: 1.5rem; }
}

.upcoming { background: var(--surface); }
.upcoming p { margin: 0.25rem 0 0; }

.push-state { font-weight: 600; }
.push-help { margin-top: 1rem; }
.push-help summary { cursor: pointer; color: var(--accent); min-height: 40px; display: flex; align-items: center; }
.push-help ul { margin: 0.6rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.4rem; color: var(--muted); font-size: 0.92rem; }

.device-list { list-style: none; margin: 0; padding: 0; }
.device-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 56px; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.device-list li:last-child { border-bottom: 0; }
.device-list span { display: grid; min-width: 0; }

/* ---------------------------------------------------------------------
   13. Pedidos y clientes (panel)
   --------------------------------------------------------------------- */
.order-amount { margin: 0; font-size: clamp(1.5rem, 6vw, 1.9rem); font-weight: 750; font-variant-numeric: tabular-nums; }

.order-layout { display: grid; grid-template-columns: 1fr; gap: 1.25rem; align-items: start; }
@media (min-width: 900px) { .order-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.order-layout aside p { margin: 0.3rem 0; }

.proof img { display: block; max-width: 100%; max-height: 520px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; }
.proof + .proof { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.proof--old img { max-height: 150px; opacity: 0.7; }

.review { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.review .btn-lg { width: 100%; }
@media (min-width: 640px) { .review .btn-lg { width: auto; } }
.review .reject { margin-top: 1rem; }
.review .reject summary { list-style: none; }
.review .reject summary::-webkit-details-marker { display: none; }

.send-result { margin-top: 1rem; }
.send-result textarea { width: 100%; padding: 0.75rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 0.92rem; resize: vertical; }

.mini-grid { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 4px; }
.mini-grid li { position: relative; aspect-ratio: 1; border-radius: 6px; background: var(--bg); overflow: hidden; }
.mini-grid img { width: 100%; height: 100%; object-fit: cover; }
.mini-grid span { position: absolute; left: 4px; bottom: 1px; font-size: 0.68rem; }
.mini-more { display: grid; place-items: center; color: var(--muted); font-weight: 600; }

.cart-row { display: flex; justify-content: space-between; gap: 1rem; margin: 0.2rem 0; }
/* ID de pago de Mercado Pago (una sola «palabra» larga): se parte en vez de ensanchar la página en el celular */
.mp-id { overflow-wrap: anywhere; word-break: break-all; }
.cart-row--id > span:first-child { flex: none; white-space: nowrap; }
.cart-row--id > .mp-id { min-width: 0; text-align: right; }
.cart-discount { color: var(--ok); }
.cart-total { margin-top: 0.3rem; font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   14. Estadísticas
   --------------------------------------------------------------------- */
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 0 1.25rem; }
@media (min-width: 900px) { .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.chart { display: block; width: 100%; height: auto; }
.chart-bar { fill: var(--accent); }
.chart-bar:hover { fill: color-mix(in srgb, var(--accent) 75%, white); }
.chart-axis { stroke: var(--border); stroke-width: 1; }
.chart-label { fill: var(--muted); font-size: 13px; font-family: var(--font); }

.album-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.album-stats-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; }
.album-stats-head a { color: var(--text); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.album-stats-head a:hover { color: var(--accent); }
.album-stats-facts { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; margin: 0.4rem 0 0; font-size: 0.86rem; }

.top-photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.top-photos li { display: grid; gap: 0.25rem; font-size: 0.8rem; color: var(--muted); }
.top-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }

/* ---------------------------------------------------------------------
   15. Administración
   --------------------------------------------------------------------- */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(to right, var(--surface), var(--surface)) left / 20px 100% no-repeat local,
        linear-gradient(to left, var(--surface), var(--surface)) right / 20px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, rgb(0 0 0 / .5), transparent) left / 12px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, rgb(0 0 0 / .5), transparent) right / 12px 100% no-repeat scroll,
        var(--surface);
}

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; }
.table tbody tr:last-child td { border-bottom: 0; }
.table a { color: var(--text); }
.table tr.is-muted td { opacity: 0.55; }
.table--audit td { white-space: normal; vertical-align: top; }
.audit-meta summary { color: var(--accent); cursor: pointer; }
.audit-meta pre { max-width: 420px; max-height: 260px; margin: 0.4rem 0 0; padding: 0.6rem; overflow: auto; border-radius: var(--radius-sm); background: var(--bg); font-size: 0.76rem; white-space: pre-wrap; }

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

/* =====================================================================
   Paquete 12 — textos legales y avisos de cumplimiento
   ===================================================================== */

.legal { max-width: 74ch; margin: 0 auto; }
.legal h1 { margin-bottom: 0.75rem; }
.legal h2 { margin: 2.25rem 0 0.75rem; font-size: 1.25rem; scroll-margin-top: 5rem; }
.legal h3 { margin: 1.4rem 0 0.4rem; font-size: 1rem; color: var(--muted); font-weight: 650; }
.legal p, .legal li { line-height: 1.65; }
.legal ul { padding-left: 1.25rem; display: grid; gap: 0.4rem; }
.legal-meta { color: var(--muted); font-size: 0.9rem; }
.legal-legend { margin: 1.25rem 0 0; padding: 0.9rem 1rem; border-left: 3px solid var(--border); background: var(--surface); font-size: 0.86rem; line-height: 1.55; }
.form .legal-legend { margin: 0.25rem 0 0; font-size: 0.78rem; }

.toc { display: grid; gap: 0.1rem; margin: 1.25rem 0 0.5rem; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.toc a { display: flex; align-items: center; min-height: 40px; color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.toc a:hover, .toc a:active { color: var(--accent); }
@media (min-width: 720px) { .toc { grid-template-columns: 1fr 1fr; column-gap: 1.5rem; } }

/* Lo pendiente de completar o de revisar con un abogado */
mark.todo { padding: 0.05em 0.3em; border-radius: 4px; background: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text); }
mark.todo--review { background: color-mix(in srgb, var(--warn) 18%, transparent); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--warn) 60%, transparent); }

.consent { padding: 0.6rem 0; }
.consent a { color: var(--accent); }
.seller { margin: 0.75rem 0 0; font-size: 0.86rem; overflow-wrap: anywhere; }

.page-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.5rem; padding: 1.5rem 1rem calc(1.5rem + var(--safe-bottom)); border-top: 1px solid var(--border); font-size: 0.9rem; }
.page-foot a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); text-decoration: none; }
.page-foot a:hover { color: var(--accent); }

.pub-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.15rem 1.25rem; }
.pub-legal a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); font-size: 0.9rem; }
.pub-legal a:hover { color: var(--accent); }

/* =====================================================================
   Paquete 13 — ficha de cliente, respaldos y pedido de enlace nuevo
   ===================================================================== */

.stat-value--text { font-size: 1.15rem; padding-top: 0.25rem; }

/* Lista dentro de un panel: sin marco propio */
.order-list--flat { border: 0; border-radius: 0; background: none; margin: 0 -0.25rem; }
.order-list--flat .order-row { padding-left: 0.25rem; padding-right: 0.25rem; }

.plain-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; }
.plain-list li { line-height: 1.55; }

.backup-row { flex-wrap: wrap; }
.backup-actions { display: flex; align-items: center; gap: 0.75rem; }
.backup-actions .btn-small { margin-top: 0; }

.inline-form-note { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; margin: 0.9rem 0 0; }
.inline-form-note .btn-small { margin-top: 0; }

/* =====================================================================
   Paquete 14 — vista previa de la portada (Configuración)
   ===================================================================== */
.hero-preview__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.75rem; }
.hero-preview__bar h2 { margin: 0; }
.view-toggle { display: inline-flex; padding: 3px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--card); }
.view-toggle button { min-height: 40px; padding: 0 0.9rem; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-size: 0.9rem; cursor: pointer; }
.view-toggle button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.hero-preview__stage { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.hero-preview__frame { display: block; border: 0; transform-origin: top left; background: var(--bg); }
.hero-preview__note { margin: 0.6rem 0 0; font-size: 0.86rem; }

/* =====================================================================
   Paquete 15 — configuración de la plataforma (super administrador)
   ===================================================================== */
.logo-preview { display: grid; gap: 0.75rem; margin: 0.9rem 0; }
@media (min-width: 640px) { .logo-preview { grid-template-columns: 1fr 1fr; } }
.logo-preview__box { display: grid; place-items: center; min-height: 96px; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); }
.logo-preview__box--dark { background: var(--bg); }
.logo-preview__box--light { background: #f4f6f5; }
.logo-preview__box--light:empty { display: none; }
.logo-preview__box img { display: block; max-width: 100%; max-height: 64px; width: auto; height: auto; object-fit: contain; }
.icon-preview { display: flex; align-items: center; gap: 1rem; margin: 0.9rem 0; }
.icon-preview__big { border-radius: 14px; background: var(--surface-2); }
.icon-preview__small { border-radius: 7px; }
.icon-preview__tiny { border-radius: 4px; }
.form > .actions { margin-bottom: 1.25rem; }
.grid-2 + .field { margin-top: 1rem; }

/* Elegir estudio (usuarios con más de un fotógrafo): fila que es un botón */
.order-row--button { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.order-row--button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Nota corta al comienzo de una pantalla de configuración */
.intro-note { margin: 0 0 1rem; }

/* Categorías del fotógrafo: las subcategorías van sangradas y las filas con formularios se ajustan en pantallas angostas */
.cat-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 0; }
.cat-row { flex-wrap: wrap; row-gap: 0.5rem; }
.cat-sub { margin-left: 1.25rem; }
.cat-row .inline-form input[type="text"] { min-width: 0; }

/* ---------------------------------------------------------------------
   Espacio del plan: tarjeta de la pestaña Fotos y widget del menú (StorageUsage + storage-meter.js)
   El estado lo decide el servidor (data-state); acá solo los colores. Siempre va con porcentaje y leyenda, no solo color.
   --------------------------------------------------------------------- */
[data-storage-meter] { --storage-color: #59c9af; }
[data-storage-meter][data-state="moderate"] { --storage-color: #ebaf50; }
[data-storage-meter][data-state="warning"]  { --storage-color: #f26c6c; }
[data-storage-meter][data-state="critical"] { --storage-color: #e5484d; }
[data-storage-meter][data-state="full"]     { --storage-color: #d9353e; }
[data-storage-meter][data-state="unlimited"], [data-storage-meter][data-state="none"] { --storage-color: var(--muted); }

.storage-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
    contain: layout paint;
}
.storage-bar--card { height: 10px; }
.storage-bar span {
    display: block;
    height: 100%;
    width: var(--storage-fill);                       /* sin JavaScript: el valor final, directo */
    border-radius: inherit;
    background: var(--storage-color);
    transition: background-color .4s ease;
}
.js .storage-bar span { width: var(--storage-anim, 0%); }   /* con JavaScript: arranca vacía y se llena (storage-meter.js) */

.storage-status { display: flex; align-items: flex-start; gap: 0.45rem; margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
.storage-dot { flex: none; width: 8px; height: 8px; margin-top: 0.4em; border-radius: 50%; background: var(--storage-color); transition: background-color .4s ease; }

.storage-card {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding: 1rem 1.1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 0;
}
.storage-card__head { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.storage-card__head h3 { margin: 0; font-size: 1rem; font-weight: 650; flex: 1; min-width: 0; }
.storage-card__icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-3); color: var(--storage-color); transition: color .4s ease; }
.storage-card__pct { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--storage-color); transition: color .4s ease; white-space: nowrap; }
.storage-card__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0; }
.storage-card__facts div { min-width: 0; }
.storage-card__facts dt { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.02em; }
.storage-card__facts dd { margin: 0.1rem 0 0; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.storage-mini {
    display: grid;
    gap: 0.45rem;
    margin: 0 0 0.5rem;
    padding: 0.75rem 0.8rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.86rem;
    min-width: 0;
}
.storage-mini__top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.storage-mini__title { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; color: var(--text); font-weight: 600; white-space: nowrap; }
.storage-mini__title .icon { color: var(--storage-color); transition: color .4s ease; }
.storage-mini__top b { font-variant-numeric: tabular-nums; color: var(--storage-color); transition: color .4s ease; }
.storage-mini__summary { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }
.storage-status--mini { font-size: 0.8rem; }
.storage-mini__link { justify-self: start; font-size: 0.82rem; font-weight: 600; text-decoration: none; }
.storage-mini__link:hover { text-decoration: underline; }

.more-storage { padding: 0.25rem 0.25rem 0.5rem; }
.more-storage .storage-mini { margin: 0; }
.more-sheet { overflow-y: auto; overscroll-behavior: contain; }   /* con el widget, en teléfonos bajos la hoja se puede desplazar */

@media (max-width: 639px) {
    .storage-card { padding: 0.9rem; }
    .storage-card__pct { font-size: 1.2rem; }
    .storage-card__facts dd { font-size: 0.92rem; }
}

@media (prefers-reduced-motion: reduce) {
    .storage-bar span, .storage-dot, .storage-card__icon, .storage-card__pct, .storage-mini__title .icon, .storage-mini__top b { transition: none; }
}

/* Texto explicativo del tamaño máximo, con ícono informativo */
.uploader__side-help { display: flex; align-items: flex-start; gap: 0.45rem; margin: 0.45rem 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.uploader__side-help-icon { flex: none; display: inline-flex; margin-top: 0.1rem; color: var(--muted); opacity: 0.85; }
.uploader__side { max-width: 34rem; }

/* Estimación al elegir fotos (antes y durante el procesamiento) */
.uploader__estimate { margin: 0.75rem 0 0; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 0.9rem; }
.uploader__estimate p { margin: 0; }
.uploader__estimate p + p { margin-top: 0.3rem; }
.uploader__estimate-warn { color: #f26c6c; font-weight: 600; }

/* Aviso del sello antes de subir fotos (v2026.10.21-7) */
.stamp-upload-note { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: 12px; line-height: 1.45; }
.stamp-upload-note p { margin: 0; }
.stamp-upload-note p + p { margin-top: .5rem; }
.stamp-upload-note--on { background: color-mix(in srgb, var(--ok) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.stamp-upload-note--off { background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent); }
.stamp-upload-note a:not(.btn) { font-weight: 600; }
