/* ================================================================
   RESET
================================================================ */
*, *::before, *::after {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-mono);
    font-size: var(--font-size-base);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

/* ================================================================
   NAVBAR
================================================================ */
.navbar {
    height: var(--navbar-h);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    flex-shrink: 0;
    z-index: 10;
}

.navbar__brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.navbar__icon {
    font-size: 1.3rem;
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
}

.navbar__title {
    font-size: var(--font-size-md);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--color-text);
}

.navbar__actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: nowrap;
    align-items: center;
}

.navbar__actions .btn {
    height: 32px;
    padding-top: 0;
    padding-bottom: 0;
}

.navbar__actions .btn--icon {
    width: 32px;
    height: 32px;
}

/* ================================================================
   APP LAYOUT (grid de 3 columnas)
================================================================ */
.app-layout {
    position: relative;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr var(--sidebar-r-w);
    height: calc(100vh - var(--navbar-h));
    overflow: hidden;
}

/* ── Divisores resizable de sidebars ── */
.resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    z-index: 25;
    background: rgba(255, 255, 255, 0.06);
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
}
.resize-handle:hover,
.resize-handle.is-dragging {
    background: rgba(96, 165, 250, 0.25);
    border-color: var(--color-primary);
}
.resize-handle--left  { left: var(--sidebar-w); }
.resize-handle--right { right: var(--sidebar-r-w); }
.resize-handle.is-dragging {
    cursor: col-resize;
    user-select: none;
}

/* Ocultar divisores en pantallas chicas donde el layout deja de ser grid */
@media (max-width: 1023px) {
    .resize-handle { display: none; }
}

/* ================================================================
   SIDEBAR (izquierdo y derecho)
================================================================ */
.sidebar {
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sidebar--right {
    border-right: none;
    border-left: 1px solid var(--color-border);
    overflow-x: hidden;
    min-width: 0;
}

.sidebar--right .panel,
.sidebar--right .panel__body {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--color-border-2); border-radius: 2px; }

/* ================================================================
   PANELS
================================================================ */
.panel {
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.panel__header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: var(--space-xs);
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.panel__header .panel__title {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.panel__title {
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.panel__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.panel__body--scroll {
    max-height: 240px;
    overflow-y: auto;
    padding-right: var(--space-xs);
}

/* Las tarjetas nunca se comprimen: si no entran, aparece el scroll interno. */
.panel__body--scroll > * {
    flex-shrink: 0;
}

.panel__body--scroll::-webkit-scrollbar { width: 3px; }
.panel__body--scroll::-webkit-scrollbar-thumb { background: var(--color-border-2); }

/* ================================================================
   INFO ROWS (datos del warehouse)
================================================================ */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--color-border);
}

.info-row:last-child { border-bottom: none; }

.info-label { color: var(--color-text-muted); }
.info-value  { color: var(--color-text); font-weight: 500; }

/* ================================================================
   CANVAS AREA
================================================================ */
.canvas-area {
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    overflow: hidden;
}

.canvas-toolbar {
    height: 38px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
    flex-shrink: 0;
}

.canvas-toolbar__right {
    display: flex;
    gap: var(--space-xs);
}

.canvas-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    letter-spacing: 0.06em;
}

.canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#warehouse-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.canvas-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    color: var(--color-text-dim);
    pointer-events: none;
}

.canvas-placeholder__icon {
    font-size: 3rem;
    opacity: 0.3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-dim);
}

.canvas-placeholder p {
    font-size: var(--font-size-sm);
}

.canvas-placeholder.hidden { display: none; }

/* ================================================================
   CONTROLES DE SIMULACIÓN
================================================================ */
.sim-controls {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
}

/* Agrupa un label con su control (select/input/range) */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* ================================================================
   MÉTRICAS
================================================================ */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.metric-card {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-card__label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.metric-card__value {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--color-primary);
}

.compare-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.compare-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: var(--space-xs);
    width: 100%;
}

