/* ═══════════════════════════════════════════════════════════════════════════
   BeerTour · Sistema de diseño global
   Paleta cálida cervecera: ámbar (malta tostada), espuma (fondos crema),
   lúpulo (verde éxito) y madera oscura (sidebar). Móvil primero en lo crítico.
   Las páginas usan ESTAS clases (ver docs/UI_KIT.md y docs/DESIGN_BRIEF.md).
   ═══════════════════════════════════════════════════════════════════════════ */

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

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

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }

/* ── Tokens ────────────────────────────────────────────────────────────── */
:root {
    /* Superficies y texto */
    --color-bg: #f7f1e6;              /* espuma: crema cálido de fondo */
    --color-surface: #fffdf8;         /* tarjetas y paneles */
    --color-surface-2: #f2e9d8;       /* superficie alterna (cabeceras de tabla, hover) */
    --color-text: #33261a;            /* marrón malta oscuro, alto contraste */
    --color-muted: #82715c;           /* texto secundario */
    --color-border: #e6dac4;

    /* Marca: ámbar tostado */
    --color-primary: #b45309;
    --color-primary-strong: #8f4107;  /* hover/active */
    --color-primary-soft: #fbeed7;    /* fondos suaves de acento */
    --color-primary-contrast: #ffffff;

    /* Semántica */
    --color-success: #4d7c0f;         /* verde lúpulo */
    --color-success-soft: #eef5e0;
    --color-warning: #a16207;         /* dorado tostado */
    --color-warning-soft: #fdf3d8;
    --color-danger: #b3261e;
    --color-danger-soft: #fcebe9;
    --color-info: #34698f;
    --color-info-soft: #eaf2f8;

    /* Sidebar (madera oscura) */
    --sidebar-bg: #2a1e12;
    --sidebar-text: #d9c9ac;
    --sidebar-active: #ffc45e;

    /* Geometría y sombras */
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 3px rgba(58, 40, 18, 0.08), 0 1px 2px rgba(58, 40, 18, 0.05);
    --shadow-md: 0 6px 18px rgba(58, 40, 18, 0.12), 0 2px 6px rgba(58, 40, 18, 0.07);

    /* Espaciado */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2.5rem;

    /* Tipografía: stack de sistema, sin dependencias externas */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", ui-sans-serif,
                 Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

    --focus-ring: 0 0 0 3px rgba(180, 83, 9, 0.28);
}

::selection { background: var(--color-primary-soft); color: var(--color-text); }

h1, h2, h3 { letter-spacing: -0.015em; line-height: 1.25; }
h1 { font-size: 1.55rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Scrollbars discretos (WebKit) */
::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb { background: #d5c5a6; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ── Layout de la app: .page = sidebar + main ──────────────────────────── */
.page {
    display: flex;
    min-height: 100vh;
}

.content {
    flex: 1;
    min-width: 0; /* imprescindible para que las tablas hagan scroll-x y no rompan el layout */
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-5) var(--space-6);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}

.page-header h1 { display: flex; align-items: center; gap: var(--space-2); }

.page-header .subtitle,
.page-header p { color: var(--color-muted); font-size: 0.92rem; }

/* ── Sidebar / navegación (marcado en NavMenu.razor) ───────────────────── */
.sidebar {
    width: 236px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: var(--space-4) var(--space-3);
    z-index: 60;
}

.sidebar__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: 0 var(--space-2) var(--space-4);
}

.sidebar__brand {
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #f6ead3;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    white-space: nowrap;
}
.sidebar__brand:hover { text-decoration: none; color: var(--sidebar-active); }

.sidebar__toggle {
    display: none; /* solo visible en móvil */
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.4rem;
    line-height: 1;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.sidebar__toggle:hover { background: rgba(255, 255, 255, 0.08); }
.sidebar__toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0.6rem var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.sidebar__link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #f6ead3;
    text-decoration: none;
    transform: translateX(2px);
}
.sidebar__link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sidebar__link.active {
    background: rgba(255, 196, 94, 0.14);
    color: var(--sidebar-active);
    font-weight: 700;
}

