/* Filas de tiempo */
.fila-tiempo {
    display: grid;
    grid-template-columns: 44px 80px 10px 64px 44px 44px auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    transition: border-color var(--transition), box-shadow var(--transition);
    animation: fadeInRow 0.2s ease forwards;
}

@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fila-tiempo:focus-within {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

/* Selector +/− */
.op-select {
    appearance: none;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.45rem 0.3rem;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    background: var(--bg-soft);
    cursor: pointer;
    text-align: center;
    width: 100%;
    outline: none;
    transition: border-color var(--transition);
}

.op-select:focus {
    border-color: var(--secondary-color);
}

/* Inputs de hora y minuto */
.num-input {
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.45rem 0.5rem;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    width: 100%;
    outline: none;
    transition: border-color var(--transition);
    background: #fff;
}

.num-input:focus {
    border-color: var(--secondary-color);
}

.sep-label {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

.unidad-label {
    font-family: var(--font-primary);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.btn-del {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-del:hover {
    background: #dc2626;
    color: #fff;
}

/* Encabezado de columnas */
.filas-header {
    display: grid;
    grid-template-columns: 44px 80px 10px 64px 44px auto;
    gap: 0.5rem;
    padding: 0 0.9rem;
    margin-bottom: 0.3rem;
}

.filas-header span {
    font-family: var(--font-primary);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-align: center;
}

/* Lista de filas */
.filas-lista {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Resultado grande */
.resultado-grande {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.resultado-grande::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.res-label-top {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
}

.res-hhmmss {
    font-family: var(--font-primary);
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.02em;
}

.res-hhmmss.negativo {
    color: #fca5a5;
}

.res-decimal {
    font-family: var(--font-primary);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
}

/* Desglose de conversiones */
.desglose-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
}

.desglose-item {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    text-align: center;
}

.desglose-label {
    font-family: var(--font-primary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.desglose-val {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Timeline visual */
.timeline-wrap {
    margin-top: 0.5rem;
}

.timeline-bar-bg {
    height: 24px;
    border-radius: 50px;
    background: var(--border-color);
    overflow: hidden;
    display: flex;
    position: relative;
}

.timeline-seg {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    transition: width 0.4s ease;
}

.timeline-labels {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.timeline-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-primary);
}

.tl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Botones acción */
.acciones-wrap {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn-accion {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: 50px;
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    border: 1.5px solid var(--border-color);
    background: var(--bg-soft);
    color: var(--text-muted);
}

.btn-accion:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.btn-accion.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

/* Presets rápidos */
.presets-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
}

.preset-chip {
    padding: 0.3rem 0.8rem;
    border: 1.5px solid var(--border-color);
    border-radius: 50px;
    background: var(--bg-soft);
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.preset-chip:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

@media (max-width: 540px) {
    .fila-tiempo {
        grid-template-columns: 40px 70px 8px 56px 40px auto;
        gap: 0.35rem;
        padding: 0.55rem 0.6rem;
    }

    .filas-header {
        grid-template-columns: 40px 70px 8px 56px 40px auto;
        gap: 0.35rem;
        padding: 0 0.6rem;
    }

    .res-hhmmss {
        font-size: 2.4rem;
    }
}