.compare-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 6px 10px;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compare-result {
    margin-top: var(--space-sm);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

.compare-result::-webkit-scrollbar {
    height: 6px;
}
.compare-result::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
.compare-result::-webkit-scrollbar-thumb {
    background: var(--color-border, #444);
    border-radius: 3px;
}

.compare-badge {
    padding: 5px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--color-border);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ================================================================
   BOTONES
================================================================ */
.btn {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1;
}

/* ── Estado deshabilitado base ──────────────────────────────────── */
.btn:disabled,
button:disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
}

.btn--primary {
    background: var(--color-primary);
    color: #0f0f0f;
    border: 1px solid transparent;
}
.btn--primary:hover:not(:disabled) { background: var(--color-primary-hover); }

.btn--ghost {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border-2);
}
.btn--ghost:hover:not(:disabled) {
    background: var(--color-surface-2);
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

.btn--sm {
    font-size: var(--font-size-xs);
    height: 28px;
    padding: 0 var(--space-sm);
}

.btn--icon {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 0.95rem;
    background: var(--color-surface-2);
    color: var(--color-text);
    border: 1px solid var(--color-border-2);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    overflow: hidden;
}
.btn--icon:hover:not(:disabled) {
    background: var(--color-border-2);
}
.btn--icon.btn--primary {
    background: var(--color-primary);
    color: #0f0f0f;
    border-color: transparent;
}
.btn--icon.btn--primary:hover:not(:disabled) { background: var(--color-primary-hover); }

/* ================================================================
   FORMULARIOS
================================================================ */
.field-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
}

.select {
    width: 100%;
    background: var(--color-surface-2);
    color: var(--color-text);
    border: 1px solid var(--color-border-2);
    border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-sm);
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}

.select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.select:disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
}

.range {
    width: 100%;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* ================================================================
   MISC
================================================================ */
.empty-msg {
    font-size: var(--font-size-xs);
    color: var(--color-text-dim);
    text-align: center;
    padding: var(--space-sm) 0;
    font-style: italic;
}

/* ================================================================
   RESPONSIVE — TABLET (768px – 1023px)
================================================================ */
@media (max-width: 1023px) {
    :root {
        --sidebar-w:     200px;
        --sidebar-r-w:   220px;
    }

    .select {
        font-size: var(--font-size-xs);
    }

    .navbar {
        padding: 0 var(--space-md);
        gap: var(--space-sm);
    }

    .navbar__actions {
        gap: 4px;
    }

    #btn-load-scenario,
    #btn-save-scenario {
        font-size: var(--font-size-xs);
        padding: var(--space-xs) var(--space-sm);
    }
}

/* ================================================================
   RESPONSIVE — MOBILE (< 768px)
================================================================ */
@media (max-width: 767px) {
    html,
    body {
        height: auto;
        overflow: auto;
    }

    .navbar {
        padding: 0 var(--space-sm);
        height: auto;
        min-height: var(--navbar-h);
        flex-wrap: wrap;
        gap: var(--space-xs);
        padding-top: var(--space-xs);
        padding-bottom: var(--space-xs);
    }

    .navbar__title {
        font-size: var(--font-size-sm);
    }

    .navbar__actions {
        gap: 4px;
        flex-wrap: wrap;
    }

    #btn-load-scenario span.btn-label,
    #btn-save-scenario span.btn-label {
        display: none;
    }

    #btn-load-scenario,
    #btn-save-scenario,
    #btn-new-scenario {
        font-size: var(--font-size-xs);
        padding: var(--space-xs) var(--space-sm);
    }

    .app-layout {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .sidebar,
    .sidebar--right {
        width: 100%;
        overflow-y: visible;
        border-right: none;
        border-left: none;
        border-bottom: 1px solid var(--color-border);
    }

    .sidebar {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 0;
    }

    .sidebar::-webkit-scrollbar {
        height: 3px;
        width: auto;
    }

    .sidebar .panel {
        min-width: 220px;
        flex-shrink: 0;
        border-bottom: none;
        border-right: 1px solid var(--color-border);
    }

    .sidebar .panel:last-child {
        border-right: none;
    }

    .sidebar--right {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .sidebar--right .panel {
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    /* ---- CANVAS ---- */
    .canvas-area {
        min-height: 50vh;
    }

    .canvas-wrapper {
        min-height: 50vh;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
    .panel__body--scroll {
        max-height: 140px;
    }

    .sim-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-sm);
    }
}

/* ================================================================
   RESPONSIVE — EXTRA SMALL (< 480px)
================================================================ */
@media (max-width: 479px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .navbar__title {
        font-size: var(--font-size-xs);
        letter-spacing: 0.02em;
    }
    .btn {
        min-height: 36px;
    }

    .btn--sm {
        min-height: 30px;
    }

    #btn-load-scenario,
    #btn-save-scenario {
        font-size: 0.7rem;
        padding: 3px 6px;
    }

    #btn-new-scenario span.btn-label {
        display: none;
    }

    body {
        overflow-x: hidden;
    }
}