.sidebar__icon {
    width: 1.5rem;
    text-align: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.sidebar__foot {
    margin-top: auto;
    padding: var(--space-3) var(--space-2) 0;
    font-size: 0.75rem;
    color: rgba(217, 201, 172, 0.55);
}

/* ── Botones ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1.05rem;
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease,
                box-shadow 0.15s ease, transform 0.12s ease, color 0.15s ease;
}
.btn:hover { background: var(--color-surface-2); box-shadow: var(--shadow-sm); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn--primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-primary-contrast);
}
.btn--primary:hover { background: var(--color-primary-strong); border-color: var(--color-primary-strong); }

.btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--color-primary);
}
.btn--ghost:hover { background: var(--color-primary-soft); box-shadow: none; }

.btn--danger {
    background: var(--color-danger);
    border-color: var(--color-danger);
    color: #fff;
}
.btn--danger:hover { background: #8f1d17; border-color: #8f1d17; }

.btn--sm { padding: 0.32rem 0.7rem; font-size: 0.8rem; border-radius: 8px; }
.btn--block { display: flex; width: 100%; }

/* ── Tarjetas ──────────────────────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.18s ease;
}
.card:hover { box-shadow: var(--shadow-md); }

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.card__title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card__body { padding: var(--space-5); }

/* ── Rejilla responsive ────────────────────────────────────────────────── */
.grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1080px) {
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ── Tablas (siempre dentro de .table-wrap para scroll-x en móvil) ─────── */
.table-wrap {
    overflow-x: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.table th {
    position: sticky; /* cabecera pegajosa dentro del wrap */
    top: 0;
    z-index: 1;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
    background: var(--color-surface-2);
    padding: 0.7rem var(--space-4);
    white-space: nowrap;
}

.table td {
    padding: 0.7rem var(--space-4);
    border-top: 1px solid var(--color-border);
    vertical-align: middle;
}

.table tbody tr { transition: background 0.12s ease; }
.table tbody tr:hover { background: rgba(180, 83, 9, 0.05); }

.table .num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Badges / píldoras de estado ───────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: var(--color-primary-soft);
    color: var(--color-primary-strong);
    white-space: nowrap;
}
.badge--success { background: var(--color-success-soft); color: var(--color-success); }
.badge--warning { background: var(--color-warning-soft); color: var(--color-warning); }
.badge--danger  { background: var(--color-danger-soft);  color: var(--color-danger); }
.badge--muted   { background: var(--color-surface-2);    color: var(--color-muted); }

/* ── Semáforo de recetas (FeasibilityStatus) ───────────────────────────── */
.semaphore {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}
.semaphore::before {
    content: "";
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
.semaphore--ready   { background: var(--color-success-soft); color: var(--color-success); } /* verde: se puede */
.semaphore--almost  { background: var(--color-warning-soft); color: var(--color-warning); } /* amarillo: falta poco */
.semaphore--missing { background: var(--color-danger-soft);  color: var(--color-danger); }  /* rojo: faltan cosas */

/* ── Formularios ───────────────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: var(--space-4);
}

.form-label { font-size: 0.85rem; font-weight: 600; color: var(--color-text); }

.input, .select, .textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: #b3a48c; }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
}

.select { appearance: auto; cursor: pointer; }
.textarea { min-height: 5.5rem; resize: vertical; }

.checkbox {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Soporte de validación de Blazor */
.input.invalid, .select.invalid, .textarea.invalid,
.input.modified.invalid { border-color: var(--color-danger); }
.validation-message { color: var(--color-danger); font-size: 0.8rem; }

/* ── Stat / KPI ────────────────────────────────────────────────────────── */
.stat {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat__value {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.stat__label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
}

.stat__icon {
    position: absolute;
    top: var(--space-3);
    right: var(--space-4);
    font-size: 1.6rem;
    opacity: 0.85;
}

/* ── Alertas in-line ───────────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid;
    font-size: 0.9rem;
    line-height: 1.45;
}
.alert::before { flex-shrink: 0; font-size: 1.05rem; line-height: 1.35; }

.alert--info    { background: var(--color-info-soft);    border-color: #cadeed; color: #2b5573; }
.alert--info::before    { content: "ℹ️"; }
.alert--warning { background: var(--color-warning-soft); border-color: #eeddab; color: #77510c; }
.alert--warning::before { content: "⚠️"; }
.alert--danger  { background: var(--color-danger-soft);  border-color: #f1c7c2; color: #8f2019; }
.alert--danger::before  { content: "⛔"; }

/* ── Stepper del wizard (7 fases del lote) ─────────────────────────────── */
.stepper {
    display: flex;
    align-items: flex-start;
    padding: var(--space-4) 0;
}

.step {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.45rem;
}

/* Conector: línea que llega desde el paso anterior hasta el centro de este */
.step:not(:first-child)::before {
    content: "";
    position: absolute;
    top: calc(1.15rem - 1.5px); /* centro vertical del punto (2.3rem de alto) */
    right: 50%;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: var(--color-border);
    z-index: 0;
}
/* El conector se "enciende" para pasos completados y para el actual */
.step--done:not(:first-child)::before,
.step--current:not(:first-child)::before { background: var(--color-primary); }

.step__dot {
    position: relative;
    z-index: 1;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    color: var(--color-muted);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.step__label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--color-muted);
    line-height: 1.3;
    padding: 0 0.2rem;
}

.step--done .step__dot {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
}
.step--done .step__label { color: var(--color-success); }

.step--current .step__dot {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-primary-contrast);
    box-shadow: 0 0 0 5px rgba(180, 83, 9, 0.18);
    animation: step-pulse 2.2s ease-in-out infinite;
}
.step--current .step__label { color: var(--color-text); font-weight: 700; }

.step--todo .step__dot { background: var(--color-surface); }

@keyframes step-pulse {
    0%, 100% { box-shadow: 0 0 0 5px rgba(180, 83, 9, 0.18); }
    50%      { box-shadow: 0 0 0 8px rgba(180, 83, 9, 0.08); }
}

/* Stepper vertical en móvil */
@media (max-width: 720px) {
    .stepper {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .step {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: var(--space-3);
    }
    .step:not(:first-child)::before {
        top: -0.75rem;              /* rellena exactamente el gap vertical */
        right: auto;
        left: calc(1.15rem - 1.5px); /* centro horizontal del punto */
        width: 3px;
        height: 0.75rem;
    }
    .step__dot { flex-shrink: 0; }
    .step__label { font-size: 0.88rem; }
}

/* ── Timeline del historial de un lote ─────────────────────────────────── */
.timeline {
    list-style: none;
    margin: 0;
    padding: var(--space-1) 0 0 0.45rem;
}

.timeline__item {
    position: relative;
    padding: 0 0 var(--space-4) var(--space-4);
    border-left: 2px solid var(--color-border);
}
.timeline__item:last-child { border-left-color: transparent; padding-bottom: 0; }

.timeline__item::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 0.2rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2.5px solid var(--color-surface);
    box-shadow: 0 0 0 1.5px var(--color-primary-soft);
}

.timeline__time {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.1rem;
}

.timeline__text { font-size: 0.92rem; }

/* ── Modal / diálogo ───────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(42, 30, 18, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    animation: fade-in 0.15s ease;
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modal-in 0.2s ease;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
    font-weight: 700;
    font-size: 1.05rem;
}

.modal__body { padding: var(--space-5); overflow-y: auto; }

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface-2);
}

@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); }
                      to   { opacity: 1; transform: translateY(0)   scale(1); } }

/* ── Toasts (host montado en MainLayout) ───────────────────────────────── */
.toast-host {
    position: fixed;
    bottom: var(--space-4);
    right: var(--space-4);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none; /* no bloquear la página; cada toast reactiva eventos */
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    max-width: 380px;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    background: #2c2013;
    color: #f5ecdd;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--color-info);
    cursor: pointer; /* tocar/clicar descarta */
    animation: toast-in 0.25s ease;
}
.toast--info    { border-left-color: #7fb2d9; }
.toast--warning { border-left-color: #f0b429; }
.toast--danger  { border-left-color: #e5636a; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

@media (max-width: 560px) {
    .toast-host { left: var(--space-3); right: var(--space-3); bottom: var(--space-3); }
    .toast { max-width: none; width: 100%; }
}

/* ── Empty state ───────────────────────────────────────────────────────── */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    text-align: center;
    padding: var(--space-6) var(--space-4);
    color: var(--color-muted);
}
.empty__icon, .empty > .icon { font-size: 2.4rem; opacity: 0.85; }
.empty__title { font-weight: 700; color: var(--color-text); }

/* ── Utilidades ────────────────────────────────────────────────────────── */
.muted  { color: var(--color-muted); }
.center { display: flex; align-items: center; justify-content: center; }

.row    { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.stack  { display: flex; flex-direction: column; gap: var(--space-3); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: var(--color-surface-2);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.5rem;
    border-radius: 6px;
    background: var(--color-primary-soft);
    color: var(--color-primary-strong);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

.mt-1 { margin-top: var(--space-1); }  .mb-1 { margin-bottom: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }  .mb-2 { margin-bottom: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }  .mb-3 { margin-bottom: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }  .mb-4 { margin-bottom: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }  .mb-5 { margin-bottom: var(--space-5); }

/* ── Responsive: sidebar → topbar con drawer en móvil ──────────────────── */
@media (max-width: 900px) {
    .page { flex-direction: column; }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: column;
        padding: var(--space-2) var(--space-3);
        position: sticky;
        top: 0;
        box-shadow: var(--shadow-sm);
    }

    .sidebar__top { padding: var(--space-1) var(--space-1); }
    .sidebar__toggle { display: block; }

    .sidebar__nav {
        display: none;
        padding: var(--space-2) 0 var(--space-3);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: var(--space-2);
    }
    .sidebar--open .sidebar__nav { display: flex; animation: fade-in 0.15s ease; }

    .sidebar__foot { display: none; }

    .content { padding: var(--space-4) var(--space-3) var(--space-6); }
}

/* ═══════════════════════════════════════════════════════════════════════
   Requisitos funcionales de Blazor — NO TOCAR (cargador WASM y error UI)
   ═══════════════════════════════════════════════════════════════════════ */
.app-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; }

.loading-progress {
    position: relative; display: block; width: 8rem; height: 8rem; margin: 20vh auto 1rem auto;
}
.loading-progress circle {
    fill: none; stroke: #e0e0e0; stroke-width: 0.6rem; transform-origin: 50% 50%; transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: #b5651d; stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text { text-align: center; font-weight: bold; color: #555; }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Cargando"); }

#blazor-error-ui {
    background: #ffe8d4; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none;
    left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