/* ================================================================
   RESPONSIVE — LARGE SCREENS (>= 1280px)
================================================================ */
@media (min-width: 1280px) {
    :root {
        --sidebar-w:     260px;
        --sidebar-r-w:   280px;
    }
}

@media (min-width: 1600px) {
    :root {
        --sidebar-w:     280px;
        --sidebar-r-w:   300px;
    }
}

/* ================================================================
   SIMULACION — waves, tabla de comparacion y recogidos
================================================================ */

/* ── Acciones del panel Waves: tamaño uniforme ─────────────────── */
.wave-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1 1 100%;
    min-width: 0;
}

.wave-actions .btn {
    height: 28px;
    padding: 0 4px;
    gap: 3px;
    font-size: 0.625rem;
}

.wave-actions .btn .icon {
    font-size: 13px;
}

/* En pantallas anchas hay lugar para el tamaño original */
@media (min-width: 1024px) {
    .wave-actions .btn {
        padding: 0 8px;
        font-size: var(--font-size-xs);
    }

    .wave-actions .btn .icon {
        font-size: 15px;
    }
}

/* ── Tarjeta de wave en el sidebar izquierdo ─── */
.wave-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
    background: var(--color-surface-2);
    font-size: var(--font-size-xs);
    transition: border-color 0.15s;
}
.wave-item:hover {
    border-color: var(--color-primary);
}
.wave-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}
.wave-item__id {
    font-weight: 700;
    color: var(--color-text);
}
.wave-item__badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-primary);
    background: rgba(79, 156, 249, 0.12);
    border-radius: 4px;
    padding: 1px 5px;
}
.wave-item__meta {
    display: flex;
    justify-content: space-between;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* ── Pedido: cabecera en dos líneas ─────────── */
.order-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

/* Separación entre los botones de editar y borrar */
.order-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

/* Chips de prioridad y estado, en su propia línea */
.order-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 5px;
}

/* Ítem de pedido: cantidad | nombre | id/SKU en una sola línea */
.order-line {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: baseline;
    column-gap: 6px;
    width: 100%;
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

.order-line__qty {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--color-text);
    white-space: nowrap;
}

.order-line__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text);
}

.order-line__sku {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    color: var(--color-text-dim);
    white-space: nowrap;
}

/* ── Tabla de comparacion de estrategias ─────── */
.compare-table {
    width: 100%;
    min-width: 540px;
    border-collapse: collapse;
    font-size: var(--font-size-xs);
    white-space: nowrap;
}
.compare-table th,
.compare-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}
.compare-table th {
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.02);
}
.compare-table th.text-right,
.compare-table td.text-right {
    text-align: right;
}
.compare-table td {
    color: var(--color-text);
}
.compare-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}
.compare-table tr:last-child td {
    border-bottom: none;
}
.badge-algo {
    display: inline-block;
    padding: 1px 5px;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: var(--radius-sm, 3px);
    background: rgba(96, 165, 250, 0.15);
    color: var(--color-primary, #60a5fa);
    text-transform: uppercase;
}

/* ── Comparacion de modos de armado de waves (una sobre la otra) ── */
.wave-compare-grid {
    display: flex;
    flex-direction: column;
    gap: 26px;
    margin-top: 8px;
}

.wave-compare-table {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 6px);
    overflow: hidden;
    background: var(--color-surface, #0f172a);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.wave-compare-table__header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.03);
}

.wave-compare-table__titulo {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wave-compare-table__totals {
    flex-shrink: 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.wave-compare-table__body {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Scroll horizontal igual que la tabla de todas las combinaciones (.compare-result) */
.wave-compare-table__body::-webkit-scrollbar {
    height: 6px;
}
.wave-compare-table__body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
.wave-compare-table__body::-webkit-scrollbar-thumb {
    background: var(--color-border, #444);
    border-radius: 3px;
}

/* Forzamos ancho mínimo para que aparezca el scroll horizontal cuando haga falta */
.wave-compare-table__body table.compare-table {
    min-width: 600px;
}
.wave-compare-table {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 6px);
    overflow: hidden;
    background: var(--color-surface, #0f172a);
}
.wave-compare-table__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
}
.wave-compare-table__totals {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}
.wave-compare-hint {
    margin-top: 10px;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-align: center;
}
.wave-compare-hint--equal {
    color: var(--color-warning, #f59e0b);
    font-weight: 600;
}
.compare-badge--equal {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-sm, 3px);
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning, #f59e0b);
    border: 1px solid rgba(245, 158, 11, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Productos recogidos — tarjetas agrupadas por wave ─────────── */
.panel__count {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-primary);
    background: rgba(79, 156, 249, 0.12);
    border: 1px solid rgba(79, 156, 249, 0.30);
    border-radius: 999px;
    padding: 1px 7px;
}

/* Scroll interno propio de la lista de recogidos: más alto que el resto,
   con barra visible y sin comprimir las tarjetas. */
#collected-list {
    max-height: clamp(160px, 32vh, 340px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}
#collected-list::-webkit-scrollbar { width: 6px; }
#collected-list::-webkit-scrollbar-track { background: transparent; }
#collected-list::-webkit-scrollbar-thumb {
    background: var(--color-border-2);
    border-radius: 3px;
}
#collected-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-dim);
}

.collected-wave {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    overflow: hidden;
    animation: collected-card-in 0.22s cubic-bezier(.16, 1, .3, 1);
}

.collected-wave__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: 5px var(--space-sm);
    background: rgba(79, 156, 249, 0.10);
    border-bottom: 1px solid var(--color-border);
}

.collected-wave__title {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--color-primary);
}

.collected-wave__count {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.collected-wave__list {
    display: flex;
    flex-direction: column;
    padding: 3px var(--space-sm) 5px;
}

.collected-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: var(--font-size-xs);
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    animation: collected-item-in 0.2s ease-out;
}

.collected-item:last-child {
    border-bottom: none;
}

.collected-item__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collected-item__id {
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--color-text-dim);
}

@keyframes collected-card-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes collected-item-in {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ================================================================
   MODO DE ENFOQUE DEL RECORRIDO — toggle button
================================================================ */
.focus-mode-row {
    display: flex;
    justify-content: center;
}

/* Estado normal: igual que btn--ghost */
.focus-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    width: 100%;
    padding: 6px;
    border: 1px solid var(--color-border-2);
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    cursor: pointer;
    font-size: var(--font-size-xs);
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.focus-switch-row:hover {
    border-color: var(--color-text-muted);
    color: var(--color-text);
}

.focus-switch-row.active {
    border-color: rgba(251, 191, 36, 0.55);
    color: #fbbf24;
}

.focus-switch-row .switch__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Track del switch (más pequeño) */
.switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 16px;
    background: var(--color-border-2);
    border-radius: 8px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.focus-switch-row.active .switch {
    background: rgba(251, 191, 36, 0.55);
}

/* Thumb del switch (más pequeño) */
.switch__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: var(--color-surface);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.focus-switch-row.active .switch__thumb {
    transform: translateX(16px);
    background: #fbbf24;
}
